Re: Does Codd's view of a relational database differ from that ofDate&Darwin?[M.Gittens]
Date: 24 Jun 2005 00:12:56 -0700
Message-ID: <1119597176.918716.20840_at_o13g2000cwo.googlegroups.com>
vc wrote:
>
> Well, referential transparency advantages are common knowledge and the
> answer to all your questions above are 'yes'(in the first question, it
> does not matter what you call your output thingy, 'print' or something
> else, as long as it has a side effect).
The term "side effect" is in common usage but I have to say I really dislike it. For one thing, it is used often to describe things that could only be called *primary* effects. For example, a print procedure doesn't print as a "side" effect; printing is what it exists for.
At the same time, there's a common meme that says that "side effects" (often meaning either access to global variables or I/O) necessarily destroy referential transparency, but that's dicey at best. It doesn't distinguish between input/read vs. output/write, and the distinction is huge. In essence, a function can output to streams or update globals all it wants and it will not alter the return value of the function.
In other words, if we regard print as a function and consider the activation of the physical printer to be a side effect, then print is still referentially transparent. (Its return type may be void, which means you certainly can't make a case for it returning different values based on side effects!)
Marshall Received on Fri Jun 24 2005 - 09:12:56 CEST