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

toplevel-loop example



On page 654 in the MCL 2.0 final manual, I am told that you want your
toplevel function to catch aborts if you don't want the listener to appear
with an error message.  Then the manual gives an example that shows what
goes wrong if you don't catch aborts:
? (defun new-top (&aux form)
    (setq form (read))
    (if (eq form 'done)
        (%set-toplevel #'toplevel-loop)
        (print (eval form))))
? (%set-toplevel #'new-top)
? (toplevel)
At this point, if you type a command-period, you are supposed to get an
error
message saying that it can't throw to tag :abort.

However, when I tried this, and typed a command-period, nothing happened. 
The new-top function just ignored the command-period.  Is the manual
correct?  If so, why didn't I get the error message?
Can someone give me a simple modification of the above example that catches
aborts, brings up a message dialog with an error message, and then returns
to the top-level function?