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

Warning: don't do (defstruct class ...) in Allegro 4.0

Amusing story (if it didn't happen to you:-):

I gave my AI programming course as a first assignment in lisp the
problem of implementing a small data base of students and classes.
(The purpose is mainly to get them started using lisp.)  Soon they
started complaining that if they made any errors (e.g. mistyped a
symbol), instead of dropping into a break, lisp hung.

Here's what happened: I had made a big deal in lecture about using
defstructs where appropriate, so of course most of them did 
(defstruct class ...), and also defined functions like find-class.
These functions, meant to deal with classes and students, clobbered
CLOS functions meant to deal with CLOS classes.  Apparently, the
error-handling system is implemented using CLOS, so instead of an
of error message, we got a hang.

Isn't there some way the error handler could have been set up so that
accidental redefinition of part of CLOS would at least leave lisp able
to give error messages?