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

Issue: FUNCTION-TYPE (version 10)



re: 5a. The value returned by SYMBOL-FUNCTION when FBOUNDP returns true
        but the symbol denotes a macro or special form is not well-defined,
        but SYMBOL-FUNCTION will not signal an error. 
    5b. Assuming that symbol is fbound[sic],
	(FUNCTIONP (SYMBOL-FUNCTION symbol))
	implies
	(AND (NOT (MACRO-FUNCTION symbol))
	     (NOT (SPECIAL-FORM-P symbol))).

I don't understand the motivation behind this point (5b).  Since (5a) says
that SYMBOL-FUNCTION is permitted to return "something", and is not
"well-defined" in the case when the symbol names a macro or special form,
then what is the advantage of preventing it from returning a function?

I've seen lots of CL code like:

    (defun foo-expander (x) `(QUOTE ,x))
    (setf (macro-function 'FOO) #'foo-expander)

How will one fetch the current "expander function" for this macro?  

Is the issue merely that some implementations will have to cons in order to
return a value for MACRO-FUNCTION?  In that case, maybe we need a predicate
MACRO-P, just as there is a predicate SPECIAL-FORM-P.



-- JonL --