Skip to content

joshwalters/guile-pipe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Guile Pipe

Guile pipe macros for functional chaining, similar to the UNIX pipe "|" operator.

Provides identical functionality to Clojure's function threading macros (-> and ->>).

Requirements

Guile is required.

Installation

Run sudo ./install to install pipe to Guile's site-dir folder.

Usage

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

Thread first macro ->

The first s-expression will be inserted as the first argument of the next s-expesssion.

Example: (-> 100 (/ 10) (/ 5)) becomes (/ (/ 100 10) 5)

Thread last macro ->>

The first s-expression will be inserted as the last argument of the next s-expesssion.

Example: (->> 100 (/ 10) (/ 5)) becomes (/ 5 (/ 10 100))

License

Pipe is released under the GNU GPLv3 license.

About

Guile pipe macros for functional chaining, similar to the UNIX pipe "|" operator.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages