[cells-devel] A thing that does not work well with Cells...

Peder Chr. Nørgaard pcn at pogt.dk
Thu May 21 11:08:46 UTC 2009


Hello Jakub.
	Thanks for your answer.  Well, there is no denying that your double setf 
makes the problem disappear in my small example.  On the other hand, I would 
not dare to use a solution like this without knowing what the problem really 
is.  And I still don't know that.

	Modifying the content of the prototype object of a class - which is what your 
proposal does - is too likely to have some devastating side effects - 
now .MD-STATE and .MD-NAME are no longer NIL by default, as specified in the 
definition of MODEL, they are :PROTOTYPE...

	And you are only partially right in that the problem is related to 
PRINT-OBJECT.  I know that the error that I (and you, obviously) get looks 
like a problem with PRINT-OBJECT - but I think that this is because there is 
a deeper-lying problem that throws a condition - which then uses PRINT-OBJECT 
to write out something about the problem - and then that fails, too.

	Next step for me will to make an attempt to make PRINT-OBJECT more robust so 
I can get to the "real" condition.


best regards
				--peder chr.

On Wednesday 20 May 2009, you wrote:
> Hello,
>
> I can hardly be considered to have an in depth knowledge of Cells, so
> I might be completely wrong, but the problem seems to be with the
> print-object for model class:
> from family.lisp:
> (defmethod print-object ((self model) s)
>   #+shhh (format s "~a" (type-of self))
>   (format s "~a~a" (if (mdead self) "DEAD!" "")
>     (or (md-name self) (type-of self))))
>
> I have no idea why this would even be called when accessing
> class-allocated slots, but it is, and fails because slots needed to
> print the prototype object are unbound. This can be worked around by
> setting them, adding:
>
> (setf (slot-value (sb-mop:class-prototype (find-class 'my-model))
> 'cells::.md-state) :prototype
>       (slot-value (sb-mop:class-prototype (find-class 'my-model))
> 'cells::.md-name) :prototype)
>
> To your file after finalize-inheritance makes the example work. I have
> no idea if this doesn't break something, I know about PCL even less
> than about Cells.
>
> Regards,
> Jakub Higersberger



-- 
Peder Chr. Nørgaard     e-mail: pcn at pogt.dk
Gefionsvej 19
DK-8230 Åbyhøj          tel: +45 87 44 11 99
Denmark                 mob: +45 30 91 84 31





More information about the cells-devel mailing list