Re: Question about EQL parameter specializer and object extent

From: Steven M. Haflich (smh_no_spiced_ham_at_alum.mit.edu)
Date: 12/28/04


Date: Tue, 28 Dec 2004 03:57:09 GMT

Aaron Gross wrote:

> On the other hand, this whole question is independent of the Lisp
> language specification, right? Could a Lisp implementation
> automatically remove a method once it can no longer be invoked? Or
> does that somehow violate the specification?

An implementation that includes the MOP could not automatically
remove the method, and your temporary instance would never become
garbage. Consider the existence of the MOP functions
generic-function-methods and method-specializers.

As to the question whether your example is bad style, yes it is,
but you need look no further than the general guideline that the
CL def* forms generally are not intended to be used at execution
time. Their behavior is defined at execution time, but that is
not how they are intended to be used and there may be performance
costs or other undesirable effects.

You should find a copy of CLtL2 online or elsewhere and read
about with-added-methods, generic-flet, and generic-labels. These
were adopted by X3J13 as part of the original CLOS spec but
subsequently removed from the standard. When they were originally
proposed there were no implementations and no experience how these
things might be used. A generic function is peculiar in that it
is a single function with a distributed implementation. Without
real experience how a programmer would manage this added dimension
of distributed implemenation, and also no real experience how these
operators would encumber the eagerly-anticipated clever efficient
implementation of generic functions, these operators were scrapped.
I thought that was the right thing to do back then, and still do.