Index: library/nx/nx.tcl =================================================================== diff -u -rd9c5a4b5c33bfa0bdb33ef52bd703390d933eb98 -rd9b42d77f43db84a9983cc3bbc4124cf0b52df29 --- library/nx/nx.tcl (.../nx.tcl) (revision d9c5a4b5c33bfa0bdb33ef52bd703390d933eb98) +++ library/nx/nx.tcl (.../nx.tcl) (revision d9b42d77f43db84a9983cc3bbc4124cf0b52df29) @@ -347,7 +347,7 @@ set methodName [lindex $path end] foreach w [lrange $path 0 end-1] { #puts stderr "check $object info methods $path @ <$w>" - set scope [expr {[nsf::objectproperty class $object] && !${per-object} ? "Class" : "Object"}] + set scope [expr {[nsf::is class $object] && !${per-object} ? "Class" : "Object"}] if {[$object ::nsf::cmd::${scope}Info::methods -methodtype all $w] eq ""} { # # Create dispatch/ensemble object and accessor method (if wanted) @@ -756,7 +756,7 @@ set parent [::nsf::dispatch $self ::nsf::cmd::ObjectInfo::parent] set grandparent [::nsf::dispatch $parent ::nsf::cmd::ObjectInfo::parent] set tail [namespace tail $parent] - if {$tail eq "slot" && [::nsf::objectproperty class $grandparent]} { + if {$tail eq "slot" && [::nsf::is class $grandparent]} { set aliases [::nsf::dispatch $grandparent ::nsf::cmd::ClassInfo::methods -methodtype alias] foreach alias $aliases { set def [::nsf::dispatch $grandparent ::nsf::cmd::ClassInfo::method definition $alias] @@ -778,7 +778,7 @@ set path $(name) while {1} { set o [::nsf::dispatch $o ::nsf::cmd::ObjectInfo::parent] - if {![::nsf::objectproperty type $o ::nx::EnsembleObject]} break + if {![$o has type ::nx::EnsembleObject]} break array set "" [$o ::nsf::classes::nx::EnsembleObject::subcmdName] set path "$(name) $path" } @@ -853,7 +853,7 @@ :alias "info has mixin" ::nsf::cmd::ObjectInfo::hasmixin :alias "info has namespace" ::nsf::cmd::ObjectInfo::hasnamespace :alias "info has type" ::nsf::cmd::ObjectInfo::hastype - :method "info is" {kind} {::nsf::objectproperty $kind [::nsf::current object]} + :alias "info is" ::nsf::cmd::ObjectInfo::istype :alias "info methods" ::nsf::cmd::ObjectInfo::methods :alias "info mixin guard" ::nsf::cmd::ObjectInfo::mixinguard :alias "info mixin classes" ::nsf::cmd::ObjectInfo::mixinclasses @@ -1216,7 +1216,7 @@ } ObjectParameterSlot public method destroy {} { - if {${:domain} ne "" && [::nsf::objectproperty class ${:domain}]} { + if {${:domain} ne "" && [::nsf::is class ${:domain}]} { ::nsf::invalidateobjectparameter ${:domain} } ::nsf::next @@ -1230,7 +1230,7 @@ if {![info exists :methodname]} { set :methodname ${:name} } - if {[::nsf::objectproperty class ${:domain}]} { + if {[::nsf::is class ${:domain}]} { ::nsf::invalidateobjectparameter ${:domain} } if {${:per-object} && [info exists :default] } { @@ -1273,7 +1273,7 @@ } if {[info exists :type]} { if {[string match ::* ${:type}]} { - set type [expr {[::nsf::objectproperty metaclass ${:type}] ? "class" : "object"}] + set type [expr {[::nsf::is metaclass ${:type}] ? "class" : "object"}] lappend objopts type=${:type} lappend methodopts type=${:type} } else { @@ -1340,7 +1340,7 @@ if {![::nsf::dispatch $slot ::nsf::cmd::ObjectInfo::hastype ::nx::Slot]} continue # Skip some slots for xotcl; # TODO: maybe different parameterFromSlots for xotcl? - if {[::nsf::is ::xotcl::Object class] + if {[::nsf::is class ::xotcl::Object] && [::nsf::dispatch $obj ::nsf::cmd::ObjectInfo::hastype ::xotcl::Object] && ([$slot name] eq "mixin" || [$slot name] eq "filter") } continue @@ -1354,7 +1354,7 @@ Object protected method objectparameter {{lastparameter __initcmd:initcmd,optional}} { #puts stderr "... objectparameter [::nsf::current object]" set parameterdefinitions [::nsf::parametersFromSlots [::nsf::current object]] - if {[::nsf::objectproperty class [::nsf::current object]]} { + if {[::nsf::is class [::nsf::current object]]} { lappend parameterdefinitions -parameter:method,optional } lappend parameterdefinitions \ @@ -1406,7 +1406,7 @@ } set value [::nsf::dispatch $value -objscope ::nsf::current object] } - if {![::nsf::objectproperty class ${:elementtype}]} { + if {![::nsf::is class ${:elementtype}]} { error "$value does not appear to be of type ${:elementtype}" } } @@ -1778,14 +1778,15 @@ ################################################################## Slot method type=baseclass {name value} { - if {![::nsf::objectproperty baseclass $value]} { + # note, that we cannot use "nsf::is baseclass ..." here, since nsf::is call this converter + if {![::nsf::isobject $value] || ![::nsf::dispatch $value ::nsf::cmd::ObjectInfo::istype baseclass]} { error "expected baseclass but got \"$value\" for parameter $name" } return $value } Slot method type=metaclass {name value} { - if {![::nsf::objectproperty metaclass $value]} { + if {![::nsf::isobject $value] || ![::nsf::dispatch $value ::nsf::cmd::ObjectInfo::istype metaclass]} { error "expected metaclass but got \"$value\" for parameter $name" } return $value @@ -1837,10 +1838,10 @@ Class mixin add $m end # TODO: the following is not pretty; however, contains might # build xotcl and next objects. - if {[::nsf::is ::xotcl::Class class]} {::xotcl::Class instmixin add $m end} + if {[::nsf::is class ::xotcl::Class]} {::xotcl::Class instmixin add $m end} namespace eval $object $cmds Class mixin delete $m - if {[::nsf::is ::xotcl::Class class]} {::xotcl::Class instmixin delete $m} + if {[::nsf::is class ::xotcl::Class]} {::xotcl::Class instmixin delete $m} } else { namespace eval $object $cmds } @@ -1906,7 +1907,7 @@ set dest [:getDest $origin] if {[::nsf::isobject $origin]} { # copy class information - if {[::nsf::objectproperty class $origin]} { + if {[::nsf::is class $origin]} { set cl [[$origin info class] create $dest -noinit] # class object set obj $cl @@ -1936,7 +1937,7 @@ ::nsf::forward $dest -per-object $i {*}[$origin ::nsf::cmd::ObjectInfo::forward -definition $i] } - if {[::nsf::objectproperty class $origin]} { + if {[::nsf::is class $origin]} { foreach i [$origin ::nsf::cmd::ClassInfo::forward] { ::nsf::forward $dest $i {*}[$origin ::nsf::cmd::ClassInfo::forward -definition $i] } @@ -1959,7 +1960,7 @@ } # alter 'domain' and 'manager' in slot objects for classes foreach origin [set :targetList] { - if {[::nsf::objectproperty class $origin]} { + if {[::nsf::is class $origin]} { set dest [:getDest $origin] foreach oldslot [$origin info slots] { set newslot [::nx::slotObj $dest [namespace tail $oldslot]] @@ -1992,7 +1993,7 @@ :copy $newName } ### let all subclasses get the copied class as superclass - if {[::nsf::objectproperty class [::nsf::current object]] && $newName ne ""} { + if {[::nsf::is class [::nsf::current object]] && $newName ne ""} { foreach subclass [:info subclass] { set scl [$subclass info superclass] if {[set index [lsearch -exact $scl [::nsf::current object]]] != -1} {