[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Issue: CONDITION-RESTARTS (Version 1)
- To: Kent M Pitman <KMP@STONY-BROOK.SCRC.Symbolics.COM>
- Subject: Issue: CONDITION-RESTARTS (Version 1)
- From: David A. Moon <Moon@STONY-BROOK.SCRC.Symbolics.COM>
- Date: Sat, 11 Mar 89 22:03 EST
- Cc: CL-Cleanup@SAIL.Stanford.EDU
- In-reply-to: <890309181944.4.KMP@BOBOLINK.SCRC.Symbolics.COM>
Date: Thu, 9 Mar 89 18:19 EST
From: Kent M Pitman <KMP@STONY-BROOK.SCRC.Symbolics.COM>
Date: Thu, 9 Mar 89 14:25 EST
From: David A. Moon <Moon@STONY-BROOK.SCRC.Symbolics.COM>
...
I still believe my suggestion would be an improvement, but I think
even better would be
(WITH-CONDITION-RESTARTS signal-form &rest restart-clauses)
where signal-form must be an invocation of SIGNAL, ERROR, WARN, or
perhaps a few others, or a macro that expands into such an invocation.
WITH-CONDITION-RESTARTS must signal an error at all levels of safety if
it does not recognize the signal-form. This is "weird" because it uses
a form for something other than evaluation (but not unprecedented; this
is exactly what SETF does). The advantage is that it just nests with an
existing syntax instead of inventing a new, awkward syntax.
I thought about this. I felt guilty about suggesting it without suggesting
an extension mechanism. However, I agree that practical experience with the
Lispm suggests that the extension mechanism is not really needed. People
nearly always use an explicit call to one of these.
Note that I stole the "good name" WITH-CONDITION-RESTARTS for this
commonly used syntax. The less commonly used primitive that just sets
up the restarts without signalling doesn't need as good a name.
I suppose it woudl be too yucky to consider saying that RESTART-CASE has
this effect when its argument happens to be (or macroexpand into) a call
to ERROR, SIGNAL, etc. huh?
The justification being that these are lexically recognizable as really
associated with the signal.
That would leave the name WITH-CONDITION-RESTARTS available for what
you called ...-INTERNAL, and would eliminate the need for this primitive
as an explicit thing altogether.
Thoughts?
Well, it is kind of yucky. On the other hand, it's no yuckier, really,
than my suggestion to make WITH-CONDITION-RESTARTS lexically recognize
these forms, except for one thing: my suggestion means it either lexically
recognizes the form or signals an error. Your suggestion means it either
lexically recognizes the form and attaches the restarts to the condition,
or does not lexically recognize the form and does not attach the restarts
to the condition, but still signals the condition and still establishes
the restarts. The question is, is it a bad thing to signal the condition
with the restarts in effect but not attached to it? Well, maybe it's not
as bad a thing as having another macro just for attaching restarts.
Either way Gabriel is going to say it's baroque and eccentric, and he'll
be right. Right now I'm inclined to agree to modify RESTART-CASE to
specially recognize those signalling forms and attach the restarts to
the condition, but I might change my mind back to the other way.