From: William Harold Newman <william.newman@ai...> - 2001-10-31 20:21:18
On Fri, Oct 26, 2001 at 11:43:48AM +0400, Alexey Dejneka wrote:
> This is a draft of a patch adding restarts to unbound variable
> reference handling.
I'm sorry, I don't think I'll accept these restart patches (this one
and the "restarts: UNBOUND-SLOT" patch).
Partly it's a difference of taste: I generally don't like continuable
errors and restarts. The only place I can think of where I like using
them is in poorly defined but sometimes useful operations like
redefining a DEFSTRUCT or DEFCONSTANT, where they're a convenient way
to stop everything to ask "Do you really want to do this? And what do
you want to do, exactly?" The other places where I use them are mostly
those places where ANSI specifically requires them. Where they're not
required, I've tended to remove them from the old CMU CL code.
Partly I'm not completely sure that the patches are ANSI compliant.
ANSI's SLOT-UNBOUND page says
The generic function SLOT-UNBOUND is called when an unbound slot is
read in an instance whose metaclass is standard-class. The default
method signals an error of type UNBOUND-SLOT.
The SYMBOL-VALUE page has similar language:
Should signal UNBOUND-VARIABLE if SYMBOL is unbound and an attempt
is made to read its value.
Does CERROR (signalling the condition inside a framework of restarts)
satisfy this requirement? Probably, but I dunno for sure.
Finally, in the unbound slot case, it seems to me that much of the
intended functionality should be achievable by users defining a new
method, or new methods, on SLOT-UNBOUND.
> 4. I'd like to introduce a constant +UNBOUND-MARKER+, replace
> UNBOUND-MARKER-P VOP to an ordinary function, and use this constant
> in PCL; having two unboundness markers seems ugly to me.
I agree that this difference between PCL and core-CMU-CL handling of
unbound values is ugly. I'm inclined to solve it in a different way,
though. I think PCL code should be integrated more tightly into SBCL
for several reasons, especially ANSI-compliance:
(EQL 'CL:CLASS 'SB-PCL::CLASS) would be a really good thing. As this
happens I think it would be appropriate for PCL code to use the
existing unbound marker (the one currently used for the value of
unbound special variables). For that matter, it might be
straightforward to patch it that way now, before any other
integration is done.
William Harold Newman <william.newman@...>
"I must not have fun. Fun is the time-killer. Fun is for children,
customers, and the help. I will forget fun. I will take a pass on it.
And while it is going, I will turn a blind eye toward it. When fun is
gone there will be nothing. Only I will remain--I, and my will to win.
Damn, I'm good."
-- _National Lampoon's Doon_
PGP key fingerprint 85 CE 1C BA 79 8D 51 8C B9 25 FB EE E0 C3 E5 7C
Get latest updates about Open Source Projects, Conferences and News.