Guile pipe macros for functional chaining, similar to the UNIX pipe "|" operator.
Provides identical functionality to Clojure's function threading macros (-> and ->>).
Guile is required.
Run sudo ./install
to install pipe to Guile's site-dir folder.
Import pipe with
(use-modules (pipe))
You can then use the thread-first ->
and thread-last ->>
macros like so:
guile> (-> 100 (/ 10) (/ 5))
2
guile> (->> 100 (/ 10) (/ 5))
50
The first s-expression will be inserted as the first argument of the next s-expesssion.
Example: (-> 100 (/ 10) (/ 5))
becomes (/ (/ 100 10) 5)
The first s-expression will be inserted as the last argument of the next s-expesssion.
Example: (->> 100 (/ 10) (/ 5))
becomes (/ 5 (/ 10 100))
Pipe is released under the GNU GPLv3 license.