Re: Does Codd's view of a relational database differ from that ofDate&Darwin?[M.Gittens]

From: Marshall Spight <marshall.spight_at_gmail.com>
Date: 25 Jun 2005 10:34:09 -0700
Message-ID: <1119720849.773276.10990_at_g44g2000cwa.googlegroups.com>


VC wrote:
>
> You run your function once, you have one character on a piece of paper,
> you run your function the next time, you have two characters on a piece of
> paper.

This disagreement hinges on whether we consider the character on the piece of paper to be part of the return value of the function. You do; I don't. To me, it's a *side* effect, and not a return value. The return value below is simply the unnamed int, and does not include the state of the universe.

int f(int x) { print "hello"; return x*2; }

> The *result* of the function execution is different, determined not
> solely by its arguments but also by the previous state of the world.

I note that you've again conflated input and output, by saying that the function that prints and calculates a value is somehow affected by the previous state of the world. It's not, even if you consider the printing to be included in the return value. It modifies the state of the world by printing, but it doesn't observe it.

This is something I've pointed out before; FP people have grown accustomed to lumping input and output together, and don't distinguish between their different effects on RT.

> Parenthetically, a more common definition of r.t. is :
> "An expression E is referentially transparent if any subexpression and its
> value (the result of evaluating it) can be interchanged without changing the
> value of E."
> (http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?referential+transparency),
> having been used at least since 1977. Whatever definition is used, a
> side-effect function is clearly not r.t. , be it input, output, assignment ,
> exceptions and so forth..

Sure, that definition works fine for me as well, and in fact I consulted
it before my last post.

> >. I say, give me any function you care to,
> > and I'll run it on a machine that does output as it executes the
> > function.
>
> I do not understand this. I give you f(x) = 2*x . Why would "the nachine"
> would ouput anything ?

Because I told it to. It's my machine, but it's your function. I ran your function on my machine. This shows that by your definition of RT, you can't say whether a function is RT or not, because you don't know what the machine you run it on is going to do as a side effect. That's why I don't think your definition is useful; it considers too much.

Marshall Received on Sat Jun 25 2005 - 19:34:09 CEST

Original text of this message