Skip to content

Instantly share code, notes, and snippets.

@paniq
Created March 19, 2019 23:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paniq/6b2013d1a0c8214826c9f0f48f4d3e6f to your computer and use it in GitHub Desktop.
Save paniq/6b2013d1a0c8214826c9f0f48f4d3e6f to your computer and use it in GitHub Desktop.
# 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