From: KD
To: Editor
Date: 21 Feb 2004
In Date and Darwin's
DATABASE FOUNDATIONS paper #5 Multiple Assignment
they use the PL/1 term "pseudovariable" (aside: elsewhere some
DBMS vendors use the term ‘pseudocolumn’ to refer to such system-generated
values as the system time). Given their
survey of "pseudovariable" language capabilities spanning Algol (a
beautiful language), APL, Cobol, Fortran, POP-2 and SQL, the most powerful of
these perspicuous variable value setting capabilities is omitted--Common Lisp.
In general (SETF x y) can be understood as saying 'see to it
that x evaluates to y'. As a macro SETF
can look inside its arguments to see what needs to be done to make such a
statement true. If the first argument
(after macroexpansion) is a symbol, the SETF just expands into a SETQ. But if
the first argument is a query, the SETF expands into the corresponding
assertion ... This transformation from a query to assertion is called
inversion. All the most frequently used
Common Lisp access functions have predefined inversions.”
--Paul Graham, On Lisp, pp. 165-6]
Graham proceeds in this chapter on Generalized Variables
to do the following, in summary:
·
Build a 'toggle' macro atop SETF.
·
Discuss the 'multiple evaluation [assignment] problem'
due to side effects.
·
Present various useful utilities built upon the SETF
related support macros including memorization.
·
Describe how to create user-defined inversions using
DEFSETF.
Although Graham's exposition does not address subtleties such
as atomicity w.r.t. constraints, he does demonstrate some useful
meta-programming capabilities that should be embraced in the database
community.
A non-tutorial description of CL's SETF can be found at:
http://www-2.cs.cmu.edu/Groups/AI/html/cltl/cltl2.html
specifically:
http://www-2.cs.cmu.edu/Groups/AI/html/cltl/clm/node80.html
I suggest that you consider deprecating the term
‘pseudovariable’ in favor of ‘Generalized Variable’.
From: Hugh Darwen
To: KD
I must say I have felt rather uncomfortable with the term
pseudovariable, but Date was a teacher of PL/I before he discovered Codd's
work, and I haven't thought of a better term. When I think about it
carefully, it's possibly not that bad really. A pseudo-X is something
that is not an X but is masquerading as one. I could argue that a
pseudovariable is a nontrivial expression masquerading as a variable.
Posted
04/16/04