Index: library/nx/nx.tcl =================================================================== diff -u -rf9dbc318044af9e7cc6114171f0f06120b249ab5 -r8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf --- library/nx/nx.tcl (.../nx.tcl) (revision f9dbc318044af9e7cc6114171f0f06120b249ab5) +++ library/nx/nx.tcl (.../nx.tcl) (revision 8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf) @@ -36,7 +36,7 @@ # get frequenly used primitiva from the next scripting framework # namespace export next current self configure finalize interp is my relation - namespace import ::nsf::next ::nsf::current ::nsf::self ::nsf::my ::nsf::object::dispatch + namespace import ::nsf::next ::nsf::current ::nsf::self ::nsf::my ::nsf::dispatch # # provide the standard command set for ::nx::Object @@ -122,7 +122,7 @@ #puts stderr ===nx118 set scope [expr {[::nsf::is class $object] && !${per-object} ? "class" : "object"}] #puts stderr ===nx119 - if {[::nsf::method::dispatch $object ::nsf::methods::${scope}::info::methods $w] eq ""} { + if {[::nsf::directdispatch $object ::nsf::methods::${scope}::info::methods $w] eq ""} { # # Create dispatch/ensemble object and accessor method (if wanted) # @@ -143,8 +143,8 @@ # The accessor method exists already, check, if it is # appropriate for extending. # - set type [::nsf::method::dispatch $object ::nsf::methods::${scope}::info::method type $w] - set definition [::nsf::method::dispatch $object ::nsf::methods::${scope}::info::method definition $w] + set type [::nsf::directdispatch $object ::nsf::methods::${scope}::info::method type $w] + set definition [::nsf::directdispatch $object ::nsf::methods::${scope}::info::method definition $w] if {$scope eq "class"} { if {$type ne "alias"} {error "can't append to $type"} if {$definition eq ""} {error "definition must not be empty"} @@ -190,7 +190,7 @@ if {$r ne ""} { # the method was not deleted ::nsf::method::property $(object) $r call-protected \ - [::nsf::object::dispatch $(object) __default_method_call_protection] + [::nsf::dispatch $(object) __default_method_call_protection] if {[info exists returns]} {::nsf::method::property $(object) $r returns $returns} } return $r @@ -211,7 +211,7 @@ if {$r ne ""} { # the method was not deleted ::nsf::method::property $(object) $r call-protected \ - [::nsf::object::dispatch $(object) __default_method_call_protection] + [::nsf::dispatch $(object) __default_method_call_protection] if {[info exists returns]} {::nsf::method::property $(object) $r returns $returns} } return $r @@ -308,7 +308,7 @@ } set r [::nsf::method::forward $(object) -per-object $(methodName) {*}$arguments] ::nsf::method::property $(object) -per-object $r call-protected \ - [::nsf::object::dispatch $(object) __default_method_call_protection] + [::nsf::dispatch $(object) __default_method_call_protection] if {[info exists returns]} {::nsf::method::property $(object) $r returns $returns} return $r } @@ -328,7 +328,7 @@ } set r [::nsf::method::forward $(object) $(methodName) {*}$arguments] ::nsf::method::property $(object) $r call-protected \ - [::nsf::object::dispatch $(object) __default_method_call_protection] + [::nsf::dispatch $(object) __default_method_call_protection] if {[info exists returns]} {::nsf::method::property $(object) $r returns $returns} return $r } @@ -345,7 +345,7 @@ set r [::nsf::method::alias $(object) -per-object $(methodName) \ -frame $frame $cmd] ::nsf::method::property $(object) -per-object $r call-protected \ - [::nsf::object::dispatch $(object) __default_method_call_protection] + [::nsf::dispatch $(object) __default_method_call_protection] if {[info exists returns]} {::nsf::method::property $(object) $r returns $returns} return $r } @@ -355,7 +355,7 @@ #puts "class alias $(object).$(methodName) $cmd" set r [::nsf::method::alias $(object) $(methodName) -frame $frame $cmd] ::nsf::method::property $(object) $r call-protected \ - [::nsf::object::dispatch $(object) __default_method_call_protection] + [::nsf::dispatch $(object) __default_method_call_protection] if {[info exists returns]} {::nsf::method::property $(object) $r returns $returns} return $r } @@ -391,7 +391,7 @@ return [::nsf::method::require [::nsf::self] $methodName 0] } namespace { - ::nsf::method::dispatch [::nsf::self] ::nsf::methods::object::requirenamespace + ::nsf::directdispatch [::nsf::self] ::nsf::methods::object::requirenamespace } } } @@ -625,17 +625,17 @@ # "package forget". We clear "info method" for ::nx::Object to avoid # confusions in the copy loop below, which uses method "method". # - if {[::nsf::method::dispatch ::nx::Object::slot::__info ::nsf::methods::object::info::methods "method"] ne ""} { + if {[::nsf::directdispatch ::nx::Object::slot::__info ::nsf::methods::object::info::methods "method"] ne ""} { Object method "info method" {} {} } # # Copy all info methods except the subobjects to # ::nx::Class::slot::__info # - foreach m [::nsf::method::dispatch ::nx::Object::slot::__info ::nsf::methods::object::info::methods] { - if {[::nsf::method::dispatch ::nx::Object::slot::__info ::nsf::methods::object::info::method type $m] eq "object"} continue - set definition [::nsf::method::dispatch ::nx::Object::slot::__info ::nsf::methods::object::info::method definition $m] + foreach m [::nsf::directdispatch ::nx::Object::slot::__info ::nsf::methods::object::info::methods] { + if {[::nsf::directdispatch ::nx::Object::slot::__info ::nsf::methods::object::info::method type $m] eq "object"} continue + set definition [::nsf::directdispatch ::nx::Object::slot::__info ::nsf::methods::object::info::method definition $m] ::nx::Class::slot::__info {*}[lrange $definition 1 end] unset definition } @@ -704,9 +704,9 @@ ###################################################################### proc ::nx::infoOptions {obj} { - #puts stderr "INFO INFO $obj -> '[::nsf::method::dispatch $obj ::nsf::methods::object::info::methods -methodtype all]'" + #puts stderr "INFO INFO $obj -> '[::nsf::directdispatch $obj ::nsf::methods::object::info::methods -methodtype all]'" set methods [list] - foreach name [::nsf::method::dispatch $obj ::nsf::methods::object::info::methods] { + foreach name [::nsf::directdispatch $obj ::nsf::methods::object::info::methods] { if {$name eq "unknown"} continue lappend methods $name } @@ -1041,7 +1041,7 @@ # Report just application specific methods not starting with "__" # set methods [list] - foreach m [::nsf::method::dispatch [::nsf::self] \ + foreach m [::nsf::directdispatch [::nsf::self] \ ::nsf::methods::object::info::lookupmethods -source application] { if {[string match __* $m]} continue lappend methods $m @@ -1199,7 +1199,7 @@ # Collect the object parameter slots in per-position lists to # ensure partial ordering and avoid sorting. # - foreach slot [nsf::method::dispatch [self] ::nsf::methods::class::info::slotobjects -closure -type ::nx::Slot] { + foreach slot [nsf::directdispatch [self] ::nsf::methods::class::info::slotobjects -closure -type ::nx::Slot] { lappend defs([$slot position]) [$slot getParameterSpec] } # @@ -1271,7 +1271,7 @@ if {![::nsf::object::exists $value]} { error "$value does not appear to be an object" } - set value [::nsf::method::dispatch $value -frame method ::nsf::self] + set value [::nsf::directdispatch $value -frame method ::nsf::self] } } set p [lsearch -exact $old $value] @@ -1392,28 +1392,28 @@ # ${os}::Object::slot::filter method guard {obj prop filter guard:optional} { if {[info exists guard]} { - ::nsf::method::dispatch $obj ::nsf::methods::object::filterguard $filter $guard + ::nsf::directdispatch $obj ::nsf::methods::object::filterguard $filter $guard } else { $obj info filter guard $filter } } ${os}::Class::slot::filter method guard {obj prop filter guard:optional} { if {[info exists guard]} { - ::nsf::method::dispatch $obj ::nsf::methods::class::filterguard $filter $guard + ::nsf::directdispatch $obj ::nsf::methods::class::filterguard $filter $guard } else { $obj info filter guard $filter } } ${os}::Object::slot::mixin method guard {obj prop mixin guard:optional} { if {[info exists guard]} { - ::nsf::method::dispatch $obj ::nsf::methods::object::mixinguard $mixin $guard + ::nsf::directdispatch $obj ::nsf::methods::object::mixinguard $mixin $guard } else { $obj info mixin guard $mixin } } ${os}::Class::slot::mixin method guard {obj prop filter guard:optional} { if {[info exists guard]} { - ::nsf::method::dispatch $obj ::nsf::methods::class::mixinguard $filter $guard + ::nsf::directdispatch $obj ::nsf::methods::class::mixinguard $filter $guard } else { $obj info mixin guard $filter } @@ -1550,7 +1550,7 @@ ::nsf::method::property ${:domain} \ {*}[expr {${:per-object} ? "-per-object" : ""}] \ $handle call-protected \ - [::nsf::object::dispatch ${:domain} __default_property_call_protection] + [::nsf::dispatch ${:domain} __default_property_call_protection] return 1 } @@ -1610,7 +1610,7 @@ ::nx::VariableSlot protected method handleTraces {} { # essentially like before set __initcmd "" - set trace {::nsf::method::dispatch [::nsf::self] -frame object ::trace} + set trace {::nsf::directdispatch [::nsf::self] -frame object ::trace} # There might be already default values registered on the # class. If so, defaultcmd is ignored. if {[info exists :default]} { @@ -1641,7 +1641,7 @@ # ::nx::VariableSlot method __default_from_cmd {obj cmd var sub op} { #puts "GETVAR [::nsf::current method] obj=$obj cmd=$cmd, var=$var, op=$op" - ::nsf::method::dispatch $obj -frame object \ + ::nsf::directdispatch $obj -frame object \ ::trace remove variable $var $op [list [::nsf::self] [::nsf::current method] $obj $cmd] ::nsf::var::set $obj $var [$obj eval $cmd] } @@ -1763,7 +1763,7 @@ if {$nocomplain} {$slot eval {set :nocomplain 1}} if {[info exists value]} {$slot setCheckedInstVar -nocomplain=$nocomplain $value} - return [::nsf::method::dispatch [self] ::nsf::methods::object::info::method handle [$slot name]] + return [::nsf::directdispatch [self] ::nsf::methods::object::info::method handle [$slot name]] } Object method property { @@ -1795,7 +1795,7 @@ -defaultopts [list -accessor $accessor -config $config] \ $spec \ {*}[expr {[info exists default] ? [list $default] : ""}]] - return [::nsf::method::dispatch [self] ::nsf::methods::class::info::method handle [$slot name]] + return [::nsf::directdispatch [self] ::nsf::methods::class::info::method handle [$slot name]] } nx::Class method property { @@ -1901,7 +1901,7 @@ if {![info exists object]} {set object [::nsf::self]} if {![::nsf::object::exists $object]} {$class create $object} # reused in XOTcl, no "require" there, so use nsf primitiva - ::nsf::method::dispatch $object ::nsf::methods::object::requirenamespace + ::nsf::directdispatch $object ::nsf::methods::object::requirenamespace if {$withnew} { set m [ScopedNew new -container $object -withclass $class] $m volatile @@ -1910,13 +1910,13 @@ # build xotcl and next objects. if {[::nsf::is class ::xotcl::Class]} {::xotcl::Class instmixin add $m end} #namespace eval $object $cmds - #::nsf::object::dispatch [self] -frame method ::apply [list {} $cmds $object] + #::nsf::directdispatch [self] -frame method ::apply [list {} $cmds $object] ::apply [list {} $cmds $object] Class mixin delete $m if {[::nsf::is class ::xotcl::Class]} {::xotcl::Class instmixin delete $m} } else { #namespace eval $object $cmds - #::nsf::object::dispatch [self] -frame method ::apply [list {} $cmds $object] + #::nsf::directdispatch [self] -frame method ::apply [list {} $cmds $object] ::apply [list {} $cmds $object] } } @@ -1936,7 +1936,7 @@ #puts stderr "COPY makeTargetList $t targetList '${:targetList}'" # if it is an object without namespace, it is a leaf if {[::nsf::object::exists $t]} { - if {[::nsf::method::dispatch $t ::nsf::methods::object::info::hasnamespace]} { + if {[::nsf::directdispatch $t ::nsf::methods::object::info::hasnamespace]} { # make target list from all children set children [$t info children] } else { @@ -2001,8 +2001,8 @@ ::nsf::relation $obj object-filter [::nsf::relation $origin object-filter] ::nsf::relation $obj object-mixin [::nsf::relation $origin object-mixin] # reused in XOTcl, no "require" there, so use nsf primitiva - if {[::nsf::method::dispatch $origin ::nsf::methods::object::info::hasnamespace]} { - ::nsf::method::dispatch $obj ::nsf::methods::object::requirenamespace + if {[::nsf::directdispatch $origin ::nsf::methods::object::info::hasnamespace]} { + ::nsf::directdispatch $obj ::nsf::methods::object::requirenamespace } } else { namespace eval $dest {} @@ -2037,7 +2037,7 @@ # transfer the traces # foreach var [$origin info vars] { - set cmds [::nsf::method::dispatch $origin -frame object ::trace info variable $var] + set cmds [::nsf::directdispatch $origin -frame object ::trace info variable $var] if {$cmds ne ""} { foreach cmd $cmds { foreach {op def} $cmd break @@ -2151,7 +2151,7 @@ ::nsf::method::create Object __default_method_call_protection args [list return $value] ::nsf::method::property Object __default_method_call_protection call-protected true } - return [::nsf::object::dispatch [::nx::self] __default_method_call_protection] + return [::nsf::dispatch [::nx::self] __default_method_call_protection] } # @@ -2164,7 +2164,7 @@ ::nsf::method::create Object __default_property_call_protection args [list return $value] ::nsf::method::property Object __default_property_call_protection call-protected true } - return [::nsf::object::dispatch [::nx::self] __default_property_call_protection] + return [::nsf::dispatch [::nx::self] __default_property_call_protection] } } #