Index: library/nx/nx.tcl =================================================================== diff -u -r84af56591a1cc4ac7a3779ec44f6978203ef016a -ra588ad9e5d66f12c4b2a5baf9153b652932a5912 --- library/nx/nx.tcl (.../nx.tcl) (revision 84af56591a1cc4ac7a3779ec44f6978203ef016a) +++ library/nx/nx.tcl (.../nx.tcl) (revision a588ad9e5d66f12c4b2a5baf9153b652932a5912) @@ -410,30 +410,7 @@ # register method "info" on Object and Class Object forward info -onerror ::nsf::infoError ::nx::objectInfo %1 {%@2 %self} Class forward info -onerror ::nsf::infoError ::nx::classInfo %1 {%@2 %self} - ::nsf::methodproperty nx::Class info class-only true - #Class method info args { - # # In case Class.info is applied on an object (via mixins), do "next" - # if {![::nsf::objectproperty [::nsf::current object] class]} next else { - # if {[catch {::nx::classInfo [lindex $args 0] [::nsf::current object] {*}[lrange $args 1 end]} result]} { -# ::nsf::infoError $result -# } -# return $result -# } -# } - Class method filterguard {filter guard} { - # In case Class.filterguard is applied on an object (via mixins), do "next" - if {![::nsf::objectproperty [::nsf::current object] class]} next else { - ::nsf::dispatch [::nsf::current object] ::nsf::cmd::Class::filterguard $filter $guard - } - } - Class method mixinguard {mixin guard} { - # In case Class.mixinguard is applied on an object (via mixins), do "next" - if {![::nsf::objectproperty [::nsf::current object] class]} next else { - ::nsf::dispatch [::nsf::current object] ::nsf::cmd::Class::mixinguard $mixin $guard - } - } - # # definition of "abstract method foo ...." # @@ -940,9 +917,19 @@ # @param ::nx::Class#superclass # - # Specifies superclasses for a given class. As a setter, - # {{{superclass}}} changes the list of superclasses. When used as - # a getter, the method returns the current superclasses. + # Specifies superclasses for a given class. As a setter *** + # generell: setter kann hier mit der methode namens "setter" + # verwechselt werden; wir sollten hier die paramter syntax + # anfuehren, die allerdings in zwei varianten kommt: + #{{{ + # obj superclass ?value? + # obj superclass add|assign|delete|get value + #}}} + # Das gilt allgemein, nicht nur für die relation-slots, sondern + # für alle incremental slots. + # **** {{{superclass}}} changes the list + # of superclasses. When used as a getter, the method returns the + # current superclasses. # # @return :list If called as a getter (without arguments), # {{{superclass}}} returns the current superclasses of the object @@ -966,7 +953,8 @@ # can retrieve the list of mixins active for the given object. # # @return :list If called as a getter (without arguments), {{{mixin}}} returns the list of current mixin classes registered with the object - ::nx::RelationSlot create ${os}::Object::slot::mixin -methodname object-mixin + ::nx::RelationSlot create ${os}::Object::slot::mixin \ + -methodname object-mixin # @param ::nx::Object#filter # @@ -978,7 +966,8 @@ # @return :list If called as a getter (without arguments), # {{{filter}}} returns the list of current filters # registered with the object - ::nx::RelationSlot create ${os}::Object::slot::filter -elementtype "" + ::nx::RelationSlot create ${os}::Object::slot::filter -elementtype "" \ + -methodname object-filter # @param ::nx::Class#mixin # @@ -1174,10 +1163,7 @@ # Define method "attribute" for convenience ############################################ Class method attribute {spec {-slotclass ::nx::Attribute} {initblock ""}} { - # In case Class.attribute is applied on an object (via mixins), do "next" - if {![::nsf::objectproperty [::nsf::current object] class]} next else { - $slotclass createFromParameterSyntax [::nsf::current object] -initblock $initblock {*}$spec - } + $slotclass createFromParameterSyntax [::nsf::current object] -initblock $initblock {*}$spec } Object method attribute {spec {-slotclass ::nx::Attribute} {initblock ""}} { @@ -1453,7 +1439,19 @@ } } + ####################################################### + # Methods of metaclasses are methods intended for + # classes. Make sure, these methods are only applied + # on classes. + ####################################################### + + #puts stderr Class-methods=[lsort [Class info methods]] + foreach m [Class info methods] { + ::nsf::methodproperty Class $m class-only true + } + + ####################################################### # some utilities #######################################################