[sc34wg3] TMQL: Operators "Not equal"

Robert Barta rho at devc.at
Tue Oct 30 07:19:29 EDT 2007


On Tue, Oct 30, 2007 at 11:14:57AM +0100, Lars Marius Garshol wrote:
> In tolog
> 
>   select $p from
>     instance-of($p, person),
>     homepage($p, $url),
>     $url /= "http://myspace.com/"?
> 
> and
> 
>   select $p from
>     instance-of($p, person),
>     homepage($p, $url),
>     not($url = "http://myspace.com/")?
> 
> actually mean exactly the same. The last line of both queries remove  
> all matches (binding sets in TMQL terminology) where $url is "http:// 
> myspace.com/".

Yes, tolog is not list aware. So the programmer has to 'step manually'
through all list members and tick them off.

In TMQL you can operate on lists. So if that semantics does it for
you, you're done. You can also iterate through lists if you need that.

> So, you are saying that in your opinion '!=' should be left out  
> because its semantics are counter-intuitive?
> 
> Actually, the
> 
>   "not true, that there is at least one MySpace homepage"
> 
> semantics seem pretty much like what is wanted and expected to me. Or  
> at least no further off target than the semantics for '==', which are  
> also not entirely intuitive.

What I'm saying is that

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

would mean to me that "not a single homepage, of the possibly many, is
on MySpace", which is different to your interpretation above!

So if we want != they way you expect, it would have to be defined one
way. And we would have to cover the case of no homepage at all. But
alone our discussion tells that we will surprise at least some people.

\rho


More information about the sc34wg3 mailing list