Allow operators as method names #27
Labels
feature-request
Any request for a new feature of the language. Includes both syntax and library features.
syntax
Any issue relating to the syntax of Myst.
Milestone
The parser and native library already implement
+
,-
,*
,/
as Calls to methods on objects. This should also be allowed in definitions within the language. For example:This is a contrived example, for sure, but shows how the syntax can be used. This is particularly helpful for things like
DateTime
s or numeric replacements (e.g.,BigInteger
).The only change needed for this should be allowing the operators as method names. The parser should already handle the infix calls properly.
The operators that should be supported are:
+
,-
,*
,/
,%
,<
,<=
,==
,!=
,>=
,>
,[]
,[]=
, and=:
(see #11). Handling unary operators (-
,!
,*
) can come later, since the interpreter doesn't currently support these anyway.The text was updated successfully, but these errors were encountered: