[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

issue COMPILER-LET-CONFUSION, version 7



    Date: Mon, 13 Mar 89 16:14:26 -0700
    From: sandra%defun@cs.utah.edu (Sandra J Loosemore)

	In interpreters which do not do a semantic-prepass, it is necessary
	to fully macroexpand the body. Assuming the presence of a
	SYSTEM::MACROEXPAND-ALL primitive, the definition of COMPILER-LET
	could look like:
	  (DEFMACRO COMPILER-LET (BINDINGS &BODY FORMS &ENVIRONMENT ENV)
	    (SETQ BINDINGS ;; Assure no non-atom bindings
		  (MAPCAR #'(LAMBDA (BINDING) 
			      (IF (ATOM BINDING) (LIST BINDING) BINDING))
			  BINDINGS))
	    (PROGV (MAPCAR #'CAR BINDINGS)
		   (MAPCAR #'CDR BINDINGS)
	      (SYSTEM::MACROEXPAND-ALL `(PROGN ,@FORMS) ENV)))

Modulo some bugs in the code.  Shouldn't the second-to-last line be:

	(MAPCAR #'(LAMBDA (BINDING)
		    (eval (CaDR BINDING)))
		BINDINGS)

(my additions are in lowercase)?

                                                barmar