Created
March 22, 2017 13:04
-
-
Save vbuaraujo/c4a3037a3acba8dc20839b9f34e833f1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-syntax >> | |
(syntax-rules () | |
[(>> val1 (fun args ...)) | |
(fun val1 args ...)] | |
[(>> val1 val2 rest ...) | |
(>> (>> val1 val2) rest ...)])) | |
;; Examples. | |
(format #t "~s\n" | |
(>> 10 | |
(* 2) | |
(+ 3))) | |
(format #t "~s\n" | |
(>> "foo,bar,baz" | |
(string-split #\,) | |
(list-ref 1) | |
(string-upcase))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment