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

SYMBOL-MACROFLET



    Date: Mon, 5 Sep 88 17:51:08 BST
    From: Jeff Dalton <jeff%aiai.edinburgh.ac.uk@NSS.Cs.Ucl.AC.UK>

    5. Symbol-macro-flet: SYMBOL-MACRO-LET lets me have something that
    looks like a variable but is really some expression.  It might seem
    that MACROLET does the same for function names, but it doesn't.
    MACROLET applies to entire calls, not just the name.  This suggests
    that SYMBOL-MACRO-LET should have a companion, SYMBOL-MACRO-FLET.

This is Zetalisp's "lambda macros", also available in Symbolics Common
Lisp.  They're called that because they let users write new things that
behave like LAMBDA.  They're pretty useful in a few specialized
circumstances.  You would of course want both a global (DEFMACRO)
version and a local (MACROLET) version.  In SCL, the former is named
DEFLAMBDA-MACRO but the latter doesn't exist.

I don't strongly support adding this feature to Common Lisp, since it's
pretty specialized, but I certainly wouldn't oppose it.  It would
make the language more useful and complete.

    BTW, what is the meaning of (MACROLET ((F () 'A)) #'F)?

The same as the meaning of (DEFMACRO F ...) #'F except for the
scoping of F.  The way this is explained in CLtL is extremely
confusing, but I think it should be an error.  Point 4 of the
pending cleanup issue FUNCTION-TYPE makes it clearly an error.

    In KCL and Lucid, it seems to be the same as #'F without the MACROLET

That's surely not desirable.