Index: library/nx/nx.tcl =================================================================== diff -u -re1e31d0d9747f31ff953c390dcb91796db47751e -rb60bb4c1295b7317ecc7f42258537afa9f483a70 --- library/nx/nx.tcl (.../nx.tcl) (revision e1e31d0d9747f31ff953c390dcb91796db47751e) +++ library/nx/nx.tcl (.../nx.tcl) (revision b60bb4c1295b7317ecc7f42258537afa9f483a70) @@ -117,7 +117,7 @@ #puts stderr "check $object info methods $path @ <$w>" set scope [expr {[::nsf::is class $object] && !${per-object} ? "class" : "object"}] if {[::nsf::dispatch $object ::nsf::methods::${scope}::info::methods $w] eq ""} { - # + # # Create dispatch/ensemble object and accessor method (if wanted) # if {$scope eq "class"} { @@ -1409,8 +1409,11 @@ ::nx::Attribute public method reconfigure {} { #puts stderr "*** Should we reconfigure [self]???" unset -nocomplain :parameterSpec + :checkInstVar :makeAccessor - ::nsf::invalidateobjectparameter ${:domain} + if {[::nsf::is class ${:domain}]} { + ::nsf::invalidateobjectparameter ${:domain} + } } ::nx::Attribute protected method init {} { Index: tests/parameters.test =================================================================== diff -u -rcef0608bea97458e5dcd87615c9b8ca3fe7b464c -rb60bb4c1295b7317ecc7f42258537afa9f483a70 --- tests/parameters.test (.../parameters.test) (revision cef0608bea97458e5dcd87615c9b8ca3fe7b464c) +++ tests/parameters.test (.../parameters.test) (revision b60bb4c1295b7317ecc7f42258537afa9f483a70) @@ -1726,4 +1726,24 @@ ? {o baz [expr {2 ** 64}]} "18446744073709551616" ? {o baz [expr {2 ** 128}]} "340282366920938463463374607431768211456" +} + +nx::Test case reconfigure-default { + Object create o + ? {o eval {info exists :a}} 0 + o attribute {a oldvalue} + ? {o eval {info exists :a}} 1 + ? {o a} oldvalue + # + # Kind of unintuitive, we first have to unset the objvar, then call + # reconfigure ... Can we hide the reconfigure in e.g. the slot objs + # recreate step? Or provide defaults to the ::nsf::method::setter? + # + o eval {unset :a} + ? {o eval {info exists :a}} 0 + o attribute {a newvalue} { + :reconfigure + } + ? {o eval {info exists :a}} 1 + ? {o a} newvalue } \ No newline at end of file