what's wrong with this example?
Created by: reiniervandijk
I had example code:
(define-object point-test (b-spline-curve)
:objects
((point :type 'point :center (the :start)))
:computed-slots
((control-points (list (make-point -10 0 0)
(make-point -12 1.0 0.0)
(make-point -14 0.7 0.0)
(make-point -15 0.0 0.0)
(make-point -14 -0.5 0.0)
(make-point -12 0.3 0.0)
(make-point -10 0 0)))))
When I wanted to visualize the point object, I got the error:
Neither #<aircraft-mesher::point-test @ #x330605ca> nor any of its ancestor instances could handle the :get-member message The path to the containing object is: (the :root :root-object-object)
Why is it looking for it's aggregate?
Imported comments:
By genworks on 2013-03-20 19:25:50 UTC
The object called `point' is overriding the standard built-in "point" function of curve (which returns a point given its parameter as the argument). The "get-member'"error is a bit of a red herring - normally it expects an argument for the "point" function, but since "point" has been redefined as an object, it then "calls" this object with an "argument" and this fools the system into thinking it is looking for a member of a sequence, thus the "get-member" error.
Anyway the solution is to avoid overriding fundamental built-in functions or slots of objects you are mixing into your definitions -- so in this case, name your object something other than "point."
We can look at adding compiler warnings/errors for this sort of thing. On the one hand we don't want to prevent users from purposely overriding built-in messages if they know what they are doing, but accidentally overriding something just due to an unlucky choice of name should not be so easy to do. This Issue will remain open until we determine a better way for the compiler to handle scenarios like this.
By reiniervandijk on 2013-03-20 19:29:40 UTC
clear, thanks!