Shenghuo ZHU writes:
The attached file can be compiled in Emacs 20.5 but not in XEmacs
21.2.23. Any ideas?
(eval-when-compile (require 'cl))
(defun test-func (arg1)
(function
`(lambda (arg2)
,arg1)))
Compiling file /tmp/foo.el at Sun Dec 12 15:03:45 1999
!! error (("not a lambda -- (backquote (lambda (arg2) (\\, arg1)))"))
The error message is correct. 'function' is equivalent to 'quote',
except that it is a hint to the compiler that the argument can be
considered Lisp code and compiled. The argument to `function' is
not evaluated during compilation so the backquote macro is never
expanded. Thus the compiler is correct to complain about syntax of
the form, whose car should be 'lambda', not 'backquote'.
The test-func definition should be written this way:
(defun test-func (arg1)
`(function
(lambda (arg2)
,arg1)))