Created
March 19, 2019 23:58
-
-
Save paniq/6b2013d1a0c8214826c9f0f48f4d3e6f to your computer and use it in GitHub Desktop.
This file contains 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
# last value in an expression block is returned | |
do | |
true | |
# when we want to return multiple arguments, there's a pass-through token: | |
do | |
_ true true | |
# how do we pass zero arguments? | |
do | |
_; # semicolon causes it to still be wrapped in a list | |
# though one could make the mistake and return the token instead | |
do | |
_ | |
# how about a different way to pass zero arguments? | |
do | |
; # semicolon causes an empty list to be generated | |
##### AND FROM HERE ON, LET'S DREAM A LITTLE ##### | |
# in fact, why not make zero arguments the pass-through function? | |
do | |
() true true | |
# which means we could now alias _ differently | |
let _ = () | |
do | |
_ true true | |
# and the single token is no longer a mistake | |
do | |
_ | |
# what about calling arguments with arguments? | |
do | |
(_ f) true true | |
# obviously the same as | |
f true true | |
# what about calling MULTIPLE arguments with arguments? | |
do | |
(_ f1 f2 f3) true true | |
# might be the same as | |
_ | |
f1 true true | |
f2 true true | |
f3 true true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment