[Xotcl] representing graphs in xotcl...

Gustaf Neumann neumann at wu-wien.ac.at
Wed Nov 7 17:26:45 CET 2007


Shishir Ramam schrieb:
> Not sure if this should be considered expected behaviour - but does 
> the type have to be defined before declaration?
yes, the checking predicate is determined currently at definition time;
if the specified "type" is not an existing class, the checker uses the
"string is ..." as test method, therefore the error message.

All checking is in tcl, so it can be redefined, if you want (see method 
check_single_value
of ::xotcl::Attribute in predefined.xotcl).

However, you can define also the slots after the class is defined:

  Class DerivedA -superclass Base
  Class DerivedB -superclass Base

  DerivedA slots { Attribute connects_to -multivalued true -type DerivedB }
  DerivedB slots { Attribute connects_to -multivalued true -type DerivedA }

This will work out of the box....

best regards

-gustaf neumann



More information about the Xotcl mailing list