Index: TODO =================================================================== diff -u -r007902e395dbae6680ae93015b2a08443ba82ff9 -r8232fc43e280715e51dc20a9b7f2a3bb9bb2ff7b --- TODO (.../TODO) (revision 007902e395dbae6680ae93015b2a08443ba82ff9) +++ TODO (.../TODO) (revision 8232fc43e280715e51dc20a9b7f2a3bb9bb2ff7b) @@ -4182,6 +4182,9 @@ - Property reform part 3: change defaultPropertyAccessor or nx to none - update documentation with property reform +- do we need "-properties" in nx? +- do we need "config" as parameter property? + - handling of method names in error messages from nsfAPI.h. The following ? {o __alloc x} {method __alloc not dispatched on valid class} should be Index: library/nx/nx.tcl =================================================================== diff -u -re884c2b0d63fa1b5a691e866ccff8d4094a2a8e4 -r8232fc43e280715e51dc20a9b7f2a3bb9bb2ff7b --- library/nx/nx.tcl (.../nx.tcl) (revision e884c2b0d63fa1b5a691e866ccff8d4094a2a8e4) +++ library/nx/nx.tcl (.../nx.tcl) (revision 8232fc43e280715e51dc20a9b7f2a3bb9bb2ff7b) @@ -1855,6 +1855,7 @@ {-accessor "none"} {-incremental:switch} {-class ""} + {-config:switch} {-initblock ""} {-nocomplain:switch} spec:parameter @@ -1876,10 +1877,18 @@ name parameterOptions class options array set opts $options - if {$initblock eq "" && $accessor eq "none" && !$incremental} { + # TODO: do we need config as parameter property? + if {[info exists opts(-config)]} { + set config $opts(-config) + } + + #if {$initblock eq "" && $accessor eq "none" && !$incremental} + if {$initblock eq "" && !$config && $accessor eq "none" && !$incremental} { # # we can build a slot-less variable # + #puts "... slotless variable $spec" + set isSwitch [regsub {\mswitch\M} $parameterOptions boolean parameterOptions] if {[info exists defaultValue]} { if {[info exists :$name] && !$nocomplain} { @@ -1906,6 +1915,7 @@ return } + #puts "... slot variable $spec" # # create variable via a slot object # @@ -1915,11 +1925,12 @@ -initblock $initblock \ -incremental=$incremental \ -private=[expr {$accessor eq "private"}] \ - -defaultopts [list -accessor $accessor -config false] \ + -defaultopts [list -accessor $accessor] \ $spec \ {*}[expr {[info exists defaultValue] ? [list $defaultValue] : ""}]] if {$nocomplain} {$slot eval {set :nocomplain 1}} + if {!$config} {$slot eval {set :config false}} if {[info exists defaultValue]} {$slot setCheckedInstVar -nocomplain=$nocomplain [self] $defaultValue} if {[$slot eval {info exists :settername}]} { @@ -1950,6 +1961,7 @@ -incremental=$incremental \ -class $class \ -initblock $initblock \ + -config=true \ -nocomplain=$nocomplain \ {*}$spec] return $r Index: tests/parameters.test =================================================================== diff -u -re884c2b0d63fa1b5a691e866ccff8d4094a2a8e4 -r8232fc43e280715e51dc20a9b7f2a3bb9bb2ff7b --- tests/parameters.test (.../parameters.test) (revision e884c2b0d63fa1b5a691e866ccff8d4094a2a8e4) +++ tests/parameters.test (.../parameters.test) (revision 8232fc43e280715e51dc20a9b7f2a3bb9bb2ff7b) @@ -2395,9 +2395,9 @@ # all properties with slots show up in "info slot" # TODO: object slots will change when we allow true object properties - ? {o2 info slot objects} "::o2::per-object-slot::p0 ::o2::per-object-slot::p3" - ? {o2 info slot definition} "{p0:noconfig 200} {p3:noconfig 203}" - ? {o2 info properties} "{p0:noconfig 200} {p3:noconfig 203}" + ? {o2 info slot objects} "::o2::per-object-slot::p0 ::o2::per-object-slot::p1 ::o2::per-object-slot::p3" + ? {o2 info slot definition} "{p0 200} {p1 201} {p3:noconfig 203}" + ? {o2 info properties} "{p0 200} {p1 201} {p3:noconfig 203}" } Index: tests/properties.test =================================================================== diff -u -rab1606eccae7baf9db46463949cf2beed197a03e -r8232fc43e280715e51dc20a9b7f2a3bb9bb2ff7b --- tests/properties.test (.../properties.test) (revision ab1606eccae7baf9db46463949cf2beed197a03e) +++ tests/properties.test (.../properties.test) (revision 8232fc43e280715e51dc20a9b7f2a3bb9bb2ff7b) @@ -1,3 +1,5 @@ +# -*- Tcl -*- + package req nx::test #