Skip to content
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

More Operator Overloading #635

Closed
PhoenixZeng opened this issue Mar 20, 2018 · 1 comment
Closed

More Operator Overloading #635

PhoenixZeng opened this issue Mar 20, 2018 · 1 comment

Comments

@PhoenixZeng
Copy link

Through some historical problems, I know that the overloading operators which used by wurst are ambiguous
but support overloading the not-used operators by user maybe a good idea
just like
{ } :: # $ ^ & ~ | !
if it support we can use by myself definition like "&" as "and" , "!" as "not "

@Frotty
Copy link
Member

Frotty commented Mar 20, 2018

There is an open ticket with the exact same name, you can comment/react there.
#297
Please verify that an issue doesn't already exist and that it's a valid ticket before creating it 👎

Also, adding overloading for such operators { } ^ & ~ that don't even exist in the language, doesn't really make sense imo.
In the end you have to remember that all of this is syntactic sugar. Simply using functions is more intuitive and readable in most cases. Even in languages where such overloading exists, it is rarely used in production. Overloading for certain packages, like vectors, can make sense. Redefining "and" as & not so much.

@Frotty Frotty closed this as completed Mar 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants