Re: Negation section text updated.

On 20/05/2010 9:23 AM, Steve Harris wrote:
>> >  Note that there are two syntax for negation :
>> >
>> >  filter(not exists PAT)
>> >
>> >  filter(! exists PAT)
> However, NOT doesn't appear to by a synonym of !, so it's not legal to write FILTER(NOT ?x=1), which seems a little odd.
>
> I think we should either add a NOT operator, or remove NOT from EXISTS, and just use !.
>

NOT is used in two places:

     NOT EXISTS
     ?x NOT IN (1,2,3)

It is part of the token for the operator, which makes it easier for the 
implementer.  The tokens are "NOTws*EXISTS" and "NOTws*IN".

The second one in particular is used in a way that is an infix operator. 
"NOT IN" is the operator taking a LHS expression and a RHS list of 
expressions.

We can introduce a general NOT if you want, as a synonym for ! but that 
does not remove it's need elsewhere.

We use ! elsewhere : !=

By the way:

If FILTER(NOT ?x=1) => FILTER(! ?x=1) it means FILTER( (!?x)=1)

 Andy

Received on Thursday, 20 May 2010 19:05:56 UTC