-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
make from
an operator
#14241
make from
an operator
#14241
Conversation
Needs an update of the manual and a changelog entry. |
Docs CI failures seem to stem from b8e6ea7 |
out of curiosity, what are use cases for The situation with math operators such as var ret: string
ret.from "12" # returns void it may be confusing if operators returns void or non-void depending on the overload. |
|
both 1 and 2 are good enough reasons, thanks! (and I'd be forever grateful if you could turn |
Just extra syntax (for DSLs and macros) to use. I don't see any downsides to this.
There are other keywords that work fine when made operators, but may be limited to infix only.
for
,if
,else
,when
,while
with precedence 1 can be used for list comprehensions (though you have to doa if b for c in d
unlike python) or postfix conditionals, andusing
is just an English word that sounds normal when used asa using b
.