Index: generic/predefined.h =================================================================== diff -u -r120f51260309bbe35ba0f142a25e1b18947e3635 -r7121883918ed2a2591a63630bd465cd1d98eaa26 --- generic/predefined.h (.../predefined.h) (revision 120f51260309bbe35ba0f142a25e1b18947e3635) +++ generic/predefined.h (.../predefined.h) (revision 7121883918ed2a2591a63630bd465cd1d98eaa26) @@ -166,8 +166,9 @@ "set arg [::xotcl::setinstvar $slot initcmd]\n" "lappend opts initcmd}\n" "if {[$slot exists methodname]} {\n" -"set methodname [::xotcl::setinstvar $slot methodname]\n" -"if {$methodname ne $name} {\n" +"set methodname [$slot methodname]\n" +"set slotname [$slot name]\n" +"if {$methodname ne $slotname} {\n" "lappend opts arg=$methodname}}\n" "if {[llength $opts] > 0} {\n" "append parameterdefinition :[join $opts ,]}\n" @@ -374,11 +375,12 @@ "\\[list [::xotcl::self] __default_from_cmd \\[::xotcl::self\\] [list [set :initcmd]]\\]\\n\"} elseif [:exists valuecmd] {\n" "append __initcmd \":trace add variable [list ${:name}] read \\\n" "\\[list [::xotcl::self] __value_from_cmd \\[::xotcl::self\\] [list [set :valuecmd]]\\]\"}\n" -"set valueParam [::xotcl::parameterFromSlot [self] \"value\"]\n" -"if {$valueParam ne \"value\"} {\n" +"set valueParam [lindex [::xotcl::parameterFromSlot [self] \"value\"] 0]\n" +"if {$valueParam ne \"value\" && [string first : $valueParam] > -1} {\n" "if {[set :multivalued]} {\n" ":method check_single_value [list $valueParam] {return 1}\n" ":method check_multiple_values list {foreach a $list {:check_single_value $a}}\n" +"puts stderr \"adding multiple assignmethod for [self] with $valueParam\"\n" ":method assign [list obj var value] {\n" ":check_multiple_values $value\n" "::xotcl::setinstvar $obj $var $value}} else {\n" Index: generic/predefined.xotcl =================================================================== diff -u -r120f51260309bbe35ba0f142a25e1b18947e3635 -r7121883918ed2a2591a63630bd465cd1d98eaa26 --- generic/predefined.xotcl (.../predefined.xotcl) (revision 120f51260309bbe35ba0f142a25e1b18947e3635) +++ generic/predefined.xotcl (.../predefined.xotcl) (revision 7121883918ed2a2591a63630bd465cd1d98eaa26) @@ -340,9 +340,11 @@ lappend opts initcmd } if {[$slot exists methodname]} { - set methodname [::xotcl::setinstvar $slot methodname] - if {$methodname ne $name} { + set methodname [$slot methodname] + set slotname [$slot name] + if {$methodname ne $slotname} { lappend opts arg=$methodname + #puts stderr "..... setting arg for methodname: $slot has arg arg=$methodname" } } if {[llength $opts] > 0} { @@ -351,6 +353,7 @@ if {[info exists arg]} { lappend parameterdefinition $arg } + #puts stderr "parameterFromSlot {$slot $name} returns $parameterdefinition" return $parameterdefinition } @@ -710,12 +713,13 @@ append __initcmd ":trace add variable [list ${:name}] read \ \[list [::xotcl::self] __value_from_cmd \[::xotcl::self\] [list [set :valuecmd]]\]" } - set valueParam [::xotcl::parameterFromSlot [self] "value"] - if {$valueParam ne "value"} { + set valueParam [lindex [::xotcl::parameterFromSlot [self] "value"] 0] + #puts stderr "valueParam for [self] is $valueParam" + if {$valueParam ne "value" && [string first : $valueParam] > -1} { if {[set :multivalued]} { :method check_single_value [list $valueParam] {return 1} :method check_multiple_values list {foreach a $list {:check_single_value $a}} - #puts stderr "adding multiple assignmethod for [self] with $valueParam" + puts stderr "adding multiple assignmethod for [self] with $valueParam" :method assign [list obj var value] { :check_multiple_values $value ::xotcl::setinstvar $obj $var $value Index: library/lib/test.xotcl =================================================================== diff -u -rf6be532e62dfbe148ebca8205a67688b751298ad -r7121883918ed2a2591a63630bd465cd1d98eaa26 --- library/lib/test.xotcl (.../test.xotcl) (revision f6be532e62dfbe148ebca8205a67688b751298ad) +++ library/lib/test.xotcl (.../test.xotcl) (revision 7121883918ed2a2591a63630bd465cd1d98eaa26) @@ -121,9 +121,9 @@ #catch {namespace eval $namespace {$cmd}} errorMsg catch $cmd ::xotcl::test::errorMsg if {$msg ne ""} { - set t [Test new -cmd {set ::xotcl::test::errorMsg} -msg $msg -namespace $namespace] + set t [Test new -cmd {set ::xotcl::test::errorMsg} -msg $msg -namespace $namespace -count 1] } else { - set t [Test new -cmd {set ::xotcl::test::errorMsg} -namespace $namespace] + set t [Test new -cmd {set ::xotcl::test::errorMsg} -namespace $namespace -count 1] } $t expected $expected $t run