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

Re: FUNCTION and MACROLET



	
    Date: Wed, 30 Apr 86 18:19:24 pdt
    From: yuasa@kurims.kurims.kyoto-u.junet
    To: nttlab!Common-Lisp@SU-AI
    Message-ID: <8605010119.AA00467@kurims.kyoto-u.junet>
    
    
	 87 Rewrite the second sentence in the description of FUNCTION as
	 follows:  "In particular, if fn is a symbol, then the functional
	 definition of that name is returned, which is that established by the
	 innermost lexically enclosing FLET, LABELS, or MACROLET construct, if
	 there is one, or else the global functional definition of the symbol
	 (see SYMBOL-FUNCTION)."
	 
    Is this sentense really intended to require that (FUNCTION FOO)
    in the body of (MACROLET ((FOO <args> . <body>)) ...) should return
    the macroexpansion function of the local macro FOO?

No. (FUNCTION FOO) in the body of a (MACROLET ((FOO... should return
"an object representing a ... macro ... it is an error to attempt to
invoke the object as a function" (cf. SYMBOL-FUNCTION, pg. 90).
    
	 (FUNCALL (MACROLET ((FOO (X) `(LIST ,X ,X)))
		     (FUNCTION FOO))
		  '(FOO (BAR)))
    
Thus this example is not legal common lisp.

    If this is really the case, then what are the merits of this
    mechanism?

The behavior of FUNCTION when given the name of a local function/macro
should be consistent with its behavior when given the name of a global
function/macro, and the behavior of FUNCTION when given the name of a
global function/macro/special-form should be consistent with the
behavior of SYMBOL-FUNCTION when given the name of a global
function/macro/special-form.  I think this is what Guy's proposed
clarification is trying to get across.

    -- Taiichi
    (one of the implementors of Kyoto Common Lisp)
    (nttlab!kurims!yuasa@su-shasta.arpa)
    
	      --------------------
		
	-- Nick