Index: library/nx/nx.tcl =================================================================== diff -u -rbb1a4116720d5f205e44ec71f03857a340751fc3 -rcb4ee10b48bd3ab85d67d9f60617f6090a8adf59 --- library/nx/nx.tcl (.../nx.tcl) (revision bb1a4116720d5f205e44ec71f03857a340751fc3) +++ library/nx/nx.tcl (.../nx.tcl) (revision cb4ee10b48bd3ab85d67d9f60617f6090a8adf59) @@ -2273,6 +2273,13 @@ ::nsf::var::unset -nocomplain=$nocomplain $obj $prop } + ::nx::VariableSlot public method value=exists {obj prop} { + if {[string match "__*" [namespace tail [self]]]} { + set prop "__private(${:domain},$prop)" + } + ::nsf::var::exists $obj $prop + } + ::nx::VariableSlot public method value=add {obj prop value {pos 0}} { if {![:isMultivalued]} { #puts stderr "... vars [[self] info vars] // [[self] eval {set :multiplicity}]" Index: tests/methods.test =================================================================== diff -u -rbaee0c34119f4b237787204b8c3e64bc04c05782 -rcb4ee10b48bd3ab85d67d9f60617f6090a8adf59 --- tests/methods.test (.../methods.test) (revision baee0c34119f4b237787204b8c3e64bc04c05782) +++ tests/methods.test (.../methods.test) (revision cb4ee10b48bd3ab85d67d9f60617f6090a8adf59) @@ -643,7 +643,7 @@ } # dispatch methods without current object - ? ::o::a {wrong # args: use "::o ::o::a add|delete|get|set|unset"} + ? ::o::a {wrong # args: use "::o ::o::a add|delete|exists|get|set|unset"} ? ::o::b "::o2" ? ::o::foo "no current object; command called outside the context of a Next Scripting method" ? ::o::x "no current object; x called outside the context of a Next Scripting method" Index: tests/properties.test =================================================================== diff -u -rc4f449cb353be812ba6502ef8e9587e87881f59b -rcb4ee10b48bd3ab85d67d9f60617f6090a8adf59 --- tests/properties.test (.../properties.test) (revision c4f449cb353be812ba6502ef8e9587e87881f59b) +++ tests/properties.test (.../properties.test) (revision cb4ee10b48bd3ab85d67d9f60617f6090a8adf59) @@ -33,7 +33,7 @@ # a non-configurable property is a variable :property -accessor none -configurable false {vf vf1} - :public method call-local {v} {: -local $v get} + :public method call-local {v {what get}} {: -local $v $what} :create c1 } @@ -112,11 +112,16 @@ ? {c1 eval "info exists :a"} 1 ? {c1 eval "info exists :b"} 1 + ? {c1 b exists} 1 ? {c1 eval "info exists :c"} 1 + ? {c1 eval {:c exists}} 1 ? {c1 eval "info exists :d"} 0 + ? {c1 call-local d exists} 0 ? {c1 eval "info exists :va"} 1 ? {c1 eval "info exists :vb"} 1 + ? {c1 vb exists} 1 ? {c1 eval "info exists :vc"} 1 + ? {c1 eval {:vc exists}} 1 ? {c1 eval "info exists :vd"} 0 ? {c1 eval "info exists :ve"} 1 ? {c1 eval "info exists :vf"} 1 @@ -288,11 +293,15 @@ ? {c1 eval "info exists :a"} 1 ? {c1 eval "info exists :b"} 1 + ? {c1 b exists} 1 ? {c1 eval "info exists :c"} 1 + ? {c1 eval {:b exists}} 1 ? {c1 eval "info exists :d"} 0 ? {c1 eval "info exists :va"} 1 ? {c1 eval "info exists :vb"} 1 + ? {c1 vb exists} 1 ? {c1 eval "info exists :vc"} 1 + ? {c1 eval {:vc exists}} 1 ? {c1 eval "info exists :vd"} 0 #