Re: Does Codd's view of a relational database differ from that ofDate&Darwin?[M.Gittens]
Date: Wed, 22 Jun 2005 19:57:45 -0400
Message-ID: <ipKdnQImv9tkZyTfRVn-rg_at_comcast.com>
"Jan Hidders" <jan.hidders_at_REMOVETHIS.pandora.be> wrote in message
news:UGiue.127257$mY2.7061611_at_phobos.telenet-ops.be...
> vc wrote:
[...]
>> But let's not sidetrack to XQuery, rather tell me what 'print' is in
>> Daplex without drawing analogies with XQuery. Just give a definition
>> if you please.
>
> The identity function. The print is only there to indicate that you
> produce a value, so you can simply translate it to the expression that
> produces that value if you makes sure that they are concatenated for each
> value that you iterate over.
I do not understand this. I tried different interpretation but none fits.
The closest translation might be:
"' for each' denotes a list comprehension; 'print' is a monadic unit
(identity ?) presumably applied to the constructed list. Is that so ? Or
>And that's of course exactly what list comprehension does.
List comprehension does nothing of the kind. LC is just a shorthand for
constructing lists and can easily be replaced with a combination of 'map',
'filter' and 'concat'. E.g.:
given L= [1,2,3], [ 2*x | x <- L ] will produce [2,4,6]. That's all.
>
>> More importantly, you admit implicitely that the 'for' ... 'print'
>> fragment is indeed imperative by appealing to the monad notion which is
>> used in pure functional languages in order to encapsulate non-pure side
>> effects, states, IO and such.
>
> Yes, but I don't need all that. Just list or set comprehension will do.
What's that supposed to mean ? How can list construction or set construction ( e.g. S = {x is_element_of N| x mod 2= }) be useful for understanding what 'print' in the Daplex fragment means ?
>> PROJECTION(SELECTION(person, city='London'), name, age).
>>
>> It may be more natural for some to think about the expression in an
>> imperative way (I cannot imagine why though) although its declarative
>> interpretation as a composition of two functions is trivial.
>
> Sure. And the same exists for some list-comprehension calculi. Just look
> in the NRA/NRC literature I already pointed you to.
What's 'list-comprehension calculus' other than a list constructor ?
But, let's postpone the LC calculus and resolve simpler matters, like what precisely 'print' is and why it is not imperative(having side effects).
>
> -- Jan Hidders
Received on Thu Jun 23 2005 - 01:57:45 CEST