From: Sunil Mishra
Subject: Re: Collecting EQL specialized methods.
Date: 
Message-ID: <efyemmnscan.fsf@cleon.cc.gatech.edu>
Sorry, I didn't read your problem well enough the first time around.

Marco Antoniotti <·······@copernico.parades.rm.cnr.it> writes:

> Hi,
> 
> I am working on a small application that potentially has a lot of code
> like
> 
> (let ((zut (make-instance 'zot)))
>    (defmethod meth ((z (eql zut))) #| do stuff |#)
> 
> I know I can set up a macro WITH-INSTANCE-METHODS that did exactly
> what I want and added a bunch of unwind-protected REMOVE-METHODS at
> the end.
> 
> However, wouldn't it be nice if the newly created methods were somehow
> colleted when the where no longer needed?

But that's why we have lambda and flet, because objects created with defun
stick around in the global environment. (Now I remember why I had thought
of generic-flet...) My guess is that generic-flet introduced too many
complications to be implemented efficiently, in terms of method lookup and
the like.

> Of course I have not really explored all the consequence of my
> desires. I suppose it may change the semantics of the language.  Any
> thoughts about how an implementation may deal with this case?

I can't help but think... But why would you want to do something like this?

It seems like what you want is basically some data-directed
programming. Why not set up a hash table? You could have a method
specialize on class zot, and look up the hash table for an appropriate
lambda created at runtime. You would get everything you want with the
short-lived method approach you are thinking of, within relatively well
understood semantics of the language. (You would of course need two other
functions, one for creating dispatch lambdas, and the other for deleting
them.)

Or is there something you would miss out with this design?

Sunil

From: Tim Bradshaw
Subject: generic-flet (was Re: Collecting EQL specialized methods.)
Date: 
Message-ID: <nkjd827qh29.fsf_-_@tfeb.org>
Sunil Mishra <·······@cleon.cc.gatech.edu> writes:

> But that's why we have lambda and flet, because objects created with defun
> stick around in the global environment. (Now I remember why I had thought
> of generic-flet...) My guess is that generic-flet introduced too many
> complications to be implemented efficiently, in terms of method lookup and
> the like.

Does anyone who was there know why generic-flet &c were removed?  It
seems to *me* that given the typical CLOS approach of computing stuff
(effective methods &c) on the fly and then caching agressively, things
like these are really hard to get right -- either you do the
computation each time (very slow), or you effectively have the things
lying around `secretly' all the time.  This is especially bad for
WITH-ADDED-METHODS, which must almost by definition perturb the cache
of effective methods.  But I'd like to know the real story!

--tim
From: Barry Margolin
Subject: Re: generic-flet (was Re: Collecting EQL specialized methods.)
Date: 
Message-ID: <adbI2.323$p4.116294@burlma1-snr2>
In article <··················@tfeb.org>, Tim Bradshaw  <···@tfeb.org> wrote:
>Does anyone who was there know why generic-flet &c were removed?  It
>seems to *me* that given the typical CLOS approach of computing stuff
>(effective methods &c) on the fly and then caching agressively, things
>like these are really hard to get right -- either you do the
>computation each time (very slow), or you effectively have the things
>lying around `secretly' all the time.  This is especially bad for
>WITH-ADDED-METHODS, which must almost by definition perturb the cache
>of effective methods.  But I'd like to know the real story!

See
<http://www.harlequin.com/education/books/HyperSpec/Issues/iss181-writeup.html>
for the X3J13 issue that removed them.  The Discussion section contains
some of the rationale.

-- 
Barry Margolin, ······@bbnplanet.com
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: His Holiness the Reverend Doktor Xenophon Fenderson, the Carbon(d)ated
Subject: Re: generic-flet (was Re: Collecting EQL specialized methods.)
Date: 
Message-ID: <w4o1zims12r.fsf@nemesis.irtnog.org>
>>>>> "BM" == Barry Margolin <······@bbnplanet.com> writes:

    BM> See
    BM> <http://www.harlequin.com/education/books/HyperSpec/Issues/iss181-writeup.html>
    BM> for the X3J13 issue that removed them.  The Discussion section
    BM> contains some of the rationale.

The first paragraph of the writeup in the HS ("The current form of
lexical generic functiona is inadequate for general use, and therefore
there is no existing compelling reason to retain them.") has a typeo,
I think.  Shouldn't "functiona" above be "functions"?

-- 
Rev. Dr. Xenophon Fenderson, the Carbon(d)ated, KSC, DEATH, SubGenius, mhm21x16
Pope, Patron Saint of All Things Plastic fnord, and Salted Litter of r.g.s.b
In a lecture, Werner von Braun once said "Ve haf alvays been aiming for zer
stars" and a little voice at the back replied "But ve keep hittink London".
From: Barry Margolin
Subject: Re: generic-flet (was Re: Collecting EQL specialized methods.)
Date: 
Message-ID: <GUkI2.350$p4.119921@burlma1-snr2>
In article <···············@nemesis.irtnog.org>,
His Holiness the Reverend Doktor Xenophon Fenderson, the Carbon(d)ated <········@irtnog.org> wrote:
>The first paragraph of the writeup in the HS ("The current form of
>lexical generic functiona is inadequate for general use, and therefore
>there is no existing compelling reason to retain them.") has a typeo,
>I think.  Shouldn't "functiona" above be "functions"?

Since the files in the HS were mechanically produced from the standard and
the X3J13 cleanup issues, that typo was probably in the original cleanup
issue.  So the HS is presumably an accurate representation of what we voted
on.

-- 
Barry Margolin, ······@bbnplanet.com
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: Kent M Pitman
Subject: Re: generic-flet (was Re: Collecting EQL specialized methods.)
Date: 
Message-ID: <sfwww0ebrvm.fsf@world.std.com>
Tim Bradshaw <···@tfeb.org> writes:

> Does anyone who was there know why generic-flet &c were removed?

Issue GENERIC-FLET-POORLY-DESIGNED in the CLHS speaks to the point.
See RPG's long comment towad the end of the writeup.