Bruno Haible wrote:
>CLISP supports the consistent way of using function names, in DEFUN,
>in DECLARE INLINE, in DEFGENERIC, in DEFCLASS slot options, in =
>in FUNCTION, _and_ also in the function call syntax.
IMHO, it's not yet consistent, since the following source-level =
transformation does not work for (setf values-list) as a function-name:
=3D=3D (funcall (function <f>) <args>...)
(same for apply), since I already pointed out that #'(setf values-list) =
yield an error.
Some macros are likely to do such transformations. It works for names =
as symbols and for (lambda ...) expressions.
>Cool! You already found the paragraph that supports the extension!
I'd like to find a similar paragraph in impnotes.
I can live with #+clisp-specific ((setf foo) v bar) syntax.
>do yourself a favour and replace [...] with
> (typep x '(or symbol (cons (eql setf) (cons symbol null))))
>at the appropriate place. It's a one-line change.
It's not a one line change, since it endangers other places in the code =
(a typical static vs. dynamic typing argument).
For example, calls to (macro-function x), special-operator-p or type =
declarations because CLHS states:
macro-function symbol &optional environment =3D> function
But I fully agree that the amount of changes is limited.
Concretely, if I were to apply the proposed change in Iterate, which =
(not surprisingly) has such a SYMBOLP test, it would break because:
(special-operator-p '(setf values-list))
*** - SPECIAL-OPERATOR-P: (SETF VALUES-LIST) is not a symbol
But I have a 2-line patch (4 with comments) that seems to work.
>There is no such thing as a portable code walker.
Agreed, yet every walker will need #+clisp-specific code.
Not so nice.
For instance, Marco Baringer came across this setf issue when trying to =
port his UCW to clisp (ucw includes a CPS transformer, which means code =
From: Bruno Haible <bruno@cl...> - 2005-01-26 14:53:40
Joerg-Cyril Hoehle wrote:
> IMHO, it's not yet consistent, since the following source-level
> transformation does not work for (setf values-list) as a function-name:
> (<f> <args>...)
> == (funcall (function <f>) <args>...)
For all cases where (funcall (function <f>) <args>...) is valid,
in clisp (<f> <args>...) is valid as well and equivalent. That's
why I call this consistent.
> #'(setf values-list)
The function (setf values-list) does not exist, therefore both
((setf values-list) ...)
(funcall (function (setf values-list)) ...)
are invalid. It is consistent.
The fact that (setf (values-list ...) ...) expanded to something invalid
was a bug and has now been fixed.