[sc34wg3] TMQL: Operators "Not equal"

Robert Barta rho at devc.at
Mon Oct 29 05:33:45 EDT 2007

On Fri, Oct 26, 2007 at 05:22:25PM +0200, Lars Heuer wrote:
> The current draft lacks of a not equal operator, like "!=". Is that
> intentional?
> A not equal operator is quite handy even if
>        not(1.0 = 2.0)
> works, though.

Careful here: 

'==' has 'exists semantics' as it is operating on sequences! So 

  select $p / name
     $p isa person
  &  $p / homepage != "http://myspace.com/"

might not really signal what is going on. If I read the above quickly,
then I would select all persons which have not a homepage at MySpace.

But what it means is

  not ($p / homepage == "http://myspace.com/")

So I'm actually asking for all persons where it is

  "not true, that there is at least one MySpace homepage"

The proposed notation

  $p / homepage != "http://myspace.com/"

would more indicate

  "no homepage is on MySpace"

This is also the reason to prefer '==' over '=', because the query
author should keep that in mind.

And then he said: "You should read my blog." http://kill.devc.at/

More information about the sc34wg3 mailing list