Skip to content

Instantly share code, notes, and snippets.

@vito
Created September 5, 2010 21:47
Show Gist options
  • Save vito/566354 to your computer and use it in GitHub Desktop.
Save vito/566354 to your computer and use it in GitHub Desktop.
associativity & precedence declarations
atomo $ atomo
> { 1 -> 2 * 3 }
{ (1 -> 2) * 3 }
> operator right ->
@ok
> { 1 -> 2 * 3 }
{ 1 -> (2 * 3) }
>
atomo $ atomo
> a ++ b := a + b
@ok
> a ** b := a * b
@ok
> { 1 ++ 2 ** 3 }
{ (1 ++ 2) ** 3 }
> operator 7 **
@ok
> operator 6 ++
@ok
> { 1 ++ 2 ** 3 }
{ 1 ++ (2 ** 3) } -- ta-da!
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment