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

The extent of CALL-NEXT-METHOD (a retraction)

Well, I had a conversation with Danny about this issue.  He brought up
the following example, which I find compelling enough to justify
switching my ``vote'' from `dynamic' to `indefinite'.

Suppose we pick the `dynamic' extent.  Suppose that you've got a piece
of code in some method that includes an FLET'd function and suppose
further the method returns said function as its value.  This is fine, it
should work, we've all probably done something like it a dozen times.
However, if you've got a call to CALL-NEXT-METHOD inside that FLET'd
function, then it doesn't work, something awful happens, we'll all get
bit by it a dozen times and curse our short-sightedness.

I can't off-hand come up with an example of something else in Common
Lisp that I have to be careful of, except for things that I already find
it intuitive to worry about: special variables, condition handlers,
CATCH phrases, etc.  The function CALL-NEXT-METHOD is not obviously
`dynamic'; I therefore predict that I (and many other programmers) will
fail to remember that it IS `dynamic' and that we will therefore make
such mistakes many times before we learn.

It is, of course, no consolation that many (most? probably not all)
implementations will, in fact, allow indefinite extent.  That simply
means that I won't realize my mistake until I'm porting my code to the
one implementation that met the spec exactly.

So, as I said above, consider this a change of my ``vote''.