[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Clisp question
- To: ilog!haible%ilog.ilog.fr (Bruno Haible)
- Subject: Re: Clisp question
- From: "Tobias Kunze" <tkunze@cmsgia.Stanford.EDU>
- Date: Tue, 13 Feb 1996 12:31:19 -0800
- Cc: clisp-list@ma2s2.mathematik.uni-karlsruhe.de, Marcus Daniels <marcus@sysc.pdx.edu>
- In-reply-to: haible%ilog.ilog.fr@ilog.uucp (Bruno Haible) "Re: Clisp question" (Feb 13, 8:17pm)
- References: <9602121259.ZM19780@cmsgia.stanford.edu> <9602131917.AA11602@ilog.ilog.fr>
This might be a working solution (ok, "hack" :)
I've put this in my init file and it works fine...
#+clisp
(eval-when (load eval)
(unless (fboundp 'clos::%defclass)
(setf (symbol-function 'clos::%defclass) (symbol-function 'clos::defclass))
(defmacro clos::defclass (&rest args)
`(progn
(setf (get (first ',args) 'clos::class) nil)
(clos::%defclass ,@args)))))
> (defclass foo () ())
#<STANDARD-CLASS FOO>
> (defclass foo () ((x)))
#<STANDARD-CLASS FOO>
> (defclass foo () ((x) (y)))
#<STANDARD-CLASS FOO>
>
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...