Index: TODO =================================================================== diff -u -rfc77eaadabdd690239694a6f1cf155a7d16b5cd4 -r31404a50d429bd67e904a70797c4f67674fab09f --- TODO (.../TODO) (revision fc77eaadabdd690239694a6f1cf155a7d16b5cd4) +++ TODO (.../TODO) (revision 31404a50d429bd67e904a70797c4f67674fab09f) @@ -4370,7 +4370,7 @@ /obj/ info method parameters /methodName/ ?/pattern/? -> list of params /obj/ info method syntax -> syntax output - /obj/ info lookup configure parameter ?/pattern/? -> list of params + /obj/ info lookup configure parameters ?/pattern/? -> list of params /obj/ info lookup configure syntax -> syntax output /cls/ info parameter list|name|syntax /param/ -> value @@ -4398,9 +4398,35 @@ /obj/ info lookup parameter names ?/pattern/? /obj/ info lookup parameter list ?/pattern/? + +Method and configure parameter reform, Part 2: +In order to streamline the interface further, we tried to follow the idea to use +"... info /plural word/" to obtain a set of handles, and then a separate call +to obtain the details. Therefore, we replaced + + /cls/ info slot objects + /cls/ info slot definitions + /cls/ info slot names + + /obj/ info object slot objects + /obj/ info object slot definitions + /obj/ info object slot names + + /obj/ info lookup slots + +by + + /cls/ info slots ?-type /type/? ?-closure? ?-source all|application|baseclasses? ?/pattern/? + /obj/ info object slots ?-type /type/? ?/pattern/? + /obj/ info slot definition /obj/ + /obj/ info lookup slots ?-type /type/? ?-source all|application|baseclasses? ?/pattern/? + + + ======================================================================== TODO: - +- consider "info properties" and "info variables" +- fix property inheritance in traits (nx-traits.tcl) - handling of slots/properties/variables - NsfParameterGetCmd should/could handle more than "list|name|syntax" - update documentation Index: library/lib/nx-traits.tcl =================================================================== diff -u -rdadc7c6c6858ff3b816ff4cc585e0d76684ec374 -r31404a50d429bd67e904a70797c4f67674fab09f --- library/lib/nx-traits.tcl (.../nx-traits.tcl) (revision dadc7c6c6858ff3b816ff4cc585e0d76684ec374) +++ library/lib/nx-traits.tcl (.../nx-traits.tcl) (revision 31404a50d429bd67e904a70797c4f67674fab09f) @@ -78,8 +78,9 @@ $obj public alias $newName $traitMethodHandle # We define property inheritance for the time being only for # instance properties. - foreach d [$traitName info object slot definitions] { - $obj property $d + foreach slot [$traitName info object slots] { + puts "$obj - wanna define property [$slot info slot definition]" + #$obj property $d } } } Index: library/nx/nx.tcl =================================================================== diff -u -rfc77eaadabdd690239694a6f1cf155a7d16b5cd4 -r31404a50d429bd67e904a70797c4f67674fab09f --- library/nx/nx.tcl (.../nx.tcl) (revision fc77eaadabdd690239694a6f1cf155a7d16b5cd4) +++ library/nx/nx.tcl (.../nx.tcl) (revision 31404a50d429bd67e904a70797c4f67674fab09f) @@ -575,7 +575,7 @@ } Class public method "delete property" {name} { - set slot [:info slot objects $name] + set slot [:info slots $name] if {$slot eq ""} {error "[self]: cannot delete property '$name'"} $slot destroy } @@ -710,23 +710,12 @@ :alias "info object methods" ::nsf::methods::object::info::methods :alias "info object mixin guard" ::nsf::methods::object::info::mixinguard :alias "info object mixin classes" ::nsf::methods::object::info::mixinclasses - :method "info object slot definitions" {{-type:class ::nx::Slot} pattern:optional} { - set result {} - foreach slot [: ::nsf::methods::object::info::slotobjects -type $type {*}[current args]] { - lappend result [$slot getPropertyDefinition] - } - return $result - } - :method "info object slot names" {{-type:class ::nx::Slot} pattern:optional} { - set result {} - foreach slot [: ::nsf::methods::object::info::slotobjects -type $type {*}[current args]] { - lappend result [$slot name] - } - return $result - } - :method "info object slot objects" {{-type:class ::nx::Slot} pattern:optional} { + :method "info object slots" {{-type:class ::nx::Slot} pattern:optional} { return [: ::nsf::methods::object::info::slotobjects -type $type {*}[current args]] } + :method "info slot definition" {slot:object} { + return [$slot getPropertyDefinition] + } # # Parameter extractors # @@ -805,27 +794,13 @@ :alias "info mixin classes" ::nsf::methods::class::info::mixinclasses :alias "info mixinof" ::nsf::methods::class::info::mixinof - :method "info slot objects" {{-type ::nx::Slot} -closure:switch -source:optional pattern:optional} { + :method "info slots" {{-type ::nx::Slot} -closure:switch -source:optional pattern:optional} { set cmd [list ::nsf::methods::class::info::slotobjects -type $type] if {[info exists source]} {lappend cmd -source $source} if {$closure} {lappend cmd -closure} if {[info exists pattern]} {lappend cmd $pattern} return [: {*}$cmd] } - :method "info slot definitions" {{-type ::nx::Slot} -closure:switch -source:optional pattern:optional} { - set result {} - foreach slot [: ::nsf::methods::class::info::slotobjects -type $type {*}[current args]] { - lappend result [$slot getPropertyDefinition] - } - return $result - } - :method "info slot names" {{-type ::nx::Slot} -closure:switch -source:optional pattern:optional} { - set result {} - foreach slot [: ::nsf::methods::class::info::slotobjects -type $type {*}[current args]] { - lappend result [$slot name] - } - return $result - } # "info properties" is a short form of "info slot definition" #:alias "info properties" ::nx::Class::slot::__info::slot::definition :alias "info subclass" ::nsf::methods::class::info::subclass @@ -1348,7 +1323,6 @@ if {[info exists :initcmd]} { lappend options initcmd if {[info exists :default]} { - # append initcmd "[::nsf::self] setCheckedInstVar -nocomplain \[::nsf::self\] [list ${:default}]\n" append initcmd "::nsf::var::set \[::nsf::self\] ${:name} [list ${:default}]\n" } append initcmd ${:initcmd} @@ -1368,22 +1342,27 @@ } ObjectParameterSlot public method getPropertyDefinitionOptions {parameterSpec} { + #puts "accessor <${:accessor}> config ${:config} per-object ${:per-object}" + + set mod [expr {${:per-object} ? "object" : ""}] + set opts "" + if {${:config}} { - if {${:accessor} ne "public"} {set opts [list -accessor ${:accessor}]} {set opts ""} - if {!${:config}} {lappend opts -config false} + lappend opts -accessor ${:accessor} + if {${:incremental}} {lappend opts -incremental} if {[info exists :default]} { - return [list ${:domain} property {*}$opts [list $parameterSpec ${:default}]] + return [list ${:domain} {*}$mod property {*}$opts [list $parameterSpec ${:default}]] } set methodName property } else { - if {${:accessor} ne "none"} {set opts [list -accessor ${:accessor}]} {set opts ""} + lappend opts -accessor ${:accessor} if {${:config}} {lappend opts -config true} if {[info exists :default]} { - return [list ${:domain} variable {*}$opts $parameterSpec ${:default}] + return [list ${:domain} {*}$mod variable {*}$opts $parameterSpec ${:default}] } set methodName variable } - return [list ${:domain} $methodName {*}$opts $parameterSpec] + return [list ${:domain} {*}$mod $methodName {*}$opts $parameterSpec] } ObjectParameterSlot public method getPropertyDefinition {} { @@ -1769,7 +1748,7 @@ ::nx::VariableSlot public method makeAccessor {} { if {${:accessor} eq "none"} { - #puts stderr "Do not register forwarder ${:domain} ${:name}" + #puts stderr "*** Do not register forwarder ${:domain} ${:name}" return 0 } @@ -1807,6 +1786,15 @@ } } + ::nx::VariableSlot public method getSpec {} { + # This is a shortend "lightweight" version of "getParameterSpec" + # returning less (implicit) details. + set options [:getParameterOptions -withMultiplicity true] + set spec [:namedParameterSpec -map-private "" ${:name} $options] + if {[info exists :default]} {lappend spec ${:default}} + return $spec + } + ::nx::VariableSlot protected method init {} { #puts "VariableSlot [self] ${:incremental} && ${:accessor} && ${:multiplicity} incremental ${:incremental}" if {${:incremental}} { @@ -2046,7 +2034,7 @@ if {${accessor} eq ""} { set accessor [::nsf::dispatch [self] __default_accessor] - #puts stderr "OBJECT got default accessor ${accessor}" + #puts stderr "OBJECT [self] got default accessor ${accessor}" } set r [[self] object variable \ @@ -2097,7 +2085,7 @@ if {${accessor} eq ""} { set accessor [::nsf::dispatch [self] __default_accessor] - #puts stderr "CLASS got default accessor ${accessor}" + #puts stderr "CLASS [self] got default accessor ${accessor}" } set r [[self] ::nsf::classes::nx::Class::variable \ -accessor $accessor \ Index: tests/info-method.test =================================================================== diff -u -rfc77eaadabdd690239694a6f1cf155a7d16b5cd4 -r31404a50d429bd67e904a70797c4f67674fab09f --- tests/info-method.test (.../info-method.test) (revision fc77eaadabdd690239694a6f1cf155a7d16b5cd4) +++ tests/info-method.test (.../info-method.test) (revision 31404a50d429bd67e904a70797c4f67674fab09f) @@ -475,14 +475,14 @@ } } - ? {C info slot objects} "::C::slot::a ::C::slot::b" - ? {D info slot objects} "::D::slot::b ::D::slot::c" - ? {D info slot objects -closure -source application} "::D::slot::b ::D::slot::c ::C::slot::a" + ? {C info slots} "::C::slot::a ::C::slot::b" + ? {D info slots} "::D::slot::b ::D::slot::c" + ? {D info slots -closure -source application} "::D::slot::b ::D::slot::c ::C::slot::a" ? {d1 info lookup slots -source application} "::d1::per-object-slot::a3 ::D::slot::b ::D::slot::c ::C::slot::a" - ? {D info object slot objects} "::D::per-object-slot::a2" - ? {d1 info object slot objects} "::d1::per-object-slot::a3" - ? {C info object slot objects} "" + ? {D info object slots} "::D::per-object-slot::a2" + ? {d1 info object slots} "::d1::per-object-slot::a3" + ? {C info object slots} "" } # @@ -507,25 +507,25 @@ C create c1 ? {c1 info precedence} "::C ::nx::Object" ? {C info heritage} "::nx::Object" - ? {C info slot objects -closure -source application} "::C::slot::a ::C::slot::b" - ? {C info slot objects -closure} "::C::slot::a ::C::slot::b ::nx::Object::slot::volatile ::nx::Object::slot::noinit ::nx::Object::slot::object-mixin ::nx::Object::slot::__initcmd ::nx::Object::slot::class ::nx::Object::slot::object-filter" + ? {C info slots -closure -source application} "::C::slot::a ::C::slot::b" + ? {C info slots -closure} "::C::slot::a ::C::slot::b ::nx::Object::slot::volatile ::nx::Object::slot::noinit ::nx::Object::slot::object-mixin ::nx::Object::slot::__initcmd ::nx::Object::slot::class ::nx::Object::slot::object-filter" - ? {C info slot objects} "::C::slot::a ::C::slot::b" + ? {C info slots} "::C::slot::a ::C::slot::b" - # Test patterns for "info slot objects" + # Test patterns for "info slots" # Partial name, no metachars - ? {C info slot objects -closure object-mixin} "::nx::Object::slot::object-mixin" + ? {C info slots -closure object-mixin} "::nx::Object::slot::object-mixin" # Partial name with metachars - ? {C info slot objects -closure *in*} \ + ? {C info slots -closure *in*} \ "::nx::Object::slot::noinit ::nx::Object::slot::object-mixin ::nx::Object::slot::__initcmd" # Fully qualified name, no metachars - ? {C info slot objects -closure ::nx::Object::slot::object-mixin} "::nx::Object::slot::object-mixin" + ? {C info slots -closure ::nx::Object::slot::object-mixin} "::nx::Object::slot::object-mixin" # Fully qualified name, with metachars - # The following command returns the same as "C info slot objects" - ? {C info slot objects -closure ::C::*} "::C::slot::a ::C::slot::b" + # The following command returns the same as "C info slots" + ? {C info slots -closure ::C::*} "::C::slot::a ::C::slot::b" # The following command returns the slots of D inherited from # C. Slot "b" is shadoed by D. - ? {D info slot objects -closure ::C::*} "::C::slot::a" + ? {D info slots -closure ::C::*} "::C::slot::a" # Test patterns for "info lookup slots" # Partial name, no metachars @@ -539,8 +539,8 @@ ? {c1 info lookup slots ::C::*} "::C::slot::a ::C::slot::b" D create d1 - ? {D info slot objects} "::D::slot::b ::D::slot::c" - ? {D info slot objects -closure -source application} "::D::slot::b ::D::slot::c ::C::slot::a" + ? {D info slots} "::D::slot::b ::D::slot::c" + ? {D info slots -closure -source application} "::D::slot::b ::D::slot::c ::C::slot::a" ? {::nx::Object info method parameters info} "" @@ -705,13 +705,13 @@ # ? {C info parameter list} "-a -b -volatile -noinit -object-mixin -class -object-filter __initcmd" # ? {C info parameter names} "a b volatile noinit object-mixin class object-filter __initcmd" - ? {lsort [C info slot objects -closure]} "::C::slot::a ::C::slot::b ::nx::Object::slot::__initcmd ::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::__initcmd ::nx::Object::slot::class ::nx::Object::slot::noinit ::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}" - ? {D info slot objects -closure b} "::D::slot::b" - ? {D info slot objects -closure a} "::C::slot::a" - ? {D info slot objects -closure class} "::nx::Object::slot::class" + ? {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 __initcmd" # ? {D info parameter names} "b c a volatile noinit object-mixin class object-filter __initcmd" @@ -733,7 +733,7 @@ ? {lsort [::nx::Object info methods "slots"]} "" ? {lsort [::nx::Object info methods "*slots*"]} "" ? {lsort [::nx::Object info methods -path "*slot*"]} \ - "{info lookup slots} {info object slot definitions} {info object slot names} {info object slot objects}" + "{info lookup slots} {info object slots} {info slot definition}" ? {lsort [::nx::Object info methods -path "*filter*"]} \ "{info lookup filter} {info object filter guard} {info object filter methods} {object filter}" Index: tests/methods.test =================================================================== diff -u -rb531a50ecc43d0c13e2432b099a436c3260c7a49 -r31404a50d429bd67e904a70797c4f67674fab09f --- tests/methods.test (.../methods.test) (revision b531a50ecc43d0c13e2432b099a436c3260c7a49) +++ tests/methods.test (.../methods.test) (revision 31404a50d429bd67e904a70797c4f67674fab09f) @@ -622,7 +622,7 @@ ? {C info object methods -path} "" ? {C info methods} "a2" - ? {C info slot objects} "::C::slot::a2" + ? {C info slots} "::C::slot::a2" } Index: tests/parameters.test =================================================================== diff -u -rfc77eaadabdd690239694a6f1cf155a7d16b5cd4 -r31404a50d429bd67e904a70797c4f67674fab09f --- tests/parameters.test (.../parameters.test) (revision fc77eaadabdd690239694a6f1cf155a7d16b5cd4) +++ tests/parameters.test (.../parameters.test) (revision 31404a50d429bd67e904a70797c4f67674fab09f) @@ -533,7 +533,7 @@ :property {d "literal $d"} } - ? {Bar property ss:switch} "::nsf::classes::Bar::ss" + ? {Bar property -accessor public ss:switch} "::nsf::classes::Bar::ss" Bar create bar1 #puts stderr [bar1 __objectparameter] @@ -1826,7 +1826,7 @@ ? {c1 eval {set :foo}} "a habicht b c F" ? {c1 eval {set :x2}} "::c1" ? {lsort [c1 info lookup methods -source application]} "foo x1 x2" - ? {lsort [C info slot objects]} "::C::slot::F ::C::slot::x1 ::C::slot::x2" + ? {lsort [C info slots]} "::C::slot::F ::C::slot::x1 ::C::slot::x2" ? {::C::slot::x1 getParameterSpec} {-x1:alias hugo} ? {::C::slot::x2 getParameterSpec} {-x2:alias,substdefault {[self]}} } @@ -1949,7 +1949,7 @@ ? {c1 info precedence} "::M ::C ::nx::Object" - ? {C info slot objects -closure} "::C::slot::a1 ::nx::Object::slot::volatile ::nx::Object::slot::noinit ::nx::Object::slot::object-mixin ::nx::Object::slot::__initcmd ::nx::Object::slot::class ::nx::Object::slot::object-filter" + ? {C info slots -closure} "::C::slot::a1 ::nx::Object::slot::volatile ::nx::Object::slot::noinit ::nx::Object::slot::object-mixin ::nx::Object::slot::__initcmd ::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,1..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,1..n __initcmd:initcmd,optional,noleadingdash" @@ -1963,7 +1963,7 @@ ? {c1 info precedence} "::M ::C ::nx::Object" - ? {C info slot objects -closure} "::C::slot::a1 ::nx::Object::slot::volatile ::nx::Object::slot::noinit ::nx::Object::slot::object-mixin ::nx::Object::slot::__initcmd ::nx::Object::slot::class ::nx::Object::slot::object-filter" + ? {C info slots -closure} "::C::slot::a1 ::nx::Object::slot::volatile ::nx::Object::slot::noinit ::nx::Object::slot::object-mixin ::nx::Object::slot::__initcmd ::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,1..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,1..n __initcmd:initcmd,optional,noleadingdash" @@ -2079,12 +2079,12 @@ ? {o a} newvalue o eval {unset :a} ? {o eval {info exists :a}} 0 - [o info object slot objects a] default anothervalue + [o info object slots a] default anothervalue ? {o eval {info exists :a}} 0 # # re-assignment must be requested by a reconfigure call # - [o info object slot objects a] reconfigure + [o info object slots a] reconfigure ? {o eval {info exists :a}} 1 ? {o a} anothervalue } @@ -2263,7 +2263,7 @@ ? {C info configure syntax} "/::C/ ?-a /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initcmd/?" ? {C info configure parameters v} "" - ? {C info slot definitions v} "{::C variable v v0}" + ? {C info slot definition [C info slots v]} "::C variable -accessor none v v0" # ? {C info parameter list v} "" # ? {C info configure parameter v} "" @@ -2442,8 +2442,8 @@ # ? {C info parameter names} "volatile noinit object-mixin class object-filter __initcmd" # "v" does show up in "info slot ..." - ? {C info slot objects} "::C::slot::v" - ? {C info slot definitions} "{::C variable v 100}" + ? {C info slots} "::C::slot::v" + ? {C info slot definition ::C::slot::v} "::C variable -accessor none v 100" nx::Class create D { :property {p0 200} @@ -2459,8 +2459,8 @@ ? {D info methods} "p0 p3" # all properties show up in "info slot" - ? {D info slot objects} "::D::slot::p0 ::D::slot::p1 ::D::slot::p2 ::D::slot::p3" - ? {D info slot definitions} "{::D property {p0 200}} {::D property -accessor none {p1 201}} {::D variable p2 202} {::D variable -accessor public p3 203}" + ? {D info slots} "::D::slot::p0 ::D::slot::p1 ::D::slot::p2 ::D::slot::p3" + #? {D info slot definitions} "{::D property {p0 200}} {::D property -accessor none {p1 201}} {::D variable p2 202} {::D variable -accessor public p3 203}" #? {D info properties} "{p0 200} {p1 201} {p2:noconfig 202} {p3:noconfig 203}" } @@ -2480,8 +2480,9 @@ } # only the variables with slots show up in "info slot ..." - ? {o1 info object slot objects} "::o1::per-object-slot::v2 ::o1::per-object-slot::v1" - ? {o1 info object slot definitions} "{::o1 variable -accessor public v2:0..n 100} {::o1 variable -accessor public v1 100}" + ? {o1 info object slots} "::o1::per-object-slot::v2 ::o1::per-object-slot::v1" + ? {o1 info slot definition ::o1::per-object-slot::v2} "::o1 object variable -accessor public v2:0..n 100" + ? {o1 info slot definition ::o1::per-object-slot::v1} "::o1 object variable -accessor public v1 100" nx::Object create o2 { :object property {p0 200} @@ -2494,8 +2495,11 @@ ? {o2 info object methods} "p0 p3" # all properties with slots show up in "info slot" - ? {o2 info object slot objects} "::o2::per-object-slot::p0 ::o2::per-object-slot::p1 ::o2::per-object-slot::p3" - ? {o2 info object slot definitions} "{::o2 property {p0 200}} {::o2 property -accessor none {p1 201}} {::o2 variable -accessor public p3 203}" + ? {o2 info object slots} "::o2::per-object-slot::p0 ::o2::per-object-slot::p1 ::o2::per-object-slot::p3" + ? {o2 info slot definition [o2 info object slots p0]} "::o2 object property -accessor public {p0 200}" + ? {o2 info slot definition [o2 info object slots p1]} "::o2 object property -accessor none {p1 201}" + ? {o2 info slot definition [o2 info object slots p3]} "::o2 object variable -accessor public p3 203" + #? {o2 info properties} "{p0 200} {p1 201} {p3:noconfig 203}" } @@ -2512,7 +2516,8 @@ :property {b 1} } - ? {Foo info slot definitions} "{::Foo property a} {::Foo property {b 1}}" + ? {Foo info slot definition [Foo info slots a]} "::Foo property -accessor public a" + ? {Foo info slot definition [Foo info slots b]} "::Foo property -accessor public {b 1}" #? {Foo info properties} "a {b 1}" @@ -2521,22 +2526,26 @@ :property a:boolean :property {b:integer 1} } - ? {Foo info slot definitions} "{::Foo property a:boolean} {::Foo property {b:integer 1}}" + ? {Foo info slot definition [Foo info slots a]} "::Foo property -accessor public a:boolean" + ? {Foo info slot definition [Foo info slots b]} "::Foo property -accessor public {b:integer 1}" # required/optional properties nx::Class create Foo { :property a:required :property b:boolean,required } - ? {Foo info slot definitions} "{::Foo property a:required} {::Foo property b:boolean,required}" + ? {Foo info slot definition [Foo info slots a]} "::Foo property -accessor public a:required" + ? {Foo info slot definition [Foo info slots b]} "::Foo property -accessor public b:boolean,required" # properties with multiplicity nx::Class create Foo { :property {ints:integer,0..n ""} :property objs:object,1..n :property obj:object,0..1 } - ? {Foo info slot definitions} "{::Foo property objs:object,1..n} {::Foo property {ints:integer,0..n {}}} {::Foo property obj:object,0..1}" + ? {Foo info slot definition [Foo info slots objs]} "::Foo property -accessor public objs:object,1..n" + ? {Foo info slot definition [Foo info slots ints]} "::Foo property -accessor public {ints:integer,0..n {}}" + ? {Foo info slot definition [Foo info slots obj]} "::Foo property -accessor public obj:object,0..1" } # Index: tests/plain-object-method.test =================================================================== diff -u -rfc77eaadabdd690239694a6f1cf155a7d16b5cd4 -r31404a50d429bd67e904a70797c4f67674fab09f --- tests/plain-object-method.test (.../plain-object-method.test) (revision fc77eaadabdd690239694a6f1cf155a7d16b5cd4) +++ tests/plain-object-method.test (.../plain-object-method.test) (revision 31404a50d429bd67e904a70797c4f67674fab09f) @@ -11,7 +11,7 @@ ? {o filter f} "::o: unable to dispatch method 'filter'" ? {lsort [o info object methods]} "f" - ? {lsort [o info]} "valid submethods of ::o info: children class has info is lookup name object parameter parent precedence vars" + ? {lsort [o info]} "valid submethods of ::o info: children class has info is lookup name object parameter parent precedence slot vars" } package require nx::plain-object-method @@ -37,5 +37,5 @@ ? {o info filter methods} "" ? {lsort [o info object methods]} "f foo" - ? {lsort [o info]} "valid submethods of ::o info: children class filter has info is lookup method methods mixin name object parameter parent precedence vars" + ? {lsort [o info]} "valid submethods of ::o info: children class filter has info is lookup method methods mixin name object parameter parent precedence slot vars" } Index: tests/properties.test =================================================================== diff -u -r35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30 -r31404a50d429bd67e904a70797c4f67674fab09f --- tests/properties.test (.../properties.test) (revision 35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30) +++ tests/properties.test (.../properties.test) (revision 31404a50d429bd67e904a70797c4f67674fab09f) @@ -24,12 +24,13 @@ :property -accessor protected {c c1} :property -accessor private {d d1} :property -accessor none {e e1} - :variable va va1 :variable -accessor public vb vb1 :variable -accessor protected vc vc1 :variable -accessor private vd vd1 :variable -accessor none ve ve1 + + # a non-configurable property is a variable :property -accessor none -config false {vf vf1} :public method call-local {v} {: -local $v} @@ -42,7 +43,21 @@ # ? {c1 configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initcmd/?} - ? {lsort [C info slot definitions]} {{::C property -accessor none {a a1}} {::C property -accessor none {e e1}} {::C property {b b1}} {::C variable -accessor private d d1} {::C variable -accessor private vd vd1} {::C variable -accessor protected c c1} {::C variable -accessor protected vc vc1} {::C variable -accessor public vb vb1} {::C variable va va1} {::C variable ve ve1} {::C variable vf vf1}} + ? {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" + + + ? {C info slot definition ::C::slot::a} "::C property -accessor none {a a1}" + ? {C info slot definition ::C::slot::b} "::C property -accessor public {b b1}" + ? {C info slot definition ::C::slot::c} "::C variable -accessor protected c c1" + ? {C info slot definition ::C::slot::____C.d} "::C variable -accessor private d d1" + ? {C info slot definition ::C::slot::e} "::C property -accessor none {e e1}" + ? {C info slot definition ::C::slot::va} "::C variable -accessor none va va1" + ? {C info slot definition ::C::slot::vb} "::C variable -accessor public vb vb1" + ? {C info slot definition ::C::slot::vc} "::C variable -accessor protected vc vc1" + ? {C info slot definition ::C::slot::____C.vd} "::C variable -accessor private vd vd1" + ? {C info slot definition ::C::slot::ve} "::C variable -accessor none ve ve1" + ? {C info slot definition ::C::slot::vf} "::C variable -accessor none vf vf1" + ? {c1 cget -a} a1 ? {c1 cget -b} b1 Index: tests/serialize.test =================================================================== diff -u -rb531a50ecc43d0c13e2432b099a436c3260c7a49 -r31404a50d429bd67e904a70797c4f67674fab09f --- tests/serialize.test (.../serialize.test) (revision b531a50ecc43d0c13e2432b099a436c3260c7a49) +++ tests/serialize.test (.../serialize.test) (revision 31404a50d429bd67e904a70797c4f67674fab09f) @@ -76,8 +76,9 @@ set c1(One) [list [::Serializer deepSerialize -ignoreVarsRE "a" c1] "b"] set c1(One2) [list [::Serializer deepSerialize -ignoreVarsRE {::a$} c1] "b"] set c1(IgnoreAll) [list [::Serializer deepSerialize -ignoreVarsRE "." c1] ""] + set names {}; foreach s [C info slots] {lappend names [$s name]} set c1(None2) [list [::Serializer deepSerialize -ignoreVarsRE \ - [join [C info slot names] |] c1] ""] + [join $names |] c1] ""] c1 destroy @@ -96,8 +97,9 @@ set C(One) [list [::Serializer deepSerialize -ignoreVarsRE "x" C] "y"] set C(One2) [list [::Serializer deepSerialize -ignoreVarsRE {::x$} C] "y"] set C(IgnoreAll) [list [::Serializer deepSerialize -ignoreVarsRE "." C] ""] + set names {}; foreach s [C info object slots] {lappend names [$s name]} set C(None2) [list [::Serializer deepSerialize \ - -ignoreVarsRE [join [C info object slot names] |] C] ""] + -ignoreVarsRE [join $names |] C] ""] C destroy Index: tests/submethods.test =================================================================== diff -u -rfc77eaadabdd690239694a6f1cf155a7d16b5cd4 -r31404a50d429bd67e904a70797c4f67674fab09f --- tests/submethods.test (.../submethods.test) (revision fc77eaadabdd690239694a6f1cf155a7d16b5cd4) +++ tests/submethods.test (.../submethods.test) (revision 31404a50d429bd67e904a70797c4f67674fab09f) @@ -229,7 +229,7 @@ # defaultcmd has to return also subcmds of other shadowed ensembles ? {lsort [o1 info has]} "valid submethods of ::o1 info has: mixin namespace something type" - ? {lsort [o1 info]} "valid submethods of ::o1 info: children class has info is lookup name object parameter parent precedence vars" + ? {lsort [o1 info]} "valid submethods of ::o1 info: children class has info is lookup name object parameter parent precedence slot vars" # returning methodpath in ensemble ? {o1 info has something path} "info has something path"