Index: TODO =================================================================== diff -u -rccb2c99f6fb6f381dfc7e300584ac08e3d2809d3 -rdc9120981daa00d27f8639ea98a71efc2078e0e8 --- TODO (.../TODO) (revision ccb2c99f6fb6f381dfc7e300584ac08e3d2809d3) +++ TODO (.../TODO) (revision dc9120981daa00d27f8639ea98a71efc2078e0e8) @@ -4809,7 +4809,22 @@ - make use of nsf::object::alloc (1 command instead of 1 create + 2 evals) - these changes imprived laading time of blueprint by about 25% for OpenACS+xowiki +- don't rely on the existence of a "trace" method +nsf.c: +- when ::nsf::object::alloc is passed an empty name (2nd argument), + behave like "new" method + +nx: +- allow copy of objects with required arguments +- use ::nsf::object::alloc in "copy" method +- don't depend on method "trace", use directdispatch instead +- remove method "-noinit" (nsf::object::alloc makes it obsolete) +- extend regression test + +serializer: +- restore traces after object-serialize + ======================================================================== TODO: Index: library/nx/nx.tcl =================================================================== diff -u -rccb2c99f6fb6f381dfc7e300584ac08e3d2809d3 -rdc9120981daa00d27f8639ea98a71efc2078e0e8 --- library/nx/nx.tcl (.../nx.tcl) (revision ccb2c99f6fb6f381dfc7e300584ac08e3d2809d3) +++ library/nx/nx.tcl (.../nx.tcl) (revision dc9120981daa00d27f8639ea98a71efc2078e0e8) @@ -1560,8 +1560,8 @@ # # 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::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} { @@ -2325,7 +2325,9 @@ set dest [:getDest $origin] if {[::nsf::object::exists $origin]} { if {$dest eq ""} { - set obj [[$origin info class] new -noinit] + #set obj [[$origin info class] new -noinit] + set obj [::nsf::object::alloc [$origin info class] ""] + #nsf::object::property $obj initialized 1 set dest [set :dest $obj] } else { # @@ -2343,8 +2345,9 @@ # # create an object without calling init # - set obj [[$origin info class] create $dest -noinit] - #set obj [::nsf::object::alloc [$origin info class] $dest] + #set obj [[$origin info class] create $dest -noinit] + set obj [::nsf::object::alloc [$origin info class] $dest] + #nsf::object::property $obj initialized 1 #puts stderr "COPY obj=<$obj>" } } @@ -2415,6 +2418,7 @@ # foreach var [$origin info vars] { set cmds [::nsf::directdispatch $origin -frame object ::trace info variable $var] + #puts stderr "COPY $var <$cmds>" if {$cmds ne ""} { foreach cmd $cmds { lassign $cmd op def @@ -2423,15 +2427,23 @@ if {$domain eq $origin} { set def [concat $dest [lrange $def 1 end]] } - if {[::nsf::object::exists $domain] && [$domain info has type ::nx::Slot]} { + #puts stderr "COPY $var domain $domain [::nsf::object::exists $domain] && [$domain info has type ::nx::Slot]" + #if {[::nsf::object::exists $domain] && [$domain info has type ::nx::Slot]} { # slot traces are handled already by the slot mechanism - continue + #continue + #} + # + # handle the most common cases to replace $origin by $dest in trace command + # + if {[lindex $def 2] eq $origin} { + set def [lreplace $def 2 2 $dest] + } elseif {[lindex $def 0] eq $origin} { + set def [lreplace $def 0 0 $dest] } - $dest trace add variable $var $op $def + ::nsf::directdispatch $dest -frame object ::trace add variable $var $op $def } } } - #puts stderr "=====" } # @@ -2452,6 +2464,7 @@ foreach slot [$origin ::nsf::methods::object::info::slotobjects -type ::nx::Slot] { lappend slots $slot } + #puts stderr "replacing domain and manager from <$origin> to <$dest> in slots <$slots>" foreach oldslot $slots { set container [expr {[$oldslot per-object] ? "per-object-slot" : "slot"}] Index: tests/cget.test =================================================================== diff -u -r45e24b34c85bf0fc3e14db5250550100bd07ff31 -rdc9120981daa00d27f8639ea98a71efc2078e0e8 --- tests/cget.test (.../cget.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) +++ tests/cget.test (.../cget.test) (revision dc9120981daa00d27f8639ea98a71efc2078e0e8) @@ -53,7 +53,7 @@ # # configure without arguments # - ? {p1 info configure} "?-sex /value/? -famnam /value/ ?-age /integer/? ?-friends /value .../? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ? {p1 info configure} "?-sex /value/? -famnam /value/ ?-age /integer/? ?-friends /value .../? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" } # @@ -93,7 +93,7 @@ # # configure without arguments # - ? {p1 info configure} "?-bar1 /value/? ?-bar2 /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ? {p1 info configure} "?-bar1 /value/? ?-bar2 /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" # # test gettin/setting via slots @@ -135,26 +135,26 @@ # class-level lookup # ? {C info lookup configure syntax} \ - "/::C/ configure ?-superclass /class .../? ?-mixin /mixinreg .../? ?-filter /filterreg .../? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + "/::C/ configure ?-superclass /class .../? ?-mixin /mixinreg .../? ?-filter /filterreg .../? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" ? {C cget -superclass} "::nx::Object" ? {C cget -object-mixin} "" ? {C cget -mixin} "" ? {C cget -filter} "" ? {C cget -volatile} 0 - ? {C cget -noinit} "" + #? {C cget -noinit} "" ? {C cget -class} "::nx::Class" # # object-level lookup # ? {c1 info lookup configure syntax} \ - "/::c1/ configure ?-foo /value/? ?-bar /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + "/::c1/ configure ?-foo /value/? ?-bar /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" # # query all properties from base classes # ? {c1 cget -volatile} 0 - ? {c1 cget -noinit} "" + #? {c1 cget -noinit} "" #? {c1 cget -mixin} "" ? {c1 cget -object-mixin} "" ? {c1 cget -class} ::C Index: tests/destroy.test =================================================================== diff -u -r74211c75224617bc0d78cd2a6a2a89d1e4a834d1 -rdc9120981daa00d27f8639ea98a71efc2078e0e8 --- tests/destroy.test (.../destroy.test) (revision 74211c75224617bc0d78cd2a6a2a89d1e4a834d1) +++ tests/destroy.test (.../destroy.test) (revision dc9120981daa00d27f8639ea98a71efc2078e0e8) @@ -157,17 +157,20 @@ rename o [current] puts stderr "AAAA [current] exists [::nsf::object::exists [current]]" :set x 1 - ? "[current] set x" 1 "$::case can still access [current]" + #? "[current] set x" 1 "$::case can still access [current]" + ? "[current] set x" {can't read "x": no such variable} "$::case cannot access [current]" ? {::nsf::object::exists c1} 1 "$::case object still exists in proc" - ? "set ::firstDestroy" 0 "firstDestroy called" - ? "set ::ObjectDestroy" 0 "ObjectDestroy called" + #? "set ::firstDestroy" 0 "firstDestroy called" + #? "set ::ObjectDestroy" 0 "ObjectDestroy called" + ? "set ::firstDestroy" 1 "firstDestroy called" + ? "set ::ObjectDestroy" 1 "ObjectDestroy called" } C create c1 c1 foo ? {::nsf::object::exists c1} 1 "$::case object still exists after proc" -? "set ::firstDestroy" 0 "firstDestroy called" -? "set ::ObjectDestroy" 0 "ObjectDestroy called" +? "set ::firstDestroy" 1 "firstDestroy called" +? "set ::ObjectDestroy" 1 "ObjectDestroy called" # # cmd rename other proc to current object, Index: tests/info-method.test =================================================================== diff -u -r7c2e28b93b02c29f19dc1f58642c5a29a894d24e -rdc9120981daa00d27f8639ea98a71efc2078e0e8 --- tests/info-method.test (.../info-method.test) (revision 7c2e28b93b02c29f19dc1f58642c5a29a894d24e) +++ tests/info-method.test (.../info-method.test) (revision dc9120981daa00d27f8639ea98a71efc2078e0e8) @@ -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::noinit ::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 ::nx::Object::slot::volatile" ? {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::noinit ::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 ::nx::Object::slot::volatile" ? {C info slots} "::C::slot::____C.x ::C::slot::a ::C::slot::b" @@ -535,7 +535,7 @@ ? {C info slots -closure object-mixin} "::nx::Object::slot::object-mixin" # Partial name with metachars ? {C info slots -closure *in*} \ - "::nx::Object::slot::__initblock ::nx::Object::slot::noinit ::nx::Object::slot::object-mixin" + "::nx::Object::slot::__initblock ::nx::Object::slot::object-mixin" # Fully qualified name, no metachars ? {C info slots -closure ::nx::Object::slot::object-mixin} "::nx::Object::slot::object-mixin" # Fully qualified name, with metachars @@ -550,7 +550,7 @@ ? {c1 info lookup slots object-mixin} "::nx::Object::slot::object-mixin" # Partial name with metachars ? {c1 info lookup slots *in*} \ - "::nx::Object::slot::__initblock ::nx::Object::slot::noinit ::nx::Object::slot::object-mixin" + "::nx::Object::slot::__initblock ::nx::Object::slot::object-mixin" # Fully qualified name, no metachars ? {c1 info lookup slots ::nx::Object::slot::object-mixin} "::nx::Object::slot::object-mixin" # Fully qualified name, with metachars @@ -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::noinit ::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 ::nx::Object::slot::volatile" # Fully qualified name, with metachars @@ -718,14 +718,14 @@ } C new - ? {C info configure syntax} "/::C/ ?-a /value/? ?-b /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ? {C info configure syntax} "/::C/ ?-a /value/? ?-b /value/? ?-volatile? ?-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 -noinit:alias,method=::nsf::methods::object::noinit,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} -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 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::noinit ::nx::Object::slot::object-filter ::nx::Object::slot::object-mixin ::nx::Object::slot::volatile" + ? {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 configure parameters b} "{-b 1}" ? {D info configure parameters b} "{-b 2}" @@ -1228,4 +1228,4 @@ # nx::test case error-in-ensemble { ? {nx::Object info method definition foo 1} {wrong # args: should be "definition name"} -} \ No newline at end of file +} Index: tests/info-variable.test =================================================================== diff -u -r45e24b34c85bf0fc3e14db5250550100bd07ff31 -rdc9120981daa00d27f8639ea98a71efc2078e0e8 --- tests/info-variable.test (.../info-variable.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) +++ tests/info-variable.test (.../info-variable.test) (revision dc9120981daa00d27f8639ea98a71efc2078e0e8) @@ -34,15 +34,14 @@ "-age:integer -name -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg --noinit:alias,method=::nsf::methods::object::noinit,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? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ? {Person info configure syntax} "/::Person/ ?-age /integer/? ?-name /value/? ?-volatile? ?-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" @@ -52,7 +51,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 0" + ? {lmap p [Person info configure parameters] {nsf::parameter::get default $p}} "0 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 { @@ -72,11 +71,11 @@ } ? {lmap p [Foo info configure parameters] {nsf::parameter::get name $p}} \ - "i a b p volatile noinit object-mixin class object-filter __initblock" + "i a b p volatile 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 0 1 1 0 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,7 +107,6 @@ ::Foo::slot::q ::nx::Object::slot::__initblock ::nx::Object::slot::class -::nx::Object::slot::noinit ::nx::Object::slot::object-filter ::nx::Object::slot::object-mixin ::nx::Object::slot::volatile" Index: tests/parameters.test =================================================================== diff -u -r7c2e28b93b02c29f19dc1f58642c5a29a894d24e -rdc9120981daa00d27f8639ea98a71efc2078e0e8 --- tests/parameters.test (.../parameters.test) (revision 7c2e28b93b02c29f19dc1f58642c5a29a894d24e) +++ tests/parameters.test (.../parameters.test) (revision dc9120981daa00d27f8639ea98a71efc2078e0e8) @@ -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 -noinit:alias,method=::nsf::methods::object::noinit,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 -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" #### 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 -noinit:alias,method=::nsf::methods::object::noinit,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} -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" } ####################################################### @@ -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 -noinit:alias,method=::nsf::methods::object::noinit,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} -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" \ "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 -noinit:alias,method=::nsf::methods::object::noinit,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} -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" \ "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 -noinit:alias,method=::nsf::methods::object::noinit,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} -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 mixin M ? {d1 eval :__objectparameter} \ - "-b2 -b -m1 -m2 -d:required -a {-c 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,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} -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" \ "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 -noinit:alias,method=::nsf::methods::object::noinit,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} -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" } ####################################################### @@ -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? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ::d1 __configure -d /value/ ?-a /value/? ?-b /boolean/? ?-c /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} ? {D create d2 -d x -b a} \ {expected boolean but got "a" for parameter "-b"} \ @@ -1298,6 +1298,16 @@ ? {f1 metaclassarg ::Foo} {expected metaclass but got "::Foo" for parameter "x"} } +nx::test case copy-with-required { + nx::Class create C { + :property n:required + } + C create c1 -n 1 + + ? {c1 copy c2} "::c2" +} + + nx::test case slot-traces { ::nx::Object create o { :object property -accessor public a {set :defaultcmd { set _ 4 } } @@ -1686,7 +1696,7 @@ set ::_ "" ? {C create c2} \ "required argument 'x' is missing, should be: - ::c2 __configure -x /value/ -y /value/ ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ::c2 __configure -x /value/ -y /value/ ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" # Was the constructor called? Should not. ? {set ::_} "" @@ -1709,11 +1719,11 @@ D property x:required ? {d1 info configure} \ - "-x /value/ ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + "-x /value/ ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" ? {d1 configure} \ "required argument 'x' is missing, should be: - ::d1 configure -x /value/ ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ::d1 configure -x /value/ ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" ? {d1 configure -x 123} "" ? {d1 cget -x} 123 @@ -1891,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 -noinit:alias,method=::nsf::methods::object::noinit,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 -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 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 -noinit:alias,method=::nsf::methods::object::noinit,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 -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" # # Invalidate the object parameter and expect that the per-class @@ -1915,7 +1925,7 @@ # ? {c1 configure -a1 x} \ "required argument 'b1' is missing, should be: - ::c1 configure -b1 /value/ ?-a1 /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ::c1 configure -b1 /value/ ?-a1 /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" # # The object parameter based on the per-object-mixin must not be @@ -1996,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::noinit ::nx::Object::slot::object-mixin ::nx::Object::slot::class ::nx::Object::slot::object-filter" + "::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" ? {c1 eval :__objectparameter} \ - "-a2 -b1:required -a1 -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,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 -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" # # invalidate object parameter and expect that the per-class mixin @@ -2009,15 +2019,15 @@ ? {c1 __configure -a1 x} \ "required argument 'b1' is missing, should be: - ::c1 __configure ?-a2 /value/? -b1 /value/ ?-a1 /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ::c1 __configure ?-a2 /value/? -b1 /value/ ?-a1 /value/? ?-volatile? ?-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::noinit ::nx::Object::slot::object-mixin ::nx::Object::slot::class ::nx::Object::slot::object-filter" + "::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" - ? {c1 eval :__objectparameter} "-a2 -b1:required -a1 -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,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 -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" # should not require b1 ? {C create c2} ::c2 @@ -2311,7 +2321,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? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?" + ? {C info configure syntax} "/::C/ ?-a /value/? ?-volatile? ?-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" @@ -2320,8 +2330,8 @@ ? {C create c2 -a 10} ::c2 ? {C create c2 -v 10} \ - {invalid non-positional argument '-v', valid are : -a, -volatile, -noinit, -object-mixin, -class, -object-filter; - should be "::c2 configure ?-a /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?"} + {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/?"} # # We expect a setter for "a" but not for "v". Index: tests/properties.test =================================================================== diff -u -r45e24b34c85bf0fc3e14db5250550100bd07ff31 -rdc9120981daa00d27f8639ea98a71efc2078e0e8 --- tests/properties.test (.../properties.test) (revision 45e24b34c85bf0fc3e14db5250550100bd07ff31) +++ tests/properties.test (.../properties.test) (revision dc9120981daa00d27f8639ea98a71efc2078e0e8) @@ -41,7 +41,7 @@ # # just the public properties are accessible via the configure interface # - ? {c1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {c1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-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? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {c1 info configure} { ?-e /value .../? ?-a /value .../? ?-b /value .../? ?-volatile? ?-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? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {o1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-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? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {o1 info configure} { ?-e /value .../? ?-a /value .../? ?-b /value .../? ?-volatile? ?-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? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {c1 info configure} {?-a /value/? ?-volatile? ?-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? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {C info configure} {?-b /value/? ?-superclass /class .../? ?-mixin /mixinreg .../? ?-filter /filterreg .../? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} ? {C cget -b} b1 ? {C configure -b b2} "" @@ -756,7 +756,7 @@ # just the public properties are accessible via the configure interface # - ? {c1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {c1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} set e [C eval :__objectparameter] ? {C eval :__objectparameter} $e @@ -775,7 +775,7 @@ # # check influence of class-level per-object properties # - ? {d1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {d1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} set e [D eval :__objectparameter] ? {D eval :__objectparameter} $e @@ -815,7 +815,7 @@ # just the public properties are accessible via the configure interface # - ? {o1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} + ? {o1 info configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initblock/?} set e [o1 eval :__objectparameter]