Weird Language Features
hannah at schlund.de
Mon Feb 19 18:01:23 CET 2001
In article <slrn990ime.a2b.neelk at alum.mit.edu>,
Neelakantan Krishnaswami <neelk at alum.mit.edu> wrote:
>I'm not a serious CL user, but aren't its exceptions restartable? That
>would permit you to do this. It would be really nice if Python's
>exception system supported this. Then I wouldn't have to choose
>between raising an exception and having my constructor functions
No, they aren't.
CL differentiates between exceptions (called "conditions").
You can define handlers for them. A handler can either (as the name
says) handle the condition, i.e. do something and then non-locally
transfer control somewhere using go/return/throw/invoke-restart.
(throw has nothing to do with conditions besides that!), decline
to handle (just return), then the next most handler is invoked in turn,
or defer the decision (signal another condition/resignal the same
condition/enter the debugger/...).
Separate from that are definitions of restart points (which can
be used to handle a condition with invoke-restart). However
the normal function call doesn't establish any restarts which can
help in continuing after e.g. installing an autoloaded function
More information about the Python-list