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

Revise operator syntax and == semantics #3765

Closed
gbracha opened this issue Jun 20, 2012 · 2 comments
Closed

Revise operator syntax and == semantics #3765

gbracha opened this issue Jun 20, 2012 · 2 comments
Assignees
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language).
Milestone

Comments

@gbracha
Copy link
Contributor

gbracha commented Jun 20, 2012

The current spec introduces special identifiers, equals and negate for the == and unary minus operators.

This is inelegant, and raises various issues,such as the meaning of these names when used directly.
The name equals in particular, is liable to be used directly by Java programmers.

The == function semantics are also problematic, as the special treatment of identity, while attractive, does not work well with the bizarre semantics of NaN.

Instead, we will allow unary minus to be defined as an operator named "-". It will be distinguished from binary minus by its arity. We will define == as a method, despite the fact that the expression e1 == e2 will not directly call the == method, but first test against null (but not for identity).

The details are in the 0.11 spec draft (sections 7.1.1 and 10.20 primarily).

@sethladd
Copy link
Contributor

Are both implementations conformant to this? If not, do we have tracking bugs?

I think the VM issue is bug 2506

@ghost
Copy link

ghost commented Aug 17, 2012

It seems that this has been implemented by dart2js and VM. The only missing piece are co19 tests

@gbracha gbracha added Type-Defect area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). labels Aug 17, 2012
@gbracha gbracha self-assigned this Aug 17, 2012
@gbracha gbracha added this to the M1 milestone Aug 17, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language).
Projects
None yet
Development

No branches or pull requests

3 participants