Index: library/xotcl/library/xotcl2.tcl =================================================================== diff -u -ra11d866d48c3ced35ec09fe74ddc12b58b6ef928 -r34c85637bb11720deca13064e587dc41a53134a2 --- library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision a11d866d48c3ced35ec09fe74ddc12b58b6ef928) +++ library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision 34c85637bb11720deca13064e587dc41a53134a2) @@ -251,6 +251,7 @@ # provide some Tcl-commands as methods for ::xotcl::Object ::nsf::method::alias Object append -frame object ::append ::nsf::method::alias Object array -frame object ::array + ::nsf::method::alias Object dict -frame object ::dict ::nsf::method::alias Object eval -frame object ::eval ::nsf::method::alias Object incr -frame object ::incr ::nsf::method::alias Object lappend -frame object ::lappend @@ -1466,6 +1467,7 @@ # Tcl commands set ::nsf::parameter::syntax(::append) "/varName/ ?/value/ ...?" set ::nsf::parameter::syntax(::array) "/option/ /arrayName/ ?/arg/ ...?" + set ::nsf::parameter::syntax(::dict) "/option/ /dictName|dictValue/ ?/arg/ ...?" set ::nsf::parameter::syntax(::eval) "/arg/ ?/arg/ ...?" set ::nsf::parameter::syntax(::incr) "/varName/ ?/increment/?" set ::nsf::parameter::syntax(::lappend) "/varName/ ?/value/ ...?" Index: library/xotcl/tests/speedtest.xotcl =================================================================== diff -u -r67639f37e908458f0c4016135f8d7771c7dde465 -r34c85637bb11720deca13064e587dc41a53134a2 --- library/xotcl/tests/speedtest.xotcl (.../speedtest.xotcl) (revision 67639f37e908458f0c4016135f8d7771c7dde465) +++ library/xotcl/tests/speedtest.xotcl (.../speedtest.xotcl) (revision 34c85637bb11720deca13064e587dc41a53134a2) @@ -597,6 +597,33 @@ -cmd {foo; ::B info instances} -expected {} -count 2 \ -post {B destroy; A destroy; M destroy; MC destroy; rename foo ""} +nx::test new -msg {dict external} \ + -pre { + unset ::_ + Object create o + } \ + -cmd { + lappend ::_ [o dict set d a first] + lappend ::_ [o dict set d b second] + lappend ::_ [o dict get [o set d] b] + set ::_ + } -expected {{a first} {a first b second} second} -count 2 \ + -post {o destroy; unset ::_} + +nx::test new -msg {dict resolver} \ + -pre { + Object create o + o proc foo {} { + dict set :mydict 1 one + dict set :mydict 2 two + dict keys ${:mydict} + } + } \ + -cmd { + o foo + } -expected {1 2} -count 2 \ + -post {o destroy} + # # Check whether the setting of the autoname object property is already # visible immediately after the object creation (e.g. in an overloaded Index: library/xotcl/tests/testx.xotcl =================================================================== diff -u -rcd6385e474d293b04f48d3d003e0a2f777b11d3b -r34c85637bb11720deca13064e587dc41a53134a2 --- library/xotcl/tests/testx.xotcl (.../testx.xotcl) (revision cd6385e474d293b04f48d3d003e0a2f777b11d3b) +++ library/xotcl/tests/testx.xotcl (.../testx.xotcl) (revision 34c85637bb11720deca13064e587dc41a53134a2) @@ -3185,11 +3185,11 @@ ::errorCheck [b info procs] objproc "info procs" ::errorCheck [B info instprocs] myProc2 "info instprocs" - ::errorCheck [lsort [b info methods]] "__object_configureparameter abstract append array autoname check class cleanup configure contains copy defaultmethod destroy eval exists extractConfigureArg f filter filterguard filtersearch forward hasclass incr info init instvar invar isclass ismetaclass ismixin isobject istype lappend method mixin mixinguard move myProc myProc2 myProcMix1 myProcMix2 noinit objproc parametercmd proc procsearch requireNamespace residualargs self set setFilter signature subst trace unknown unset uplevel upvar volatile vwait" "b info methods" + ::errorCheck [lsort [b info methods]] "__object_configureparameter abstract append array autoname check class cleanup configure contains copy defaultmethod destroy dict eval exists extractConfigureArg f filter filterguard filtersearch forward hasclass incr info init instvar invar isclass ismetaclass ismixin isobject istype lappend method mixin mixinguard move myProc myProc2 myProcMix1 myProcMix2 noinit objproc parametercmd proc procsearch requireNamespace residualargs self set setFilter signature subst trace unknown unset uplevel upvar volatile vwait" "b info methods" ::errorCheck [lsort [b info methods -nocmds]] "__object_configureparameter abstract check extractConfigureArg f filtersearch forward hasclass init isclass ismetaclass ismixin isobject istype method myProc myProc2 myProcMix1 myProcMix2 objproc proc procsearch self setFilter signature unknown vwait" "b info methods -nocmds" - ::errorCheck [lsort [b info methods -noprocs]] "append array autoname class cleanup configure destroy eval exists filter filterguard incr info instvar invar lappend mixin mixinguard noinit parametercmd requireNamespace residualargs set subst trace unset uplevel upvar volatile" "b info methods -noprocs" + ::errorCheck [lsort [b info methods -noprocs]] "append array autoname class cleanup configure destroy dict eval exists filter filterguard incr info instvar invar lappend mixin mixinguard noinit parametercmd requireNamespace residualargs set subst trace unset uplevel upvar volatile" "b info methods -noprocs" ::errorCheck [lsort [b info methods -nocmds -nomixins]] "__object_configureparameter abstract check extractConfigureArg f filtersearch forward hasclass init isclass ismetaclass ismixin isobject istype method myProc myProc2 objproc proc procsearch self setFilter signature unknown vwait" "b info methods -nocmds -nomixins" ::errorCheck [b info methods -nocmds -noprocs] "" "b info methods -nocmds -noprocs" @@ -3587,9 +3587,9 @@ set ::context payrollApp - ::errorCheck [lsort [jim info methods]] "__object_configureparameter abstract age append array autoname check class cleanup configure contains copy defaultmethod destroy driving-license eval exists extractConfigureArg filter filterguard filtersearch forward hasclass id incr info init instvar invar isclass ismetaclass ismixin isobject istype lappend method mixin mixinguard move name noinit parametercmd print proc procsearch requireNamespace residualargs salary self set signature subst trace unknown unset uplevel upvar volatile vwait" "condmixin all methods" + ::errorCheck [lsort [jim info methods]] "__object_configureparameter abstract age append array autoname check class cleanup configure contains copy defaultmethod destroy dict driving-license eval exists extractConfigureArg filter filterguard filtersearch forward hasclass id incr info init instvar invar isclass ismetaclass ismixin isobject istype lappend method mixin mixinguard move name noinit parametercmd print proc procsearch requireNamespace residualargs salary self set signature subst trace unknown unset uplevel upvar volatile vwait" "condmixin all methods" - ::errorCheck "[lsort [jim info methods -incontext]]" "__object_configureparameter abstract age append array autoname check class cleanup configure contains copy defaultmethod destroy eval exists extractConfigureArg filter filterguard filtersearch forward hasclass id incr info init instvar invar isclass ismetaclass ismixin isobject istype lappend method mixin mixinguard move name noinit parametercmd print proc procsearch requireNamespace residualargs salary self set signature subst trace unknown unset uplevel upvar volatile vwait" "all methods in context" + ::errorCheck "[lsort [jim info methods -incontext]]" "__object_configureparameter abstract age append array autoname check class cleanup configure contains copy defaultmethod destroy dict eval exists extractConfigureArg filter filterguard filtersearch forward hasclass id incr info init instvar invar isclass ismetaclass ismixin isobject istype lappend method mixin mixinguard move name noinit parametercmd print proc procsearch requireNamespace residualargs salary self set signature subst trace unknown unset uplevel upvar volatile vwait" "all methods in context" ::errorCheck [my show payrollApp jim] "{payrollApp: jim info methods salary => salary} {payrollApp: jim info methods -incontext salary => salary} {payrollApp: jim info methods driv* => driving-license} {payrollApp: jim info methods -incontext driv* => }" "payrollApp jim" ::errorCheck [my show shipmentApp jim] "{shipmentApp: jim info methods salary => salary} {shipmentApp: jim info methods -incontext salary => } {shipmentApp: jim info methods driv* => driving-license} {shipmentApp: jim info methods -incontext driv* => driving-license}" "shipmentApp jim"