I have the following in one namespace say shapes:
(derive ::rect ::shape)
(derive ::square ::rect)
Now executing the following in the shapes namespace:
(isa? ::square ::shape)
returns true. But when I execute the following in a namespace where I actually implement multimethods for drawing,
(isa? ::square ::shape)
it returns false. So even though I have the correct multimethod dispatch functions in place I get an error that says “no dispatch function found”.
Am I missing something? Implementing all types of shapes in one giant namespace seems pointless to me.
Turns out, :: uses the current namespace so in order to use types from other namespaces you need to use fully qualified names such as :shapes/square.