Re: Empty sequences in "for" clause bindings
Philippe Michiels <[email protected]> Thu, 8 Jul 2004 19:36:54 +0200
| Newsgroups | gmane.comp.web.query-languages |
|---|---|
| Organization | Universiteit Antwerpen |
| Message-ID | <[email protected]> |
According to the Formal Semantics (section FOR expressions) <quote> The evaluation of a for expression distinguishes two cases: If the iteration expression Expr1 evaluates to the empty sequence, then the entire expression evaluates to the empty sequence: dynEnv |- Expr1 => () dynEnv |- for VarRef1 TypeDeclaration? in Expr1 return Expr2 => () </quote> Since the expression you mentioned is normalized into two separate for loops, you will get the empty sequence as a result. Best, Ph On Thursday 08 July 2004 18:58, Stéphane Mbaye wrote: > Dear all, > > how for clause tuples are generated when some of the bounded variables > match the empty sequence ? > > For example should the following query return (1, 2, 3), an error or > anything else ? > > for $a in (), $b in (1, 2, 3) > return ($a, $b) > > > Regards > > > Stéphane > Mbaye > _____ > > > GAEL Consultant > Cité Descartes > 18, rue Albert Einstein > 77420 Champs-sur-Marne > France > Software Director > > mailto:[email protected] > http://www.gael.fr > > > tel +33-(0)1 64 73 99 55 > fax +33-(0)1 64 73 51 60 -- Philippe Michiels Universiteit Antwerpen ADReM (Advanced Database Research and Modelling) http://www.adrem.ua.ac.be/~michiels