-
Notifications
You must be signed in to change notification settings - Fork 33
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
not operator #287
Comments
I think it should bind tighter than
* marks the one that I think may be dubious. |
I think I figured out why I find this confusing. Currently:
...so it feels a little weird for But I think the fix is to change the precedence of x || y and z || w >>>> (x || y) && (z || w) I notice that Perl goes a little far: I'd argue that
What do you think? We'd need to turn this off for |
I think that having different precedence for word and symbol operators in fine/good. I also agree that it would be best to keep the precedence the same within groups ( But having Interesting to think about... we might want to let this one stew for a while. |
Indeed, having Extending the subject further, I'd love other CoffeeScript keywords to officially return to Civet. And to please Pythonists even more, |
|
Yea, that was my 1st Civet letdown that we'd need those "civet" flag thingies. 😿 |
I'm trying to be very judicious about adding to the number of reserved words. Each additional reserved word prevents existing code from moving to Civet without issue. |
|
FWIW, I believe I don't see why one would prefer |
|
Back to even 0 and 3 → even(0) && 3
even 0 && 3 → even(0 && 3) It looks like Ruby also agrees on CoffeeScript seems to be the odd one out in making them aliases (at the lexer level) so identical precedence. At this point I'd lean toward The one downside is that this complicates the grammar... Related question: what precedence do custom |
In fact P.S. The lack of |
Well, for sure those happen in languages that don't have them as reserved keywords, right? Civet is closely related to CoffeeScript, Python, Ruby. Any programmer writing code for a Python-related language would already know they can't use those labels. Idem for CoffeeScript. Once the compiler warns a programmer they can't use a reserved keyword as a label, such as |
Right, so
|
* New "low-predecence" operators `and`/`or`/`not` via parse tree and parenthesization, effectively just below `&&`/`||`/`!` * Implement `not` in all cases (fixes #287) * New `coffeeAndOr` restores CoffeeScript's precedence for `and`/or` (same as `&&`/`||`) * Old `coffeeNot` restores CoffeeScript's precedence for `not` (same as `!`)
* New "low-precedence" operators `and`/`or`/`not` via parse tree and parenthesization, effectively just below `&&`/`||`/`!` * Implement `not` in all cases (fixes #287) * New `coffeeAndOr` restores CoffeeScript's precedence for `and`/or` (same as `&&`/`||`) * Old `coffeeNot` restores CoffeeScript's precedence for `not` (same as `!`)
* New "low-precedence" operators `and`/`or`/`not` via parse tree and parenthesization, effectively just below `&&`/`||`/`!` * Implement `not` in all cases (fixes #287) * New `coffeeAndOr` restores CoffeeScript's precedence for `and`/`or` (same as `&&`/`||`) * Old `coffeeNot` restores CoffeeScript's precedence for `not` (same as `!`)
Is this closed by #557 ? |
Yes, unless we want to continue discussing lower-precedence and/or/not. But I guess we have #548 to track that. I'm also not super convinced separate precedence is that important... |
Civet has
and
andor
, but currently nonot
. It does havenot in
,not instanceof
, etc., andnot
is now reserved.It's probably time to add a
not
operator as shorthand for!
.@STRd6 wanted this to have different precedence than
coffeeNot
. Is it thatnot x == y
parses asnot (x == y)
as in Python, as compared to(not x) == y
in CoffeeScript? How shouldnot x or y
parse? I would guess(not x) or y
. Trying to figure out the general rule...The text was updated successfully, but these errors were encountered: