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

correction on mlet & mlabels

    Date: 18 Aug 85 1:39:58 PDT
    From: masinter.PA@Xerox.ARPA

    There's a problem in the paper, in that it talks about specialization of
    function-cells, as JAR points out. There is a simple definition of the
    semantics of mlet: it lexically binds the symbol to a discriminator
    who's default implementation is to invoke the global symbol-function.


    (mlet ((move ((a window) b) body))

    is roughly

    (let ((move (a b)
	    (if (typep a window)
		(funcall 'move a b))))

I doubt this is really what you meant.  May I offer

    (flet ((move (a b)
	    (if (typep a window)
		(move a b))))

which uses FLET rather than LET and uses the next outer binding of
the function-name MOVE rather than the global binding.  (This works
because FLET isn't LABELS; it can be done with LABELS with the
introduction of a GENSYM and two levels of LABELS.)

But then, maybe this isn't what you meant either; what if there is
already a more specific method for MOVE, say

    (defmethod move ((a storm-window) b) body...)

where storm-window is a specialization of window.  Does the MLET method
always get run first, or does it get inserted in order of specificity as
a DEFMETHOD-defined method would be?  The description of SPECIALIZE,
which appears to be connected with the implementation of MLET, is no
help in resolving this question.

It's ambiguities like this that made your proposal hard for me to

I'm also curious what is the motivation for lexical, rather than
dynamic, scoping of MLET-defined names.  For that matter, I'm curious
what the intended application for MLET is.  Your paper is generally
pretty weak on questions of motivation like this.