This allows operators such as + or % in a few places where previously only symbols were allowed:
In variable name in assignments: let + = "hello"
As function name in a function call: + 3 4 (- 2 5)
In map keys and values: let foo = { +=% }
As indices: foo@+
In all other places, the operator must be wrapped in parentheses:
echo 3 (+) 5 # prints the integer 3, the addition operator and the integer 5
(+)@- # accesses the key `-` of the object `+`
Operators can still be used in infix position:
> 3 + 5 == (+ 3 5)
True
> fmt @ dark @ blue == (@ fmt dark blue)
True
@, | and >> are turned into operators. They were classified as punctuation before, which doesn't make sense because unlike punctuation they can be overloaded.
! is added, which I apparently forgot to add to the tokenizer.
Builtin operators are renamed to the respective symbol. E.g. __add__ is now +, and redirect-to is now >>.
This allows operators such as
+
or%
in a few places where previously only symbols were allowed:let + = "hello"
+ 3 4 (- 2 5)
let foo = { +=% }
foo@+
In all other places, the operator must be wrapped in parentheses:
Operators can still be used in infix position:
@
,|
and>>
are turned into operators. They were classified as punctuation before, which doesn't make sense because unlike punctuation they can be overloaded.!
is added, which I apparently forgot to add to the tokenizer.Builtin operators are renamed to the respective symbol. E.g.
__add__
is now+
, andredirect-to
is now>>
.