RE: NASL2: precedence of 'logical NOT'
Michel Arboi <[email protected]>
| Newsgroups | gmane.comp.security.nessus.devel |
|---|---|
| Message-ID | <1045438331.1016.54.camel@rotissoire> |
On Sun, 2003-02-16 at 12:20, Jim Cervantes wrote:
> I strongly agree with the idea of matching another popular language's
> precedence (and associativity for that matter). Why do we need another
> language's precedence rules?
Because most of the time, C or Perl try to be a little too smart for my
tired brain. And I cannot trust them fully:
* I have _never_ seen an example of C or Perl code where "x & y ==
z" should really behave as it is implemented.
* I cannot see why "x == y == z" or " x < y < z" is authorized in C
or Perl. If somebody needs it, it should be implemented the way it
is in mathematics (i.e. "x < y and y < z" and not some crazy
integer to boolean compare)
* And I am just realizing that we should forbid things like "!!x" or
"~~ x" because they are useless now and may clash with some future
operator (Sorry Renaud! Implementing "!!" is easier than the fish
operator ">(°>" :)
Anyway I agree that one expects a "compact" operator (I mean, with a
very short name) like "!" to be strongly tied to the next variable.
That's more a problem of readability than logic.