Created
March 17, 2014 17:13
-
-
Save yocontra/9603799 to your computer and use it in GitHub Desktop.
Overloads the | operator to let you put streams together. This is just a fun project, don't use this.
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
macro | { | |
rule infix { | |
$x:expr | $y ($args ...) | |
} => { | |
$x.pipe($y($args...)) | |
} | |
rule infix { | |
$x:expr | $y | |
} => { | |
$x.pipe($y) | |
} | |
} | |
/* | |
a | b(2) | c(1) | haha | 123 | |
becomes | |
a.pipe(b(2)).pipe(c(1)).pipe(haha).pipe(123); | |
*/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🍻