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

Common LOOPS questions

Are MLET and MLABELS intended to do lexical binding, like FLET and
LABELS, or dynamic binding, altering what SYMBOL-FUNCTION of the symbol
returns?  I find the description somewhat confusing, especially the
statement that "FLET binds the function cell" of a symbol.

Also: how does one obtain something which can be passed as a second
argument to SPECIALIZE?  Is there a METHOD macro to complete the ratio


In other words, is

  (defmethod foo ((x frob) y) body)

equivalent to a form consisting of user-visible primitives, e.g.,

  (progn (if (not (fboundp 'foo))
	     (setf (symbol-function 'foo) (make-discriminator)))
	 (setf (symbol-function 'foo)
	       (specialize (symbol-function 'foo)
			   (method ((x frob) y) body)))) ,

in the same way that

  (defun foo (x y) body)

is equivalent to

  (setf (symbol-function 'foo)
	(lambda (x y) (block foo body))) ?

Jonathan Rees