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

Re: Clisp question

This might be a working solution  (ok, "hack" :)

I've put this in my init file and it works fine...

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

> (defclass foo () ())
> (defclass foo () ((x)))
> (defclass foo () ((x) (y)))

So far i haven't encountered any problems.  However, Im not sure
whether it might be harmful...
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...