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

SYMBOL-MACROFLET



    Date: Wed, 7 Sep 88 21:38 EDT
    From: David A. Moon <Moon@STONY-BROOK.SCRC.Symbolics.COM>

	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. ...

I don't think what Jeff's talking about is lambda macros. There are currently
really three possibilities:

 (... symbol ...)
 (symbol ...)
 ((symbol ...) ...)

Lambda macros are about the third of these. My impression is that Jeff's
talking about the second. For example, in the Cloe implementation of Flavors,
the implementation of DEFUN-IN-FLAVOR uses a macro which we call
SYMBOL-FMACROLET. That lets
 (DEFUN-IN-FLAVOR (F FOO) ...)
 (DEFMETHOD (ZAP FOO) () (F X))
[effectively] expand into
 (DEFUN |F in FOO| ...)
 (DEFMETHOD (ZAP FOO) () (|F in FOO| ...))
by going through an intermediate step such as:
 (DEFMETHOD (ZAP FOO) ()
   (SYMBOL-FMACROLET ((F |F in FOO|))
     (F X)))

This facility, which I think is the one Jeff is alluding to, is very
different from what lambda macros are for.

Aside: As far as I've been able to discern, DEFUN-IN-FLAVOR has very little
place in CLOS so this example may seem a bit foreign to people not familiar
with Flavors. Sorry about that.

Regardless of the merits of DEFUN-IN-FLAVOR, I think Jeff's right that
this companion special form (SYMBOL-FMACROLET or SYMBOL-MACRO-FLET or
SYMBOL-MACROFLET or whatever) is interesting. Also, for the sake of a
portable implementation of New Flavors and things like it, I think it
would make very good sense to consider adding it now rather than waiting
until we realize we're screwed without it. SYMBOL-MACROFLET is as hard
to write as a macro as SYMBOL-MACROLET, so if you think SYMBOL-MACROLET
really must be a special form, then I argue that so should
SYMBOL-MACROFLET.