RE: NASL2: precedence of 'logical NOT'

Michel Arboi <[email protected]>
Newsgroups gmane.comp.security.nessus.devel
Message-ID <1045430398.1014.26.camel@rotissoire>
On Sun, 2003-02-16 at 10:12, Jim Cervantes wrote:
> Isn't it true that most programming languages give unary operators very high
> precedence?

Well, that's what C does. But I'm not sure it is a good example (e.g.
the precedence of & and | is *bad*)

>  I have always found this easy on the brain since it translates
> into unary operators always binding to tokens that immediately follow.
> Won't most people with at least some programming experience find what you
> are suggesting to be unfamiliar?

Then there is another possibility: implement additional logical
operators (and, or, not) with very low precedence, like in Perl.

! x == y   <=> (! x) == y
not x == y <=> ! (x == y)

This means that ! x >< y is buggy code.
egrep '! *[_a-zA-z0-9-]+.*><' *.nasl   does not return any suspicious
code in the current plugins.

And it seems that nobody had the bad idea of calling a variable 'and'
'or' or 'not'. Good.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.