[sc34wg3] TMQL: Predicate invocation and scope
Robert Barta
rho at devc.at
Wed Jul 9 05:38:40 EDT 2008
On Tue, Jul 08, 2008 at 05:36:09PM +0200, Lars Heuer wrote:
> Hi Lars,
>
> [ $a = member-of(member: $p, group: $g)]
> > I know this doesn't work now. It's not even syntactically valid, as
> > far as I know. But we could define this in such a way that it *would*
> > work.
>
> I don't know if it is worth, because we'd change the meaning of
> predicate invocations seriously.
Predicate invocations generate association items, so in
select $p, $q
where
member-of(member: $p, group: $g)
the 'member-of(member: $p, group: $g)' gets converted (I'm simplifying)
into
// member-of [ . -> member == $p ] [ . -> group == $g ] ..
> Not sure if it is a good or bad thing.
Not sure what you want to say here.
> What happens to the variables $p and $g if the predicate invocation
> returns associations?
I cannot see a problem. $p and $g will be instantiated with items, so
that the 'member-of(member: $p, group: $g)' gives some non-empty
result (in other words: "exists"). If you want all of it, then
select $p, $q, $a
where
$a == member-of(member: $p, group: $g)
will do the obvious.
\rho
More information about the sc34wg3
mailing list