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

Re: Clisp question and hack

Tobias Kunze writes:

> The only downside seems to be that it triggers a continuable error
> because clos:defclass is a clisp kernel macro.  It would be nice
> to get around it somehow...

To avoid the continuable error, just add a call to `fmakunbound':

(eval-when (load eval)
  (unless (fboundp 'clos::%defclass)
    (setf (symbol-function 'clos::%defclass) (symbol-function 'clos::defclass))
    (fmakunbound 'clos::defclass)
    (defmacro clos::defclass (&rest args)
         (setf (get (first ',args) 'clos::class) nil)
         (clos::%defclass ,@args)))))

Seems we are establishing a new winner of the contest
"What is the biggest hack ever done to CLISP?"
Up to now, the winner (IMO) was Rick Taube with his hack which added
new commands to clisp's debugger :-)