| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Does Codd's view of a relational database differ from that ofDate&Darwin?[M.Gittens]
VC wrote:
> "Jan Hidders" <jan.hidders_at_REMOVETHIS.pandora.be> wrote in message
> news:P3%ue.129170$kp7.6954108_at_phobos.telenet-ops.be...
>> >>Well, to be precise, the for expression in XQuery is based on the monoid >>comprehension for lists, not the monadic comprehension for lists. But that >>is not what you meant. >> >>Let's look at the following example: >> >>for $x in (for $y in (1, 2, 3) return $y + $y) return $x * $x >> >>Can you tell me what the side effect of the nested return is? As far as I >>can see it simply returns a value as is expected from the list >>comprehension.
Yes. In this case that is correct, but note that in general the translation is
for $x in e1 return e2 => flatten(map(\x->e2, e2))
> If the answer is yes, then the 'return' is just a lambda expression, right
> ?
Yes.
> If so, then I retract my previous statemnt that 'return' in XQuery is
> equivalent to 'print' in Daplex.
Ok.
> Just out of sheer curiosity, why then use
> the word 'return at all ?
Dunno. It came from Quilt, one of the fore-runners of XQuery. I suppose they thought it made queries easier to read and gave them a bit more SQL'ish flavor by starting each clause with a keyword. Either that, or they really liked the idea of being able to tell the world that FLWR expression should be pronounced as "flower expressions". :-)
![]() |
![]() |