This is in violation to 3.4.7 which specifically allows the &environment
parameter in defsetf
lambda-lists.
Test case:
(defsetf foo (&environment env place) (value)) ;; => DEFSETF FOO: invalid DEFSETF lambda-list: Lambda list element PLACE is superfluous. Only one variable is allowed after &ENVIRONMENT.
(defsetf foo (place &environment env) (value))
works just fine.The problem is that CLISP does not allow
&environment
beforereqvars
.Ah, I see. I prematurely assumed that &environment had to come first like in other lambda-lists. Looking at 3.4.7 again now I'm not sure if &environment coming first is even allowed.
When you read section 3.4.1 http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/sec_3-4-1.html it is clear how the brackets have to be interpreted, namely as an optional part at the given position. (Optional parts at ANY position are written in a different way, see http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/sec_1-4-1-2-1.html .)
Per 3.4.7 http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/sec_3-4-7.html the &environment var section must come at the end of the defsetf lambda list. This is unlike in macro lambda lists 3.4.4 http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/sec_3-4-4.html, where the &environment var section can appear anywhere.