Functors and names
Torsten Anders
t.anders at qub.ac.uk
Mon Jul 12 15:30:55 CEST 2004
Hi,
I defined some class hierarchy. To be able to do a check whether an
arbitrary datum is an instance of any class of this hierarchy I use a
name at a feature of the top-level class (as recommended somewhere in
the Oz lit.).
class MyClass
feat !MyName: unit
<class body>
end
fun {IsMyObject X}
{Object.is X} andthen {HasFeature X MyName}
end
My classes, the type checking function, and the name for type checking
is defined in functor A. Functor A also defines some function X to
generate more complex instances of my classes by calling the init
methods of the classes. In the Oz-IDE (i.e. not in any functor) I
define a function Y which calls function X. Everything works fine.
Now, I move function Y into a functor B and this breaks the
typechecking scheme. The objects created by function Y still contain a
feature with some name, but the name is different then the name defined
for type checking in functor A.
I do not understand this behaviour: is this intended (e.g. for security
reasons?)
Thank you!
Best,
Torsten
PS: I am still running Mozart 1.2.5 (does ozh and selection constraints
already work for 1.3?)
--
Torsten Anders
Sonic Arts Research Centre
Queen's University Belfast (UK)
www.torsten-anders.de
More information about the mozart-users
mailing list