Index: TODO =================================================================== diff -u -ra77e97b5d2b703b7c60a850b1f20f6c75e5029ac -r74b7a4066526ff5f5a8080ed907f71c9ed5c7700 --- TODO (.../TODO) (revision a77e97b5d2b703b7c60a850b1f20f6c75e5029ac) +++ TODO (.../TODO) (revision 74b7a4066526ff5f5a8080ed907f71c9ed5c7700) @@ -4933,6 +4933,19 @@ - added mongo::cursor::aggregate - extended regression test +nsf.c: +- fix case, where NsfDStringPrintf() failed (when print llength including + \0 was 1 byte longer than print buffer) +- make sure, that the list kept for the cached parameter is just built + from unshared objects; otherwise Tcl append will abort + +nx.tcl: +- new package "nx::volatile" +- don't define configure parameter "-volatile" per default; + use "package req nx::volatile" instead +- don't define per method "volatile" per default; + use "::nsf::method::require ::nx::Object volatile" instead + ======================================================================== TODO: Index: generic/nsf.c =================================================================== diff -u -rcd33e8cefca1d52063ebcb6689e46527bb94e33d -r74b7a4066526ff5f5a8080ed907f71c9ed5c7700 --- generic/nsf.c (.../nsf.c) (revision cd33e8cefca1d52063ebcb6689e46527bb94e33d) +++ generic/nsf.c (.../nsf.c) (revision 74b7a4066526ff5f5a8080ed907f71c9ed5c7700) @@ -6066,23 +6066,25 @@ /* * Found the element, append to it */ - /* fprintf(stderr, "TclObjListAdd: insert %s equal %s\n", keyString, eltString);*/ + /* fprintf(stderr, "TclObjListAdd: insert %s/%s equal, append to %s\n", + keyString, ObjStr(value), ObjStr(elt->payload));*/ Tcl_ListObjAppendElement(interp, elt->payload, value); return; } if (strcmp(keyString, eltString) < 0) { /* * Element not found, insert new before as a new entry. */ - /* fprintf(stderr, "TclObjListAdd: insert %s before %s\n", keyString, eltString);*/ - TclObjListNewElement(prevPtr, key, value); + /*fprintf(stderr, "TclObjListAdd: insert %s/%s before %s isshared %d\n", + keyString, ObjStr(value), eltString, Tcl_IsShared(key));*/ + TclObjListNewElement(prevPtr, key, Tcl_IsShared(value) ? Tcl_DuplicateObj(value) : value); return; } } /* * Element not found, insert new as last entry. */ - /* fprintf(stderr, "TclObjListAdd: insert last %s\n", keyString); */ + /* fprintf(stderr, "TclObjListAdd: insert last %s value %s\n", keyString, ObjStr(value)); */ TclObjListNewElement(prevPtr, key, Tcl_NewListObj(1, &value)); return; Index: generic/nsf.tcl =================================================================== diff -u -r880487204ff2da18d2d25ebd727b9b4bbda86c8e -r74b7a4066526ff5f5a8080ed907f71c9ed5c7700 --- generic/nsf.tcl (.../nsf.tcl) (revision 880487204ff2da18d2d25ebd727b9b4bbda86c8e) +++ generic/nsf.tcl (.../nsf.tcl) (revision 74b7a4066526ff5f5a8080ed907f71c9ed5c7700) @@ -92,6 +92,7 @@ # ::nsf::method::provide autoname {::nsf::method::alias autoname ::nsf::methods::object::autoname} ::nsf::method::provide exists {::nsf::method::alias exists ::nsf::methods::object::exists} + ::nsf::method::provide volatile {::nsf::method::alias volatile ::nsf::methods::object::volatile} ###################################################################### # unknown handler for objects and classes Index: generic/predefined.h =================================================================== diff -u -rac2bbda827dff056beb23cf8400ab77b6996d1e8 -r74b7a4066526ff5f5a8080ed907f71c9ed5c7700 --- generic/predefined.h (.../predefined.h) (revision ac2bbda827dff056beb23cf8400ab77b6996d1e8) +++ generic/predefined.h (.../predefined.h) (revision 74b7a4066526ff5f5a8080ed907f71c9ed5c7700) @@ -31,6 +31,7 @@ "uplevel [list ::nsf::relation $object $rel \"\"]}}\n" "::nsf::method::provide autoname {::nsf::method::alias autoname ::nsf::methods::object::autoname}\n" "::nsf::method::provide exists {::nsf::method::alias exists ::nsf::methods::object::exists}\n" +"::nsf::method::provide volatile {::nsf::method::alias volatile ::nsf::methods::object::volatile}\n" "proc ::nsf::object::unknown {name} {\n" "foreach {key handler} [array get ::nsf::object::unknown] {\n" "set result [uplevel [list {*}$handler $name]]\n" Index: library/lib/nx-volatile.tcl =================================================================== diff -u --- library/lib/nx-volatile.tcl (revision 0) +++ library/lib/nx-volatile.tcl (revision 74b7a4066526ff5f5a8080ed907f71c9ed5c7700) @@ -0,0 +1,31 @@ +# +# Package to add configure-parameter "-volatile" +# +package require nx +package provide nx::volatile 1.0 + +namespace eval ::nx { + + ::nx::ObjectParameterSlot create ::nx::Object::slot::volatile -noarg true + + ::nsf::method::create ::nx::Object::slot::volatile assign {object var value} { + $object ::nsf::methods::object::volatile + } + ::nsf::method::create ::nx::Object::slot::volatile get {object var} { + ::nsf::object::property $object volatile + } + + # this loop should not be required. + foreach c [::nx::Object info subclass -closure] { + ::nsf::parameter:invalidate::classcache $c + } + unset -nocomplain c + +} + +# +# Local variables: +# mode: tcl +# tcl-indent-level: 2 +# indent-tabs-mode: nil +# End: Index: library/nx/nx.tcl =================================================================== diff -u -rcd33e8cefca1d52063ebcb6689e46527bb94e33d -r74b7a4066526ff5f5a8080ed907f71c9ed5c7700 --- library/nx/nx.tcl (.../nx.tcl) (revision cd33e8cefca1d52063ebcb6689e46527bb94e33d) +++ library/nx/nx.tcl (.../nx.tcl) (revision 74b7a4066526ff5f5a8080ed907f71c9ed5c7700) @@ -76,8 +76,6 @@ # # provide the standard command set for ::nx::Object # - ::nsf::method::alias Object volatile ::nsf::methods::object::volatile -# ::nsf::method::alias Object configure ::nsf::methods::object::configure ::nsf::method::alias Object upvar ::nsf::methods::object::upvar ::nsf::method::alias Object destroy ::nsf::methods::object::destroy ::nsf::method::alias Object uplevel ::nsf::methods::object::uplevel @@ -1577,17 +1575,6 @@ -forwardername class-filter -elementtype filterreg # - # Create object parameter slots for "noninit" and "volatile" - # - #::nx::ObjectParameterSlot create ::nx::Object::slot::noinit \ - # -methodname ::nsf::methods::object::noinit -noarg true - ::nx::ObjectParameterSlot create ::nx::Object::slot::volatile -noarg true - ::nsf::method::create ::nx::Object::slot::volatile assign {object var value} {$object volatile} - ::nsf::method::create ::nx::Object::slot::volatile get {object var} { - ::nsf::object::property $object volatile - } - - # # Define "class" as a ObjectParameterSlot defined as alias # ::nx::ObjectParameterSlot create ::nx::Object::slot::class \ @@ -2224,7 +2211,7 @@ set childof [uplevel {namespace current}] } # - # Use the uplevel method to assure that "... new -volatile ..." + # Use the uplevel method to assure that e.g. "... new -volatile ..." # has the right scope # :uplevel [list [self] ::nsf::methods::class::new -childof $childof {*}$args] @@ -2519,8 +2506,11 @@ } Object public method copy {{newName ""}} { - if {[string compare [string trimleft $newName :] [string trimleft [::nsf::self] :]]} { - [CopyHandler new -volatile] copy [::nsf::self] $newName + if {[string trimleft $newName :] ne [string trimleft [::nsf::self] :]} { + set h [CopyHandler new] + set r [$h copy [::nsf::self] $newName] + $h destroy + return $r } } Index: library/serialize/serializer.tcl =================================================================== diff -u -r0f21940570f915a602d376d0faaab3081f057538 -r74b7a4066526ff5f5a8080ed907f71c9ed5c7700 --- library/serialize/serializer.tcl (.../serializer.tcl) (revision 0f21940570f915a602d376d0faaab3081f057538) +++ library/serialize/serializer.tcl (.../serializer.tcl) (revision 74b7a4066526ff5f5a8080ed907f71c9ed5c7700) @@ -380,8 +380,7 @@ # don't filter anything during serialization set filterstate [::nsf::configure filter off] - set s [:new -childof [::nsf::current object] -volatile] - #$s volatile + set s [:new -childof [::nsf::current object]] if {[info exists ignoreVarsRE]} {$s ignoreVarsRE $ignoreVarsRE} if {[info exists ignore]} {$s ignore $ignore} @@ -421,6 +420,7 @@ foreach oss [ObjectSystemSerializer info instances] { append r [$oss serialize-all-end $s] } + $s destroy append r { #::nx::Slot mixin delete ::nx::Slot::Nocheck @@ -455,27 +455,25 @@ } :public object method methodSerialize {object method prefix} { - set s [:new -childof [::nsf::current object] -volatile] foreach oss [ObjectSystemSerializer info instances] { if {[$oss responsibleSerializer $object]} { set result [$oss serializeExportedMethod $object $prefix $method] break } } - #concat $object [$s method-serialize $object $method $prefix] return $result } :public object method deepSerialize {-ignoreVarsRE -ignore -map -objmap args} { :resetPattern - set s [:new -childof [::nsf::current object] -volatile] - #$s volatile + set s [:new -childof [::nsf::current object]] if {[info exists ignoreVarsRE]} {$s ignoreVarsRE $ignoreVarsRE} if {[info exists ignore]} {$s ignore $ignore} if {[info exists objmap]} {$s objmap $objmap} foreach o $args { append r [$s deepSerialize [::nsf::directdispatch $o -frame method ::nsf::current]] } + $s destroy if {[info exists map]} {return [string map $map $r]} return $r } @@ -1018,3 +1016,10 @@ namespace export Serializer namespace eval :: "namespace import -force [namespace current]::*" } + +# +# Local variables: +# mode: tcl +# tcl-indent-level: 2 +# indent-tabs-mode: nil +# End: Index: tests/cget.test =================================================================== diff -u -r4bc60e16c10fdbbb640b3019d4bdebdc469fdf55 -r74b7a4066526ff5f5a8080ed907f71c9ed5c7700 --- tests/cget.test (.../cget.test) (revision 4bc60e16c10fdbbb640b3019d4bdebdc469fdf55) +++ tests/cget.test (.../cget.test) (revision 74b7a4066526ff5f5a8080ed907f71c9ed5c7700) @@ -53,7 +53,7 @@ # # configure without arguments # - ? {p1 info configure} "?-sex /value/? -famnam /value/ ?-age /integer/? ?-friends /value .../? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ? {p1 info configure} "?-sex /value/? -famnam /value/ ?-age /integer/? ?-friends /value .../? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" } # @@ -93,7 +93,7 @@ # # configure without arguments # - ? {p1 info configure} "?-bar1 /value/? ?-bar2 /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ? {p1 info configure} "?-bar1 /value/? ?-bar2 /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" # # test gettin/setting via slots @@ -130,7 +130,9 @@ :public method m1 {args} {set :m1 $args; return $args} :create c1 } - + + package req nx::volatile + # # class-level lookup # Index: tests/destroy.test =================================================================== diff -u -r4bc60e16c10fdbbb640b3019d4bdebdc469fdf55 -r74b7a4066526ff5f5a8080ed907f71c9ed5c7700 --- tests/destroy.test (.../destroy.test) (revision 4bc60e16c10fdbbb640b3019d4bdebdc469fdf55) +++ tests/destroy.test (.../destroy.test) (revision 74b7a4066526ff5f5a8080ed907f71c9ed5c7700) @@ -674,6 +674,9 @@ ? [list info command $c] "" "explicit destroy of class" + package require nx::volatile + ::nsf::method::require ::nx::Object volatile + # create new class and object and cleanup everything set x [nx::Class new { :volatile Index: tests/info-method.test =================================================================== diff -u -r4bc60e16c10fdbbb640b3019d4bdebdc469fdf55 -r74b7a4066526ff5f5a8080ed907f71c9ed5c7700 --- tests/info-method.test (.../info-method.test) (revision 4bc60e16c10fdbbb640b3019d4bdebdc469fdf55) +++ tests/info-method.test (.../info-method.test) (revision 74b7a4066526ff5f5a8080ed907f71c9ed5c7700) @@ -128,8 +128,8 @@ ? {::nx::Object info lookup methods -source application} "" ? {::nx::Class info lookup methods -source application} "" - set object_methods "cget configure contains copy delete destroy eval info move object private protected public require volatile" - set class_methods "alias cget configure contains copy create delete destroy eval filter forward info method mixin move new object private property protected public require variable volatile" + set object_methods "cget configure contains copy delete destroy eval info move object private protected public require" + set class_methods "alias cget configure contains copy create delete destroy eval filter forward info method mixin move new object private property protected public require variable" ? {lsort [::nx::Object info lookup methods -source system]} $class_methods ? {lsort [::nx::Class info lookup methods -source system]} $class_methods @@ -505,7 +505,7 @@ :create d1 } - ? {lsort [D info lookup slots]} "::D::per-object-slot::a2 ::nx::Class::slot::filter ::nx::Class::slot::mixin ::nx::Class::slot::superclass ::nx::Object::slot::__initblock ::nx::Object::slot::class ::nx::Object::slot::object-filter ::nx::Object::slot::object-mixin ::nx::Object::slot::volatile" + ? {lsort [D info lookup slots]} "::D::per-object-slot::a2 ::nx::Class::slot::filter ::nx::Class::slot::mixin ::nx::Class::slot::superclass ::nx::Object::slot::__initblock ::nx::Object::slot::class ::nx::Object::slot::object-filter ::nx::Object::slot::object-mixin" ? {D info lookup slots superclass} "::nx::Class::slot::superclass" ? {D info lookup slots ::nx::Class::slot::superclass} "::nx::Class::slot::superclass" @@ -520,7 +520,7 @@ ? {C info heritage} "::nx::Object" ? {C info slots -closure -source application} "::C::slot::____C.x ::C::slot::a ::C::slot::b" ? {lsort [C info slots -closure]} \ - "::C::slot::____C.x ::C::slot::a ::C::slot::b ::nx::Object::slot::__initblock ::nx::Object::slot::class ::nx::Object::slot::object-filter ::nx::Object::slot::object-mixin ::nx::Object::slot::volatile" + "::C::slot::____C.x ::C::slot::a ::C::slot::b ::nx::Object::slot::__initblock ::nx::Object::slot::class ::nx::Object::slot::object-filter ::nx::Object::slot::object-mixin" ? {C info slots} "::C::slot::____C.x ::C::slot::a ::C::slot::b" @@ -564,7 +564,7 @@ ? {d1 info precedence} "::D ::C ::nx::Object" ? {lsort [d1 info lookup slots]} \ - "::C::slot::____C.x ::C::slot::a ::D::slot::b ::D::slot::c ::nx::Object::slot::__initblock ::nx::Object::slot::class ::nx::Object::slot::object-filter ::nx::Object::slot::object-mixin ::nx::Object::slot::volatile" + "::C::slot::____C.x ::C::slot::a ::D::slot::b ::D::slot::c ::nx::Object::slot::__initblock ::nx::Object::slot::class ::nx::Object::slot::object-filter ::nx::Object::slot::object-mixin" # Fully qualified name, with metachars @@ -718,23 +718,23 @@ } C new - ? {C info configure syntax} "/::C/ ?-a /value/? ?-b /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ? {C info configure syntax} "/::C/ ?-a /value/? ?-b /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" # ? {C info configure syntax a} "/::C/ ?-a /value/?" - ? {C info configure parameters } "-a {-b 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" + ? {C info configure parameters } "-a {-b 1} -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" -# ? {C info parameter list} "-a -b -volatile -noinit -object-mixin -class -object-filter __initblock" -# ? {C info parameter names} "a b volatile noinit object-mixin class object-filter __initblock" - ? {lsort [C info slots -closure]} "::C::slot::a ::C::slot::b ::nx::Object::slot::__initblock ::nx::Object::slot::class ::nx::Object::slot::object-filter ::nx::Object::slot::object-mixin ::nx::Object::slot::volatile" +# ? {C info parameter list} "-a -b -noinit -object-mixin -class -object-filter __initblock" +# ? {C info parameter names} "a b noinit object-mixin class object-filter __initblock" + ? {lsort [C info slots -closure]} "::C::slot::a ::C::slot::b ::nx::Object::slot::__initblock ::nx::Object::slot::class ::nx::Object::slot::object-filter ::nx::Object::slot::object-mixin" ? {C info configure parameters b} "{-b 1}" ? {D info configure parameters b} "{-b 2}" ? {D info slots -closure b} "::D::slot::b" ? {D info slots -closure a} "::C::slot::a" ? {D info slots -closure class} "::nx::Object::slot::class" -# ? {D info parameter list} "-b -c -a -volatile -noinit -object-mixin -class -object-filter __initblock" -# ? {D info parameter names} "b c a volatile noinit object-mixin class object-filter __initblock" +# ? {D info parameter list} "-b -c -a -noinit -object-mixin -class -object-filter __initblock" +# ? {D info parameter names} "b c a noinit object-mixin class object-filter __initblock" } # Index: tests/info-variable.test =================================================================== diff -u -r4bc60e16c10fdbbb640b3019d4bdebdc469fdf55 -r74b7a4066526ff5f5a8080ed907f71c9ed5c7700 --- tests/info-variable.test (.../info-variable.test) (revision 4bc60e16c10fdbbb640b3019d4bdebdc469fdf55) +++ tests/info-variable.test (.../info-variable.test) (revision 74b7a4066526ff5f5a8080ed907f71c9ed5c7700) @@ -33,15 +33,14 @@ ? {join [Person info configure parameters] \n} \ "-age:integer -name --volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" ? {Person info configure parameters age} "-age:integer" ? {Person info configure parameters {*a[gs]*}} "-age:integer -class:class,alias,method=::nsf::methods::object::class" - ? {Person info configure syntax} "/::Person/ ?-age /integer/? ?-name /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ? {Person info configure syntax} "/::Person/ ?-age /integer/? ?-name /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" ? {Person info method parameters foo} {-force:switch age:integer {name ""}} ? {Person info method parameters foo force} "-force:switch" @@ -51,7 +50,7 @@ ? {Person info parameter syntax -force:switch} "?-force?" ? {Person info parameter name "a b"} "a" - ? {lmap p [Person info configure parameters] {nsf::parameter::get default $p}} "0 0 0 0 0 0 0" + ? {lmap p [Person info configure parameters] {nsf::parameter::get default $p}} "0 0 0 0 0 0" ? {lmap p [Person info method parameters foo] {nsf::parameter::get default $p}} "1 0 1" nx::Class create Bar { @@ -71,11 +70,11 @@ } ? {lmap p [Foo info configure parameters] {nsf::parameter::get name $p}} \ - "i a b p volatile object-mixin class object-filter __initblock" + "i a b p object-mixin class object-filter __initblock" ? {lmap p [Foo info configure parameters] {nsf::parameter::get default $p}} \ - "0 0 1 1 0 0 0 0 0" + "0 0 1 1 0 0 0 0" ? {lmap p [Foo info configure parameters] {nsf::parameter::get type $p}} \ - "{} integer integer {} {} mixinreg class filterreg {}" + "{} integer integer {} mixinreg class filterreg {}" ? {join [lsort [::Foo info slots]] \n} \ "::Foo::slot::____Foo.p @@ -108,8 +107,7 @@ ::nx::Object::slot::__initblock ::nx::Object::slot::class ::nx::Object::slot::object-filter -::nx::Object::slot::object-mixin -::nx::Object::slot::volatile" +::nx::Object::slot::object-mixin" # get the configure value from p and the value of the private property via m ? {f1 cget -p} 9 Index: tests/parameters.test =================================================================== diff -u -r4bc60e16c10fdbbb640b3019d4bdebdc469fdf55 -r74b7a4066526ff5f5a8080ed907f71c9ed5c7700 --- tests/parameters.test (.../parameters.test) (revision 4bc60e16c10fdbbb640b3019d4bdebdc469fdf55) +++ tests/parameters.test (.../parameters.test) (revision 74b7a4066526ff5f5a8080ed907f71c9ed5c7700) @@ -275,7 +275,7 @@ C create c1 ? {C eval :__objectparameter} \ - "{-superclass:class,alias,method=::nsf::methods::class::superclass,1..n ::nx::Object} -mixin:mixinreg,alias,0..n -filter:filterreg,alias,0..n -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" + "{-superclass:class,alias,method=::nsf::methods::class::superclass,1..n ::nx::Object} -mixin:mixinreg,alias,0..n -filter:filterreg,alias,0..n -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" #### TOOD: remove or add #? {c1 eval :__objectparameter} \ @@ -307,7 +307,7 @@ "::D::slot::d ::C::slot::a ::C::slot::b ::C::slot::c" ? {d1 eval :__objectparameter} \ - "-d:required -a -b:boolean {-c 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" + "-d:required -a -b:boolean {-c 1} -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" } ####################################################### @@ -336,29 +336,29 @@ D mixin M ? {d1 eval :__objectparameter} \ - "-b -m1 -m2 -d:required -a {-c 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" \ + "-b -m1 -m2 -d:required -a {-c 1} -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" \ "mixin added" M mixin M2 ? {d1 eval :__objectparameter} \ - "-b2 -b -m1 -m2 -d:required -a {-c 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" \ + "-b2 -b -m1 -m2 -d:required -a {-c 1} -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" \ "transitive mixin added" D mixin "" #we should have again the old interface ? {d1 eval :__objectparameter} \ - "-d:required -a -b:boolean {-c 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" + "-d:required -a -b:boolean {-c 1} -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" C mixin M ? {d1 eval :__objectparameter} \ - "-b2 -b -m1 -m2 -d:required -a {-c 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" \ + "-b2 -b -m1 -m2 -d:required -a {-c 1} -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" \ "mixin added" C mixin "" #we should have again the old interface ? {d1 eval :__objectparameter} \ - "-d:required -a -b:boolean {-c 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" + "-d:required -a -b:boolean {-c 1} -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" } ####################################################### @@ -380,7 +380,7 @@ ? {D create d1} \ {required argument 'd' is missing, should be: - ::d1 __configure -d /value/ ?-a /value/? ?-b /boolean/? ?-c /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ::d1 __configure -d /value/ ?-a /value/? ?-b /boolean/? ?-c /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} ? {D create d2 -d x -b a} \ {expected boolean but got "a" for parameter "-b"} \ @@ -1696,7 +1696,7 @@ set ::_ "" ? {C create c2} \ "required argument 'x' is missing, should be: - ::c2 __configure -x /value/ -y /value/ ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ::c2 __configure -x /value/ -y /value/ ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" # Was the constructor called? Should not. ? {set ::_} "" @@ -1719,11 +1719,11 @@ D property x:required ? {d1 info configure} \ - "-x /value/ ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + "-x /value/ ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" ? {d1 configure} \ "required argument 'x' is missing, should be: - ::d1 configure -x /value/ ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ::d1 configure -x /value/ ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" ? {d1 configure -x 123} "" ? {d1 cget -x} 123 @@ -1901,13 +1901,13 @@ nx::Class create M1 {:property b1:required} nx::Class create M2 {:property b2:required} - ? {c1 eval :__objectparameter} "-a1 -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" + ? {c1 eval :__objectparameter} "-a1 -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" c1 object mixin M1 ? {c1 info precedence} "::M1 ::C ::nx::Object" - ? {c1 eval :__objectparameter} "-b1:required -a1 -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" + ? {c1 eval :__objectparameter} "-b1:required -a1 -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" # # Invalidate the object parameter and expect that the per-class @@ -1925,7 +1925,7 @@ # ? {c1 configure -a1 x} \ "required argument 'b1' is missing, should be: - ::c1 configure -b1 /value/ ?-a1 /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ::c1 configure -b1 /value/ ?-a1 /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" # # The object parameter based on the per-object-mixin must not be @@ -2006,10 +2006,10 @@ ? {c1 info precedence} "::M ::C ::nx::Object" ? {C info slots -closure} \ - "::C::slot::a1 ::nx::Object::slot::volatile ::nx::Object::slot::__initblock ::nx::Object::slot::object-mixin ::nx::Object::slot::class ::nx::Object::slot::object-filter" + "::C::slot::a1 ::nx::Object::slot::__initblock ::nx::Object::slot::object-mixin ::nx::Object::slot::class ::nx::Object::slot::object-filter" ? {c1 eval :__objectparameter} \ - "-a2 -b1:required -a1 -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" + "-a2 -b1:required -a1 -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" # # invalidate object parameter and expect that the per-class mixin @@ -2019,16 +2019,13 @@ ? {c1 __configure -a1 x} \ "required argument 'b1' is missing, should be: - ::c1 __configure ?-a2 /value/? -b1 /value/ ?-a1 /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ::c1 __configure ?-a2 /value/? -b1 /value/ ?-a1 /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" ? {c1 info precedence} "::M ::C ::nx::Object" - ? {C info slots -closure} \ - "::C::slot::a1 ::nx::Object::slot::volatile ::nx::Object::slot::__initblock ::nx::Object::slot::object-mixin ::nx::Object::slot::class ::nx::Object::slot::object-filter" + "::C::slot::a1 ::nx::Object::slot::__initblock ::nx::Object::slot::object-mixin ::nx::Object::slot::class ::nx::Object::slot::object-filter" - - ? {c1 eval :__objectparameter} "-a2 -b1:required -a1 -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" - + ? {c1 eval :__objectparameter} "-a2 -b1:required -a1 -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,0..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,0..n __initblock:cmd,optional,noleadingdash" # should not require b1 ? {C create c2} ::c2 @@ -2321,7 +2318,7 @@ # ? {C info parameter list a} "-a" ? {C info configure parameters a} "{-a a0}" # ? {C info configure syntax a} "?-a /value/?" - ? {C info configure syntax} "/::C/ ?-a /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ? {C info configure syntax} "/::C/ ?-a /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" ? {C info configure parameters v} "" ? {[C info slots v] definition} "::C variable -accessor none v v0" @@ -2330,8 +2327,8 @@ ? {C create c2 -a 10} ::c2 ? {C create c2 -v 10} \ - {invalid non-positional argument '-v', valid are : -a, -volatile, -object-mixin, -class, -object-filter; - should be "::c2 configure ?-a /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?"} + {invalid non-positional argument '-v', valid are : -a, -object-mixin, -class, -object-filter; + should be "::c2 configure ?-a /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?"} # # We expect a setter for "a" but not for "v". @@ -2500,7 +2497,7 @@ # "v" does NOT show up in "info configure parameters" ? {C info configure parameters v} "" -# ? {C info parameter names} "volatile noinit object-mixin class object-filter __initblock" +# ? {C info parameter names} "noinit object-mixin class object-filter __initblock" # "v" does show up in "info slot ..." ? {C info slots} "::C::slot::v" Index: tests/properties.test =================================================================== diff -u -r4bc60e16c10fdbbb640b3019d4bdebdc469fdf55 -r74b7a4066526ff5f5a8080ed907f71c9ed5c7700 --- tests/properties.test (.../properties.test) (revision 4bc60e16c10fdbbb640b3019d4bdebdc469fdf55) +++ tests/properties.test (.../properties.test) (revision 74b7a4066526ff5f5a8080ed907f71c9ed5c7700) @@ -41,7 +41,7 @@ # # just the public properties are accessible via the configure interface # - ? {c1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {c1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} ? {lsort [C info slots]} "::C::slot::____C.d ::C::slot::____C.vd ::C::slot::a ::C::slot::b ::C::slot::c ::C::slot::e ::C::slot::va ::C::slot::vb ::C::slot::vc ::C::slot::ve ::C::slot::vf" @@ -230,7 +230,7 @@ # # The use of "-incremental" implies multivalued # - ? {c1 info configure} { ?-e /value .../? ?-a /value .../? ?-b /value .../? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {c1 info configure} { ?-e /value .../? ?-a /value .../? ?-b /value .../? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} ? {c1 cget -a} a1 ? {c1 cget -b} b1 @@ -405,7 +405,7 @@ # just the public properties are accessible via the configure interface # - ? {o1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {o1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} # # just the public properties are accessible via the cget interface @@ -533,7 +533,7 @@ # # The use of "-incremental" implies multivalued # - ? {o1 info configure} { ?-e /value .../? ?-a /value .../? ?-b /value .../? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {o1 info configure} { ?-e /value .../? ?-a /value .../? ?-b /value .../? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} ? {o1 cget -a} a1 ? {o1 cget -b} b1 @@ -697,12 +697,12 @@ # just the public properties are accessible via the configure interface # - ? {c1 info configure} {?-a /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {c1 info configure} {?-a /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} ? {c1 cget -a} a1 ? {c1 configure -a a2} "" - ? {C info configure} {?-b /value/? ?-superclass /class .../? ?-mixin /mixinreg .../? ?-filter /filterreg .../? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {C info configure} {?-b /value/? ?-superclass /class .../? ?-mixin /mixinreg .../? ?-filter /filterreg .../? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} ? {C cget -b} b1 ? {C configure -b b2} "" @@ -755,6 +755,7 @@ # # just the public properties are accessible via the configure interface # + package require nx::volatile ? {c1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} @@ -815,7 +816,7 @@ # just the public properties are accessible via the configure interface # - ? {o1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {o1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} set e [o1 eval :__objectparameter] Index: tests/volatile.test =================================================================== diff -u -r4bc60e16c10fdbbb640b3019d4bdebdc469fdf55 -r74b7a4066526ff5f5a8080ed907f71c9ed5c7700 --- tests/volatile.test (.../volatile.test) (revision 4bc60e16c10fdbbb640b3019d4bdebdc469fdf55) +++ tests/volatile.test (.../volatile.test) (revision 74b7a4066526ff5f5a8080ed907f71c9ed5c7700) @@ -4,6 +4,9 @@ package prefer latest package req XOTcl 2.0 +package req nx::volatile +::nsf::method::require ::nx::Object volatile + # # Wrapper to call a command in a proc/method #