[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
get,getf
Genera has many co-resident Lisp dialects. The package and syntax
control which is active at any given time.
The dumper is written in Zetalisp syntax and the LMFS package.
Zetalisp's GET does something different than Common Lisp's GET.
The symbol GET in the LMFS package is ZL:GET, not LISP:GET.
Note that Zetalisp's get works mostly like Common Lisp's, except
that Common Lisp removed the Maclisp compatibility feature of
Zetalisp which allowed you to do GET on what Maclisp called a
disembodied property list (a list in which the cdr was viewed as
the property list).
As to your other question, it is a feature of Lisp (but not Scheme)
that it is possible to use a function name and a variable name
simultaneously in the same environment. The function name is
referred to whenever you do (FOO ...) or #'FOO, and the variable
name is referred to in normal for-evaluation situations like
FOO in (CAR FOO). A key reason for this is that many people find
it more intuitive for
(DEFUN FOO (LIST)
(MAPCAR #'(LAMBDA (X) (LIST X (1+ X)))
LIST))
(FOO '(1 2 3)) => ((1 2) (2 3) (3 4))
Scheme-like semantics, which allow you to only use a name for one
purpose at a time would make you write this function as
(DEFUN FOO (LST)
(MAPCAR #'(LAMBDA (X) (LIST X (1+ X)))
LST))
or some people might use L. But Lisp programmers usually like
using nice variable names and find that many of the really nice
variable names are already taken for functions, so they have devised
a semantics wherein you can still use these names also for variables.
My strong belief is that this makes programs generally prettier,
but there are those who disagree. The issue actually goes a lot
deeper than this, and is not purely one of aesthetics. You can
find a more complete discussion of it in a paper by me and
Dick Gabriel in Lisp and Symbolic Computation, Volume 1,
Number 1, June 1988. The paper is entitled ``Technical
Issues of Separation of Function Cells and Value Cells.''
By the way, as an aside, ELT in the LMFS package doesn't name a
function. (FBOUNDP 'LMFS:ELT) => NIL. But ELT still would have
been an ok variable name even if LMFS:ELT had named a function,
as CL:ELT does. (And moreover, even in a language like Scheme,
ELT would have been an ok variable name as long as a function
by the same name weren't being used in that lexical contour. But
another problem with Scheme is that if someone later decides to
modify the definition to call the function ELT in that context, they
have to change the name of the local variable--something they wouldn't
have to do in Lisp.)
- Follow-Ups:
- get,getf
- From: paul@taos.intel.com (Paul Collier)
- References:
- get,getf
- From: paul@taos.intel.com (Paul Collier)