Index: TODO =================================================================== diff -u -r58cf05f8f6551fbdb24f4f3e0870f128c94fb16f -rf3407d8d1674a3018603edb8c367d717441b72a2 --- TODO (.../TODO) (revision 58cf05f8f6551fbdb24f4f3e0870f128c94fb16f) +++ TODO (.../TODO) (revision f3407d8d1674a3018603edb8c367d717441b72a2) @@ -2274,6 +2274,9 @@ - updated regression test - updated class diagram +- nx.tcl: needsForwarder is true, when method "get" is specified on a slot +- nx.tcl: Don't generate per-slot add/assign handlers, when not needed + TODO: - object parameter type forward: Index: library/nx/nx.tcl =================================================================== diff -u -rb5a5b9a7c7ee12a8149d6e5b4d074de8319b4ac1 -rf3407d8d1674a3018603edb8c367d717441b72a2 --- library/nx/nx.tcl (.../nx.tcl) (revision b5a5b9a7c7ee12a8149d6e5b4d074de8319b4ac1) +++ library/nx/nx.tcl (.../nx.tcl) (revision f3407d8d1674a3018603edb8c367d717441b72a2) @@ -1161,6 +1161,7 @@ # if {[:info lookup method assign] ne "::nsf::classes::nx::Attribute::assign"} {return 1} if {[:info lookup method add] ne "::nsf::classes::nx::Attribute::add"} {return 1} + if {[:info lookup method get] ne "::nsf::classes::nx::Attribute::get"} {return 1} if {![info exists :incremental]} {return 0} #if {![:isMultivalued]} {return 0} #puts stderr "[self] ismultivalued" @@ -1201,16 +1202,21 @@ } ::nx::Attribute protected method makeIncrementalOperations {} { + set options_single [:getParameterOptions] + if {[llength $options_single] == 0} { + # No need to make per-slot methods; the general rules on + # nx::Attribute are sufficient + return + } set options [:getParameterOptions -withMultiplicity true] - set body {::nsf::setvar $obj $var $value} lappend options slot=[::nsf::self] + set body {::nsf::setvar $obj $var $value} if {[:info lookup method assign] eq "::nsf::classes::nx::Attribute::assign"} { puts stderr ":public method assign [list obj var [:namedParameterSpec -prefix {} value $options]] $body" :public method assign [list obj var [:namedParameterSpec -prefix {} value $options]] $body } if {[:isMultivalued] && [:info lookup method add] eq "::nsf::classes::nx::Attribute::add"} { - set options_single [:getParameterOptions] lappend options_single slot=[::nsf::self] puts stderr ":public method add [list obj prop [:namedParameterSpec -prefix {} value $options_single] {pos 0}] {::nsf::next}" :public method add [list obj prop [:namedParameterSpec -prefix {} value $options_single] {pos 0}] {::nsf::next}