-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Symbol literals #23
Comments
Great idea, I loved this stuff in Ruby. One thing that seems a bit weird to me is the operator overloads. In that case I think simply The parser can easily handle that special case after |
Fair enough with operators being simple, instead of symbols. But maybe we could allow symbol function names for manual dynamic dispatch for example. Another thing, what would we do for postfix operators? Example:
|
If |
Maybe you could use the
|
In the current design, prefix is any function that takes a single argument. |
Add symbol literals for use with quoting and macro creation, dictionary keys and other constructs.
Symbols are primitive values, and can be composed.
They would also be useful for defining custom operators. For example, overloading the
+
operator could be the form of:fn :+ (self, other)
Symbol literals would have the form of:
:[\S]+
Example
Given:
Extract the value:
The text was updated successfully, but these errors were encountered: