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

[no subject]



This idea, &WHOLE, was discussed through the mails early in 1979, and
someone (I believe RMS?) suggested another keyword for the same idea
to be used in the LISPM defmacro.  It's appearance in MacLISP/NIL was
noted in the following from LISP;LISP NEWS

Sunday December 9,1979  FM+5D.18H.52M.12S. LISP 1914/COMPLR 904  - JONL, RWK - 
...
12) Some things that failed to be documented previously about DEFUN/DEFUN&
    &WHOLE  -  DEFMACRO now permits a keyword &WHOLE, to get at whole call form
	by specifying a variable to be bound to the whole call form.
	    (DEFMACRO FOOM (&WHOLE X) <mumble>)  would bind X just like
	    (MACRO FOOM (X) <mumble>)


Typically, one would use &WHOLE when several symbols are set to the same
macro code body, or when one wants a pointer ot the cell invoking the call;
e.g., the following two macros FOO and FOOQ are essentially the same except
for the action in the lines indicated by ;**** :

(defmacro FOO (x y &optional (z 1) &whole form)
    (do () 
	((fixp z)) 
      (setq form (error "Count arg unreasonable for OPERATEing" 
 			form
			'FAIL-ACT)))
    (let ((arglist `(,x ,y)))
      (if (eq (car form) 'FOOQ)					;****
	  (setq arglist (mapcar #'(lambda (a) `(QUOTE ,a)))))   ;****
      `(OPERATE ,@arglist ,z)))

(fsetq FOOQ (fsymeval 'FOO))