merge-display-control on self
Created by: reiniervandijk
Consider:
(define-object color-test (base-object)
:computed-slots
((display-controls (list :color :red)))
:objects
((box1 :type 'box-solid :width 1 :length 1 :height 1
:display-controls (merge-display-controls (list :transparency 0.5)))
(box2 :type 'box-solid :width 1 :length 1 :height 1
:display-controls (merge-display-controls (list :color :blue)))))
Now, I would expect that my box1 would merge the color of self (:red) with a new transparency, instead it will look for the parent that obviously does not exists in the context of color-test, hence losing color information. Why not actually use self instead of parent?
Imported comments:
By genworks on 2013-02-18 19:40:20 UTC
The issue with using self is if you have
... :computed-slots ((display-controls (merge-display-controls (list :color :red)))) ...
then you end up with a circularity.
I guess the question is whether display-controls is more likely to be specified as a computed-slot in the current object, or as an input to a child object.