[closer-devel] ContextL: Class not intialize
Pascal Costanza
pc at p-cos.net
Tue Dec 20 10:52:30 UTC 2005
Hi Joe,
Thanks a lot for reporting this - it's a bug in ContextL. I have
fixed it in the darcs repository.
If you don't have darcs access, just change the following method in
cx-special-class.lisp:
(defmethod reinitialize-instance :before
((class special-class) &key)
(when (class-finalized-p class)
(setf (slot-value class 'old-slot-definitions)
(class-slots class))))
The bug was that class-slots throws the error you reported when the
class is not finalized. Fortunately, the code that depends on old-
slot-definitions doesn't need to run when the class isn't finalized yet.
I hope this helps,
Pascal
On 20 Dec 2005, at 10:18, JoeSB COE9 wrote:
> Hi,
>
> I tried to follow ContextL overview document and got stuck.
> Here is a part of example that got the error.
>
> ;;---------- ctx2.lisp
> (defpackage :ctx2
> (:use :contextl))
>
> (in-package :ctx2)
>
> (define-layered-class person ()
> ((name :initarg :name :accessor person-name)))
>
> (deflayer employment-layer)
>
> (define-layered-class person
> :in-layer employment-layer ()
> ((employer :initarg :employer :layered-accessor person-employer)))
> ;;---------- END ctx2.lisp
>
> And the REPL session goes like this
>
> CL-USER> (compile-file "ctx2.lisp")
> ;; Compiling file D:\dev\code\lisp-systems\joe\ctx2.lisp ...
> ;; Wrote file D:\dev\code\lisp-systems\joe\ctx2.fas
> 0 errors, 0 warnings
> #P"D:\\dev\\code\\lisp-systems\\joe\\ctx2.fas"
> NIL
> NIL
> CL-USER> (load "ctx2.lisp")
> ;; Loading file ctx2.lisp ...
> ** SILME **
> The class #1=#<CONTEXTL:LAYERED-CLASS CTX2::PERSON :INCOMPLETE
> :VERSION 2> has not yet been finalized.
> [Condition of type SIMPLE-ERROR]
> ****
> ; Evaluation aborted
> CL-USER> (compile-file "ctx2.lisp")
> ;; Compiling file D:\dev\code\lisp-systems\joe\ctx2.lisp ...
> 0 errors, 0 warnings
> ** SILME **
> The class #1=#<CONTEXTL:LAYERED-CLASS CTX2::PERSON :INCOMPLETE
> :VERSION 2> has not yet been finalized.
> [Condition of type SIMPLE-ERROR]
> ****
> ; Evaluation aborted
> CL-USER>
>
> As you can see, the first compilation is ok. But the complain of class
> not initialize comes after the first load. And then the subsequent
> compilation of the sam file also fails.
>
> I used CLISP 2.36. On Windows 2000.
>
> Note that I can still follow the example fine if I each form true
> REPL. It might have something to do with compile-time and load-time
> differences.
> _______________________________________________
> closer-devel mailing list
> closer-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/closer-devel
--
Pascal Costanza, mailto:pc at p-cos.net, http://p-cos.net
Vrije Universiteit Brussel, Programming Technology Lab
Pleinlaan 2, B-1050 Brussel, Belgium
More information about the closer-devel
mailing list