Index: TODO =================================================================== diff -u -rbb619a6b2fc3901ece190d869d7b41ddac84bad7 -r29ea21bd3f28ea7effaca6039e59a8a3499f8fd8 --- TODO (.../TODO) (revision bb619a6b2fc3901ece190d869d7b41ddac84bad7) +++ TODO (.../TODO) (revision 29ea21bd3f28ea7effaca6039e59a8a3499f8fd8) @@ -1398,6 +1398,14 @@ - removed obsolete code +- made methods (for now just scripted methods) by default protected. +- provide methode __default_method_protection to obtain the default + method protection when neither protected or public is used. +- per default methods are now protected +- provide ::nx::configure defaultMethodProtection true|false + as conveniant interface +- update regression test and serializer to handle default protection + TODO: - subcmd * handle sucmd for other method factories Index: library/nx/nx.tcl =================================================================== diff -u -r8e08d180ae5161c0ef4410ba3fda6b4de613a391 -r29ea21bd3f28ea7effaca6039e59a8a3499f8fd8 --- library/nx/nx.tcl (.../nx.tcl) (revision 8e08d180ae5161c0ef4410ba3fda6b4de613a391) +++ library/nx/nx.tcl (.../nx.tcl) (revision 29ea21bd3f28ea7effaca6039e59a8a3499f8fd8) @@ -73,7 +73,7 @@ ::nsf::methodproperty Class alloc redefine-protected true ::nsf::methodproperty Class dealloc redefine-protected true ::nsf::methodproperty Class create redefine-protected true - + ::nsf::method Object __resolve_method_path { -create:switch -per-object:switch @@ -88,7 +88,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::is class $object] && !${per-object} ? "Class" : "Object"}] + set scope [expr {[::nsf::is class $object] && !${per-object} ? "Class" : "Object"}] if {[::nsf::dispatch $object ::nsf::cmd::${scope}Info::methods $w] eq ""} { # # Create dispatch/ensemble object and accessor method (if wanted) @@ -133,6 +133,10 @@ } ::nsf::methodproperty Object __resolve_method_path protected true + ::nsf::method Object __default_method_protection args {return false} + ::nsf::methodproperty Object __default_method_protection protected true + + # define method "method" for Class and Object ::nsf::method Class method { @@ -144,7 +148,11 @@ array set "" [:__resolve_method_path -create -verbose $name] #puts "class method $(object).$(methodName) [list $arguments] {...}" set r [::nsf::method $(object) $(methodName) $arguments $body {*}$conditions] - if {[info exists returns]} {nsf::methodproperty $(object) $r returns $returns} + if {$r ne ""} { + # the method was not deleted + ::nsf::methodproperty $(object) $r protected [::nsf::dispatch $(object) __default_method_protection] + if {[info exists returns]} {::nsf::methodproperty $(object) $r returns $returns} + } return $r } @@ -157,7 +165,11 @@ array set "" [:__resolve_method_path -create -per-object -verbose $name] #puts "object method $(object).$(methodName) [list $arguments] {...}" set r [::nsf::method $(object) -per-object $(methodName) $arguments $body {*}$conditions] - if {[info exists returns]} {nsf::methodproperty $(object) $r returns $returns} + if {$r ne ""} { + # the method was not deleted + ::nsf::methodproperty $(object) $r protected [::nsf::dispatch $(object) __default_method_protection] + if {[info exists returns]} {::nsf::methodproperty $(object) $r returns $returns} + } return $r } @@ -204,7 +216,7 @@ Consider '[::nsf::current object] create $m $args' instead of '[::nsf::current object] $m $args'" } # protected is not yet defined - ::nsf::methodproperty [::nsf::current object] unknown protected 1 + ::nsf::methodproperty [::nsf::current object] unknown protected true } Object eval { @@ -226,7 +238,10 @@ ::nsf::methodproperty [::nsf::current object] $r [::nsf::current method] true return $r } + } + Object eval { + # Default unknown-handler for Object # # Actually, we do not need this unknown handler, but we could @@ -539,27 +554,6 @@ Object alias "info method" ::nsf::cmd::ObjectInfo::method Class alias "info method" ::nsf::cmd::ClassInfo::method - # TOOD REMOVE BLOCK - # puts "After Info" - # puts object-methods=[Object info methods] - # puts class-methods=[Class info methods] - # puts "" - # puts Object::info-methods=[lsort [nsf::dispatch ::nx::Object::slot::__info ::nsf::cmd::ObjectInfo::methods]] - # puts Class::info-methods_=[lsort [nsf::dispatch ::nx::Class::slot::__info ::nsf::cmd::ObjectInfo::methods]] - # puts "" - # puts Object::info-lookup=[nsf::dispatch ::nx::Object ::nsf::cmd::ObjectInfo::lookupmethod info] - # puts Class::info-lookup_=[nsf::dispatch ::nx::Class ::nsf::cmd::ObjectInfo::lookupmethod info] - # puts "" - # puts Object::info-def=[nsf::dispatch ::nx::Object ::nsf::cmd::ClassInfo::method definition info] - # puts Class::info-def_=[nsf::dispatch ::nx::Class ::nsf::cmd::ClassInfo::method definition info] - # puts "" - # puts object-superclass=[Object info superclass] - # puts class-superclass=[Class info superclass] - # # Object create o1 - # # puts obj-info-info=[o1 info info] - # # puts class-info-info=[Object info info] - # puts "" - # # Definition of "abstract method foo ...." # @@ -596,7 +590,7 @@ Class create ::nx::MetaSlot ::nsf::relation MetaSlot superclass Class - MetaSlot method createFromParameterSyntax { + MetaSlot public method createFromParameterSyntax { target -per-object:switch {-initblock ""} value default:optional @@ -801,7 +795,7 @@ # Provide the a slot based mechanism for building an object # configuration interface from slot definitions - ObjectParameterSlot method toParameterSyntax {{name:substdefault ${:name}}} { + ObjectParameterSlot public method toParameterSyntax {{name:substdefault ${:name}}} { set objparamdefinition $name set methodparamdefinition "" set objopts [list] @@ -1108,16 +1102,17 @@ # set variable body to minimize problems with spacing, since # the body is literally compared by the slot optimizer. set body {::nsf::setvar $obj $var $value} - :method assign [list obj var value:$(mparam),multivalued,slot=[::nsf::current object]] $body + :public method assign [list obj var value:$(mparam),multivalued,slot=[::nsf::current object]] \ + $body #puts stderr "adding add method for [::nsf::current object] with value:$(mparam)" - :method add [list obj prop value:$(mparam),slot=[::nsf::current object] {pos 0}] { + :public method add [list obj prop value:$(mparam),slot=[::nsf::current object] {pos 0}] { ::nsf::next } } else { #puts stderr "SV adding assign [list obj var value:$(mparam)] // for [::nsf::current object] with $(mparam)" set body {::nsf::setvar $obj $var $value} - :method assign [list obj var value:$(mparam),slot=[::nsf::current object]] $body + :public method assign [list obj var value:$(mparam),slot=[::nsf::current object]] $body } } if {[info exists :valuechangedcmd]} { @@ -1132,9 +1127,9 @@ # mixin class for optimizing slots Class create ::nx::Attribute::Optimizer { - :method method args {::nsf::next; :optimize} - :method forward args {::nsf::next; :optimize} - :protected method init args {::nsf::next; :optimize} + :method method args {set r [::nsf::next]; :optimize; return $r} + :method forward args {set r [::nsf::next]; :optimize; return $r} + :protected method init args {set r [::nsf::next]; :optimize; return $r} :public method optimize {} { #puts stderr OPTIMIZER-[info exists :incremental] @@ -1476,7 +1471,28 @@ # some utilities ####################################################### + # + # Provide mechanisms to configure nx # + ::nx::Object create ::nx::configure { + # + # Set the default method protection for nx methods. This + # protection level is used per default for all method definitions + # without explicit protection specified. + # + :method defaultMethodProtection {value:boolean,optional} { + if {[info exists value]} { + ::nsf::method Object __default_method_protection args [list return $value] + } + return [::nsf::dispatch [::nx::current object] __default_method_protection] + } + } + # + # Make the default protected methods + # + ::nx::configure defaultMethodProtection true + + # # Provide an ensemble-like interface to the ::nsf primitiva to # access variables. Note that aliasing in the next scripting # framework is faster than namespace-ensembles. Index: library/serialize/serializer.tcl =================================================================== diff -u -r89376e0f64856bb395fdb4407c9646787545a08b -r29ea21bd3f28ea7effaca6039e59a8a3499f8fd8 --- library/serialize/serializer.tcl (.../serializer.tcl) (revision 89376e0f64856bb395fdb4407c9646787545a08b) +++ library/serialize/serializer.tcl (.../serializer.tcl) (revision 29ea21bd3f28ea7effaca6039e59a8a3499f8fd8) @@ -165,11 +165,11 @@ } } - :method addPostCmd {cmd} { + :public method addPostCmd {cmd} { if {$cmd ne ""} {append :post_cmds $cmd "\n"} } - :method setObjectSystemSerializer {o serializer} { + :public method setObjectSystemSerializer {o serializer} { #puts stderr "set :serializer($o) $serializer" set :serializer($o) $serializer } @@ -225,7 +225,7 @@ } } - :method needsOneOf list { + :public method needsOneOf list { foreach e $list {if {[info exists :s($e)]} {return 1}} return 0 } @@ -288,7 +288,7 @@ return $pre_cmds$result${:post_cmds}$exports } - :method deepSerialize {o} { + :public method deepSerialize {o} { # assumes $o to be fully qualified set instances [Serializer allChildren $o] foreach oss [ObjectSystemSerializer info instances] { @@ -301,7 +301,7 @@ # class object specfic methods ############################### - :class-object method allChildren o { + :public class-object method allChildren o { # return o and all its children fully qualified set set [::nsf::dispatch $o -objscope ::nsf::current] foreach c [$o info children] { @@ -314,7 +314,7 @@ foreach {o p m} $list {set :exportMethods([list $o $p $m]) 1} } - :class-object method exportObjects list { + :public class-object method exportObjects list { foreach o $list {set :exportObjects($o) 1} } @@ -402,7 +402,7 @@ concat $object [$s method-serialize $object $method $prefix] } - :class-object method deepSerialize {-ignoreVarsRE -ignore -map args} { + :public class-object method deepSerialize {-ignoreVarsRE -ignore -map args} { :resetPattern set s [:new -childof [::nsf::current object] -volatile] if {[info exists ignoreVarsRE]} {$s ignoreVarsRE $ignoreVarsRE} @@ -453,7 +453,7 @@ return $cmd } - :method registerTrace {on} { + :public method registerTrace {on} { if {$on} { ::nsf::alias ${:rootClass} __trace__ -objscope ::trace } else { @@ -464,7 +464,7 @@ # # Handle association between objects and responsible serializers # - :method registerSerializer {s instances} { + :public method registerSerializer {s instances} { # Communicate responsibility to serializer object $s foreach i $instances { if {![::nsf::dispatch $i ::nsf::cmd::ObjectInfo::hastype ${:rootClass}]} continue @@ -567,7 +567,7 @@ # general object serialization ############################### - :method serialize {objectOrClass s} { + :public method serialize {objectOrClass s} { :[:classify $objectOrClass]-serialize $objectOrClass $s } @@ -598,7 +598,7 @@ # general dependency handling ############################### - :method needsNothing {x s} { + :public method needsNothing {x s} { return [:[:classify $x]-needsNothing $x $s] } Index: library/xotcl/tests/slottest.xotcl =================================================================== diff -u -r27e11788125901ff468955117d165f70d3871ce0 -r29ea21bd3f28ea7effaca6039e59a8a3499f8fd8 --- library/xotcl/tests/slottest.xotcl (.../slottest.xotcl) (revision 27e11788125901ff468955117d165f70d3871ce0) +++ library/xotcl/tests/slottest.xotcl (.../slottest.xotcl) (revision 29ea21bd3f28ea7effaca6039e59a8a3499f8fd8) @@ -112,7 +112,7 @@ #? {O2 superclass O} "superclass 1" ? {O superclass} "::xotcl::Object" -::nx::ObjectParameterSlot method slot {object name property} { +::nx::ObjectParameterSlot public method slot {object name property} { switch $property { self {return [self]} domain {return [my domain]} @@ -327,7 +327,7 @@ # redefine setter for foo of class A #A slot foo method assign {domain var val} ... -A::slot::foo method assign {domain var val} { +A::slot::foo public method assign {domain var val} { # Do something with [self] that isn't valid pre-init puts setter-[self proc] $domain set $var $val @@ -409,7 +409,7 @@ Person slots { Attribute create sex -type "sex" -convert true { - :method type=sex {name value} { + :public method type=sex {name value} { #puts stderr "[self] slot specific converter" switch -glob $value { m* {return m} @@ -479,7 +479,7 @@ Class create A -slots { Attribute create foo -default 1 { - :method assign { domain var value} { + :public method assign { domain var value} { if {$value < 0 || $value > 99} { error "$value is not in the range of 0 .. 99" } Index: tests/aliastest.tcl =================================================================== diff -u -rdb040438a3c030830d17aff502ca7bff91eba9b7 -r29ea21bd3f28ea7effaca6039e59a8a3499f8fd8 --- tests/aliastest.tcl (.../aliastest.tcl) (revision db040438a3c030830d17aff502ca7bff91eba9b7) +++ tests/aliastest.tcl (.../aliastest.tcl) (revision 29ea21bd3f28ea7effaca6039e59a8a3499f8fd8) @@ -1,4 +1,5 @@ package require nx; namespace import -force ::nx::* +::nx::configure defaultMethodProtection false package require nx::test Test parameter count 10 Index: tests/destroytest.tcl =================================================================== diff -u -re130899462517e1170d6604b875871ce2476a3bc -r29ea21bd3f28ea7effaca6039e59a8a3499f8fd8 --- tests/destroytest.tcl (.../destroytest.tcl) (revision e130899462517e1170d6604b875871ce2476a3bc) +++ tests/destroytest.tcl (.../destroytest.tcl) (revision 29ea21bd3f28ea7effaca6039e59a8a3499f8fd8) @@ -1,4 +1,5 @@ package require nx; namespace import ::nx::* +::nx::configure defaultMethodProtection false package require nx::test Test parameter count 10 Index: tests/forwardtest.tcl =================================================================== diff -u -rd168a26bce713de8daa5bbe79d740926e961c5bc -r29ea21bd3f28ea7effaca6039e59a8a3499f8fd8 --- tests/forwardtest.tcl (.../forwardtest.tcl) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) +++ tests/forwardtest.tcl (.../forwardtest.tcl) (revision 29ea21bd3f28ea7effaca6039e59a8a3499f8fd8) @@ -8,7 +8,7 @@ Test case delegation { Object create dog Object create tail { - :method wag args { return $args } + :public method wag args { return $args } } dog forward wag tail %proc @@ -48,7 +48,7 @@ ########################################### Test case multiple-args { Object create target { - :method foo args {return $args} + :public method foo args {return $args} } Object create obj { :forward foo target %proc %self a1 a2 @@ -87,13 +87,13 @@ ########################################### Test case info-via-forward { Object create Info { - :method @mixin {o} { + :public method @mixin {o} { $o info mixin } - :method @class {o} { ;# without prefix, doing here a [Info class] wod be wrong + :public method @class {o} { ;# without prefix, doing here a [Info class] wod be wrong $o info class } - :method @help {o} { ;# define a new subcommand for info + :public method @help {o} { ;# define a new subcommand for info foreach c [:info methods] {lappend result [string range $c 1 end]} return $result } @@ -180,7 +180,7 @@ } ? {obj append x y z} 2yz - Object create n; Object create n::x {:method current {} {current}} + Object create n; Object create n::x {:public method current {} {current}} Object create o o forward ::n::x ? {o x current} ::n::x @@ -281,12 +281,12 @@ ? {obj s 100} 100 ? {obj s} 100 - Object method f args { next } + Object public method f args { next } Class create NS Class create NS::Main { - :class-object method m1 {} { :m2 } - :class-object method m2 {} { + :public class-object method m1 {} { :m2 } + :public class-object method m2 {} { ? {namespace eval :: {Object create toplevelObj1}} ::toplevelObj1 ? [list set _ [namespace current]] ::NS @@ -310,8 +310,8 @@ } } - :method i1 {} { :i2 } - :method i2 {} { + :public method i1 {} { :i2 } + :public method i2 {} { ? {namespace eval :: {Object create toplevelObj2}} ::toplevelObj2 ? [list set _ [namespace current]] ::NS @@ -365,7 +365,7 @@ Class create C { :method xx {} {current} - :class-object method t {o expr} { + :public class-object method t {o expr} { return [$o expr $expr] } } Index: tests/info-method.tcl =================================================================== diff -u -r38f8651fe4c101ee7ad98aa46bcadc32459bfdc7 -r29ea21bd3f28ea7effaca6039e59a8a3499f8fd8 --- tests/info-method.tcl (.../info-method.tcl) (revision 38f8651fe4c101ee7ad98aa46bcadc32459bfdc7) +++ tests/info-method.tcl (.../info-method.tcl) (revision 29ea21bd3f28ea7effaca6039e59a8a3499f8fd8) @@ -1,4 +1,5 @@ package req nx +::nx::configure defaultMethodProtection false package require nx::test Test case base { Index: tests/interceptor-slot.tcl =================================================================== diff -u -rd168a26bce713de8daa5bbe79d740926e961c5bc -r29ea21bd3f28ea7effaca6039e59a8a3499f8fd8 --- tests/interceptor-slot.tcl (.../interceptor-slot.tcl) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) +++ tests/interceptor-slot.tcl (.../interceptor-slot.tcl) (revision 29ea21bd3f28ea7effaca6039e59a8a3499f8fd8) @@ -127,7 +127,7 @@ Test parameter count 3 Test case "filter-and-creation" { Class create Foo { - :method myfilter {args} { + :public method myfilter {args} { set i [::incr ::count] set s [self] set m [current calledmethod] @@ -139,7 +139,7 @@ return $r } # method for testing next to non-existing shadowed method - :method baz {} {next} + :public method baz {} {next} } # define nx unknown handler in case it does not exist Index: tests/method-modifiers.tcl =================================================================== diff -u -rd168a26bce713de8daa5bbe79d740926e961c5bc -r29ea21bd3f28ea7effaca6039e59a8a3499f8fd8 --- tests/method-modifiers.tcl (.../method-modifiers.tcl) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) +++ tests/method-modifiers.tcl (.../method-modifiers.tcl) (revision 29ea21bd3f28ea7effaca6039e59a8a3499f8fd8) @@ -1,4 +1,5 @@ package require nx; namespace import ::nx::* +::nx::configure defaultMethodProtection false package require nx::test Test parameter count 10 Index: tests/method-require.tcl =================================================================== diff -u -rd168a26bce713de8daa5bbe79d740926e961c5bc -r29ea21bd3f28ea7effaca6039e59a8a3499f8fd8 --- tests/method-require.tcl (.../method-require.tcl) (revision d168a26bce713de8daa5bbe79d740926e961c5bc) +++ tests/method-require.tcl (.../method-require.tcl) (revision 29ea21bd3f28ea7effaca6039e59a8a3499f8fd8) @@ -3,56 +3,56 @@ Test parameter count 10 Test case method-require { - - # - # A few method-provides - # - # Some provides could be in e.g. nx.tcl, some could be loaded via - # package require. We could as well think about an auto-indexer - # producing these.... - # - - nsf::provide_method append {::nsf::alias append -objscope ::append} - nsf::provide_method lappend {::nsf::alias lappend -objscope ::lappend} - nsf::provide_method set {::nsf::alias set -objscope ::set} - nsf::provide_method tcl::set {::nsf::alias set -objscope ::set} - nsf::provide_method exists {::nsf::alias exists ::nsf::cmd::Object::exists} - nsf::provide_method foo {::nsf::method foo {x y} {return x=$x,y=$y}} - nsf::provide_method x {::nsf::mixin ::MIX} { - # here could be as well a package require, etc. - ::nx::Class create ::MIX {:method x {} {return x}} - } - - # - # Lets try it out: - # - - nx::Class create C { - :require method set - :require method exists - - # required names can be different from registered names; if there - # are multiple set methods, we could point to the right one - :require method tcl::set - - # object methods: - :require class-object method lappend - - # a scripted method - :require class-object method foo - - :require class-object method x - - # looks as well ok: - :require namespace - } + + # + # A few method-provides + # + # Some provides could be in e.g. nx.tcl, some could be loaded via + # package require. We could as well think about an auto-indexer + # producing these.... + # + + nsf::provide_method append {::nsf::alias append -objscope ::append} + nsf::provide_method lappend {::nsf::alias lappend -objscope ::lappend} + nsf::provide_method set {::nsf::alias set -objscope ::set} + nsf::provide_method tcl::set {::nsf::alias set -objscope ::set} + nsf::provide_method exists {::nsf::alias exists ::nsf::cmd::Object::exists} + nsf::provide_method foo {::nsf::method foo {x y} {return x=$x,y=$y}} + nsf::provide_method x {::nsf::mixin ::MIX} { + # here could be as well a package require, etc. + ::nx::Class create ::MIX {:public method x {} {return x}} + } + + # + # Lets try it out: + # + + nx::Class create C { + :require method set + :require method exists - C create c1 - ? {c1 set x 100} 100 - ? {c1 exists x} 1 - ? {C lappend some_list e1 e2} "e1 e2" - ? {C foo 1 2} x=1,y=2 - ? {C x} x + # required names can be different from registered names; if there + # are multiple set methods, we could point to the right one + :require method tcl::set + + # object methods: + :require class-object method lappend + + # a scripted method + :require class-object method foo + + :require class-object method x + + # looks as well ok: + :require namespace + } + + C create c1 + ? {c1 set x 100} 100 + ? {c1 exists x} 1 + ? {C lappend some_list e1 e2} "e1 e2" + ? {C foo 1 2} x=1,y=2 + ? {C x} x } Index: tests/parameters.tcl =================================================================== diff -u -r0c7e47e58354106c6810812efe41008ce5ae939b -r29ea21bd3f28ea7effaca6039e59a8a3499f8fd8 --- tests/parameters.tcl (.../parameters.tcl) (revision 0c7e47e58354106c6810812efe41008ce5ae939b) +++ tests/parameters.tcl (.../parameters.tcl) (revision 29ea21bd3f28ea7effaca6039e59a8a3499f8fd8) @@ -1,5 +1,6 @@ package require nx package require nx::test +::nx::configure defaultMethodProtection false namespace import ::nx::* Test case dummy { Index: tests/protected.tcl =================================================================== diff -u -rf3cb5afe6aa1b6761b4a9909058f64ff7d64ab92 -r29ea21bd3f28ea7effaca6039e59a8a3499f8fd8 --- tests/protected.tcl (.../protected.tcl) (revision f3cb5afe6aa1b6761b4a9909058f64ff7d64ab92) +++ tests/protected.tcl (.../protected.tcl) (revision 29ea21bd3f28ea7effaca6039e59a8a3499f8fd8) @@ -5,13 +5,13 @@ Test parameter count 1 Class create C { - :alias SET ::set - :method foo {} {return [current method]} - :method bar {} {return [current method]} - :method bar-foo {} { + :public alias SET ::set + :public method foo {} {return [current method]} + :public method bar {} {return [current method]} + :public method bar-foo {} { c1 foo } - :method bar-SET {} { + :public method bar-SET {} { c1 SET x 1 } } Index: tests/returns.tcl =================================================================== diff -u -r8e08d180ae5161c0ef4410ba3fda6b4de613a391 -r29ea21bd3f28ea7effaca6039e59a8a3499f8fd8 --- tests/returns.tcl (.../returns.tcl) (revision 8e08d180ae5161c0ef4410ba3fda6b4de613a391) +++ tests/returns.tcl (.../returns.tcl) (revision 29ea21bd3f28ea7effaca6039e59a8a3499f8fd8) @@ -1,4 +1,5 @@ -package require nx; # namespace import -force ::nx::* +package require nx +::nx::configure defaultMethodProtection false package require nx::test # Index: tests/submethods.tcl =================================================================== diff -u -r441c083eb3b4f9084f03aace7d990a1d40521c88 -r29ea21bd3f28ea7effaca6039e59a8a3499f8fd8 --- tests/submethods.tcl (.../submethods.tcl) (revision 441c083eb3b4f9084f03aace7d990a1d40521c88) +++ tests/submethods.tcl (.../submethods.tcl) (revision 29ea21bd3f28ea7effaca6039e59a8a3499f8fd8) @@ -1,5 +1,6 @@ package req nx namespace import ::nx::* +::nx::configure defaultMethodProtection false package require nx::test Test case submethods { Index: tests/var-access.tcl =================================================================== diff -u -rf3cb5afe6aa1b6761b4a9909058f64ff7d64ab92 -r29ea21bd3f28ea7effaca6039e59a8a3499f8fd8 --- tests/var-access.tcl (.../var-access.tcl) (revision f3cb5afe6aa1b6761b4a9909058f64ff7d64ab92) +++ tests/var-access.tcl (.../var-access.tcl) (revision 29ea21bd3f28ea7effaca6039e59a8a3499f8fd8) @@ -1,4 +1,5 @@ package require nx +::nx::configure defaultMethodProtection false package require nx::test namespace eval ::nx::var1 { Index: tests/varresolutiontest.tcl =================================================================== diff -u -r89376e0f64856bb395fdb4407c9646787545a08b -r29ea21bd3f28ea7effaca6039e59a8a3499f8fd8 --- tests/varresolutiontest.tcl (.../varresolutiontest.tcl) (revision 89376e0f64856bb395fdb4407c9646787545a08b) +++ tests/varresolutiontest.tcl (.../varresolutiontest.tcl) (revision 29ea21bd3f28ea7effaca6039e59a8a3499f8fd8) @@ -1,6 +1,8 @@ +# # testing var resolution - +# package require nx; namespace import ::nx::* +::nx::configure defaultMethodProtection false package require nx::test Test parameter count 1