-
-
Notifications
You must be signed in to change notification settings - Fork 5
precedence
Pannous edited this page Oct 9, 2021
·
5 revisions
Custom precedence of custom operators is a first class citizen and key feature of the angle programming language. It makes many macros unnecessary and instead allows building elegant code from first principles.
Todo
Per-function precedence does NOT really increase readability or bug safety
Error: Ambiguous mixing of function and operator.
square 3 * 3
can be read as square (3 * 3)
or (square 3) * 3
# RUBY:
square 3 + square 3
can be read as square (3 + square 3)
or (square 3) + square 3
# RUBY: syntax error!