Index: TODO =================================================================== diff -u -r1d6fce4237af2c0a77067e6cbf041bea2c30c37d -r46f5a635968d0c3dfe4c81f80e4ac21350096394 --- TODO (.../TODO) (revision 1d6fce4237af2c0a77067e6cbf041bea2c30c37d) +++ TODO (.../TODO) (revision 46f5a635968d0c3dfe4c81f80e4ac21350096394) @@ -5121,6 +5121,8 @@ - added flag -nocomplain to "/obj/ /prop/ unset ?-nocomplain?" - use "mixin|filter clear" instead of "mixin|filter unset" - name parameter option "slotset" instead of "slotassign" +- have "filter|mixin clear" return the list of former|removed + filters|mixins. nsfObj.c: - allow to omit "-guard" within arguments to flag @@ -5136,24 +5138,6 @@ - finish nx-property reform (merge into master) -- IDEA: have "filter|mixin clear" return the list of former|removed - filters|mixins to stash them in the caller context. simplifies - turning on|off scenarios (one instead of two calls): - - set tmp [obj object filter clear] - # ... do work ... - obj object filter $tmp - - or: clear & check whether mixins|filters were set in one step: - - if {[length [obj object filter clear]]} { - # ... there were actually filter active, now removed - } else { - # ... attempted clearing, but nothing active ... - } - - or: a combination of the two idioms ... - - check deactivated tests in tests/serialize.test C(One), C(IgnoreAll), C(None2) and xlloc fix Index: library/nx/nx.tcl =================================================================== diff -u -rf024f89a488f29a8745fcb928c6b7c94d0486d8f -r46f5a635968d0c3dfe4c81f80e4ac21350096394 --- library/nx/nx.tcl (.../nx.tcl) (revision f024f89a488f29a8745fcb928c6b7c94d0486d8f) +++ library/nx/nx.tcl (.../nx.tcl) (revision 46f5a635968d0c3dfe4c81f80e4ac21350096394) @@ -1519,7 +1519,9 @@ ::nsf::method::alias RelationSlot value=get ::nsf::relation::get RelationSlot public method value=clear {obj prop} { + set result [::nsf::relation::set $obj $prop] ::nsf::relation::set $obj $prop {} + return $result } RelationSlot protected method delete_value {obj prop old value} { Index: tests/interceptor-slot.test =================================================================== diff -u -r24cc5e107fd8d246061a9d4b4fafefc767811c2b -r46f5a635968d0c3dfe4c81f80e4ac21350096394 --- tests/interceptor-slot.test (.../interceptor-slot.test) (revision 24cc5e107fd8d246061a9d4b4fafefc767811c2b) +++ tests/interceptor-slot.test (.../interceptor-slot.test) (revision 46f5a635968d0c3dfe4c81f80e4ac21350096394) @@ -27,7 +27,7 @@ ? {C info mixin classes} "" ? {C mixin set ::M} "::M" - ? {C mixin clear} "" + ? {C mixin clear} "::M" ? {C info mixin classes} "" ? {C mixin add ::M} "::M" @@ -69,7 +69,7 @@ ? {c1 object mixin add M} {::M} ? {c1 info object mixin classes} {::M} - ? {c1 object mixin clear} {} + ? {c1 object mixin clear} {::M} ? {c1 info object mixin classes} {} } @@ -196,7 +196,7 @@ ? {::nsf::relation::get CC object-filter} "filterC" ? {CC info object filter methods} "filterC" - ? {CC object filter clear} "" + ? {CC object filter clear} "filterC" ? {::nsf::relation::get CC object-filter} "" ? {CC info object filter methods} "" @@ -218,7 +218,7 @@ ? {::nsf::relation::get CC class-filter} "filterB" ? {CC info filter methods} "filterB" - ? {CC filter clear} "" + ? {CC filter clear} "filterB" ? {::nsf::relation::get CC class-filter} "" ? {CC info filter methods} "" }