1)"DEFUN" IS AN FSUBR USED TO DEFINE
FUNCTIONS. EXAMPLES ARE
(DEFUN ONECONS (X) (CONS 1 X))
WHICH IS EQUIVALENT TO
(DEFPROP ONECONS
(LAMBDA (X) (CONS 1 X)
EXPR)
AND (DEFUN SMASH FEXPR (L) (RPLACD L NIL))
IS EQUIVALENT TO
(DEFPROP SMASH
(LAMBDA (L) (RPLACD L NIL))
FEXPR)
MacLisp 的运行平台 DEC PDP-6 是低端机型,用的 DEC Sixbit 字符集不支区分大小写。
仅此而己。
另外,LISP 1.5 及原型比较接近 Lisp-1,定义函数用的是 define
When a symbol stands for a function, the situation is similar to that in which a symbol stands for an argument. When a function is recursive, it must be given a name. This
is done by means of the form LABEL, which pairs the name with the function definition
on the a-list. The name is then bound to the function definition, just as a variable is bound to its value.
In actual practice, LABEL is seldom used. It is usually more convenient to attach the name to the definition in a uniform manner. This is done by putting on the property list of the name, the symbolEXPR followed by the function definition. The pseudo-function define used at the beginning of this section accomplishes this. When apply interprets
a function represented by an atomic symbol, it searches the p-list of the atomic symbol before searching the current a-list. Thus a define will override a LABEL.
The fact that most functions are constants defined by the programmer, and not variables that are modified by the program, is not due to any weakness of the system. On the contrary, it indicates a richness of the system which we do not know how to exploit very well.