This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Referential Transparency, was Re: fluid-let


> > > Where can I find an
> > > understandable definition of 'referential transparency'?
> 
> [Quine] has a chapter called "Referential Opacity" which says that
> "substitutivity of identity" is a "criterion of purely referential
> position"... R5RS ... blah blah

Some off-list correspondence led me to realize that in the excitement
of looking up references and quoting authorities, I forget to simply
state the definition.  The following is straight out of Quine,
translated into modern notation.

A context C[] is "purely referential" iff C[x] means the same as C[y]
whenever x and y are expressions that refer to the same object.
A context D[] is "referentially transparent" iff whenever C[] is a
purely referential context, then so is D[C[]].

Note that "purely referential" is a sub-case of "referentially
transparent" (let C be the empty context or the identity function),
and the second definition is needed only in case D[] is a context that
does not take a term.  Thus "[] or snow is white" is a RT context,
even though it does not make sense to ask whether "The first US
president or snow is white" means the same as "Washington or snow is
white".

I was wrong in believing that the terminology is due to Quine.  He
explicitly attributes it to Whitehead and Russell, "Principia
Mathematica" 2d ed, vol 1 p 665 (1925).

Now for the bad news.  The definition I quoted from R5RS may be the
definition of "hygenic" not of RT.  (The wording makes it possible to
doubt that these are meant as definitions at all, but [Clinger and
Rees] says about the same thing a little more clearly.)  So R5RS
says essentially:

hygenic = free variables in the argument are bound in the context of
  the call, not by declarations in the macro definition.
referentially transparent = free variables in the macro definition are
  bound in the context of the definition, not by declarations in the
  context of the call.

Unfortunately, the first and not the second concept seems to
correspond to the definition of RT given by Quine, Whitehead, and
Russell.  If FOO is a macro, then FOO(x) will mean the same as FOO(y)
whenever x=y, only if a local declaration of x in the macro definition
does not bind the argument x.

So we may have another sad example of a once precisely defined
technical term whose definition has been extended, abused, and
misunderstood until it is useless to ask "what is the definition?"
and we must instead ask "what do you mean by that?"

Or maybe I am confused and I should meditate quietly and hope for a
sudden flash of enlightenment.  (Is it more than you wanted to know
yet?)

[Clinger and Rees] "Macros That Work" Indiana Scheme Repository