Skip to content

Instantly share code, notes, and snippets.

@creationix
Created November 7, 2018 04:49
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 creationix/1eecd15f0dadfd130f4b7d82d8bcc0a6 to your computer and use it in GitHub Desktop.
Save creationix/1eecd15f0dadfd130f4b7d82d8bcc0a6 to your computer and use it in GitHub Desktop.
integer literals
1 -- integer
-5 -- integer
rational literals
1/4 -- rational
3.141 -- rational (syntax sugar for 3141/1000)
tuple literal
( expression* )
(1 2) -- two values
(1) -- single value is allowed
() -- empty tuple is allowed too
code literal, does not eager eval contents, returns code block as value
{ code... }
code literal parameters
{ a b : a + b }
variable assignment
set add { a + b }
set (a b) (a b)
pipeline operator for passing arguments
(1 2) | add
call operator for passing arguments
easy iterators/loops
loop 5 {
@ | log
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment