View · Search · Index
No registered users in community xowiki
in last 10 minutes

Re: [Xotcl] representing graphs in xotcl...

From: Gustaf Neumann <neumann_at_wu-wien.ac.at>
Date: Wed, 07 Nov 2007 17:26:45 +0100

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