Index: generic/predefined.h =================================================================== diff -u -r555e7f84db642cb7f4d77c8a5189922e1287b3d4 -rfad871fc9a27570119d6bf9dbed84b7469701bd6 --- generic/predefined.h (.../predefined.h) (revision 555e7f84db642cb7f4d77c8a5189922e1287b3d4) +++ generic/predefined.h (.../predefined.h) (revision fad871fc9a27570119d6bf9dbed84b7469701bd6) @@ -205,10 +205,10 @@ "if {[$slot exists type]} {\n" "lappend opts [$slot type]}\n" "if {[$slot exists default]} {\n" -"set arg [$slot set default]\n" +"set arg [::xotcl::setinstvar $slot default]\n" "if {[string match {*\\[*\\]*} $arg]} {\n" "lappend opts substdefault}} elseif {[$slot exists initcmd]} {\n" -"set arg [$slot set initcmd]\n" +"set arg [::xotcl::setinstvar $slot initcmd]\n" "lappend opts initcmd}\n" "if {[llength $opts] > 0} {\n" "append parameterdefinition :[join $opts ,]}\n" @@ -263,12 +263,12 @@ "if {![set .multivalued]} {\n" "error \"Property $prop of [set .domain]->$obj ist not multivalued\"}\n" "if {[$obj exists $prop]} {\n" -"$obj set $prop [linsert [$obj set $prop] $pos $value]} else {\n" -"$obj set $prop [list $value]}}\n" +"::xotcl::setinstvar $obj $prop [linsert [::xotcl::setinstvar $obj $prop] $pos $value]} else {\n" +"::xotcl::setinstvar $obj $prop [list $value]}}\n" "::xotcl::Slot method delete {-nocomplain:switch obj prop value} {\n" -"set old [$obj set $prop]\n" +"set old [::xotcl::setinstvar $obj $prop]\n" "set p [lsearch -glob $old $value]\n" -"if {$p>-1} {$obj set $prop [lreplace $old $p $p]} else {\n" +"if {$p>-1} {::xotcl::setinstvar $obj $prop [lreplace $old $p $p]} else {\n" "error \"$value is not a $prop of $obj (valid are: $old)\"}}\n" "::xotcl::Slot method unknown {method args} {\n" "set methods [list]\n" @@ -345,24 +345,24 @@ "valuechangedcmd}\n" "::xotcl::Attribute method __default_from_cmd {obj cmd var sub op} {\n" "$obj trace remove variable $var $op [list [::xotcl::self] [::xotcl::self proc] $obj $cmd]\n" -"$obj set $var [$obj eval $cmd]}\n" +"::xotcl::setinstvar $obj $var [$obj eval $cmd]}\n" "::xotcl::Attribute method __value_from_cmd {obj cmd var sub op} {\n" -"$obj set $var [$obj eval $cmd]}\n" +"::xotcl::setinstvar $obj $var [$obj eval $cmd]}\n" "::xotcl::Attribute method __value_changed_cmd {obj cmd var sub op} {\n" "eval $cmd}\n" "::xotcl::Attribute method check_single_value {\n" "{-keep_old_value:boolean true}\n" "value predicate type obj var} {\n" "if {![expr $predicate]} {\n" "if {[$obj exists __oldvalue($var)]} {\n" -"$obj set $var [$obj set __oldvalue($var)]} else {\n" +"::xotcl::setinstvar $obj $var [::xotcl::setinstvar $obj __oldvalue($var)]} else {\n" "$obj unset -nocomplain $var}\n" "error \"'$value' is not of type $type\"}\n" -"if {$keep_old_value} {$obj set __oldvalue($var) $value}}\n" +"if {$keep_old_value} {::xotcl::setinstvar $obj __oldvalue($var) $value}}\n" "::xotcl::Attribute method check_multiple_values {values predicate type obj var} {\n" "foreach value $values {\n" ".check_single_value -keep_old_value false $value $predicate $type $obj $var}\n" -"$obj set __oldvalue($var) $value}\n" +"::xotcl::setinstvar $obj __oldvalue($var) $value}\n" "::xotcl::Attribute method mk_type_checker {} {\n" "set __initcmd \"\"\n" "if {[.exists type]} {\n" @@ -372,7 +372,7 @@ "set predicate \"\\[${.type} \\$value\\]\"} else {\n" "set predicate \"\\[.type=${.type} ${.name} \\$value\\]\"}\n" "append .valuechangedcmd [subst {\n" -"[expr {${.multivalued} ? \".check_multiple_values\" : \".check_single_value\"}] \\[\\$obj set ${.name}\\] \\\n" +"[expr {${.multivalued} ? \".check_multiple_values\" : \".check_single_value\"}] \\[::xotcl::setinstvar \\$obj ${.name}\\] \\\n" "{$predicate} [list ${.type}] \\$obj ${.name}}]\n" "append __initcmd [subst -nocommands {\n" "if {[.exists ${.name}]} {set .__oldvalue(${.name}) [set .${.name}]}\\n}]}\n" @@ -464,8 +464,8 @@ "set po ::xotcl::Class::Parameter\n" "puts stderr \"deprecated parameter usage '$arg'; use '-slots {Attribute ...}' instead\"\n" "set cl [::xotcl::self]\n" -"$po set name $name\n" -"$po set cl [::xotcl::self]\n" +"::xotcl::setinstvar $po name $name\n" +"::xotcl::setinstvar $po cl [::xotcl::self]\n" "::eval $po configure [lrange $arg 1 end]\n" "if {[$po exists extra] || [$po exists setter] ||\n" "[$po exists getter] || [$po exists access]} {\n" @@ -482,7 +482,7 @@ "foreach instvar {extra defaultParam setter getter access} {\n" "$po unset -nocomplain $instvar}} else {\n" ".instparametercmd $name}}}\n" -"[::xotcl::self]::slot set __parameter $arglist}\n" +"::xotcl::setinstvar [::xotcl::self]::slot __parameter $arglist}\n" "::xotcl::Object method self {} {::xotcl::self}\n" "::xotcl::Object method defaultmethod {} {\n" "return [::xotcl::self]}\n" Index: generic/predefined.xotcl =================================================================== diff -u -r555e7f84db642cb7f4d77c8a5189922e1287b3d4 -rfad871fc9a27570119d6bf9dbed84b7469701bd6 --- generic/predefined.xotcl (.../predefined.xotcl) (revision 555e7f84db642cb7f4d77c8a5189922e1287b3d4) +++ generic/predefined.xotcl (.../predefined.xotcl) (revision fad871fc9a27570119d6bf9dbed84b7469701bd6) @@ -444,13 +444,13 @@ lappend opts [$slot type] } if {[$slot exists default]} { - set arg [$slot set default] + set arg [::xotcl::setinstvar $slot default] # deactivated for now: || [string first {$} $arg] > -1 if {[string match {*\[*\]*} $arg]} { lappend opts substdefault } } elseif {[$slot exists initcmd]} { - set arg [$slot set initcmd] + set arg [::xotcl::setinstvar $slot initcmd] lappend opts initcmd } if {[llength $opts] > 0} { @@ -554,16 +554,16 @@ error "Property $prop of [set .domain]->$obj ist not multivalued" } if {[$obj exists $prop]} { - $obj set $prop [linsert [$obj set $prop] $pos $value] + ::xotcl::setinstvar $obj $prop [linsert [::xotcl::setinstvar $obj $prop] $pos $value] } else { - $obj set $prop [list $value] + ::xotcl::setinstvar $obj $prop [list $value] } #[set .domain] invalidateobjectparameter ;# TODO maybe not needed here } ::xotcl::Slot method delete {-nocomplain:switch obj prop value} { - set old [$obj set $prop] + set old [::xotcl::setinstvar $obj $prop] set p [lsearch -glob $old $value] - if {$p>-1} {$obj set $prop [lreplace $old $p $p]} else { + if {$p>-1} {::xotcl::setinstvar $obj $prop [lreplace $old $p $p]} else { error "$value is not a $prop of $obj (valid are: $old)" } } @@ -696,15 +696,15 @@ ::xotcl::Attribute method __default_from_cmd {obj cmd var sub op} { #puts "GETVAR [::xotcl::self proc] obj=$obj cmd=$cmd, var=$var, op=$op" $obj trace remove variable $var $op [list [::xotcl::self] [::xotcl::self proc] $obj $cmd] - $obj set $var [$obj eval $cmd] + ::xotcl::setinstvar $obj $var [$obj eval $cmd] } ::xotcl::Attribute method __value_from_cmd {obj cmd var sub op} { #puts "GETVAR [::xotcl::self proc] obj=$obj cmd=$cmd, var=$var, op=$op" - $obj set $var [$obj eval $cmd] + ::xotcl::setinstvar $obj $var [$obj eval $cmd] } ::xotcl::Attribute method __value_changed_cmd {obj cmd var sub op} { # puts stderr "**************************" - # puts "valuechanged obj=$obj cmd=$cmd, var=$var, op=$op, ...\n$obj exists $var -> [$obj set $var]" + # puts "valuechanged obj=$obj cmd=$cmd, var=$var, op=$op, ...\n$obj exists $var -> [::xotcl::setinstvar $obj $var]" eval $cmd } ::xotcl::Attribute method check_single_value { @@ -714,21 +714,21 @@ #puts "+++ checking single value '$value' with $predicate ==> [expr $predicate]" if {![expr $predicate]} { if {[$obj exists __oldvalue($var)]} { - $obj set $var [$obj set __oldvalue($var)] + ::xotcl::setinstvar $obj $var [::xotcl::setinstvar $obj __oldvalue($var)] } else { $obj unset -nocomplain $var } error "'$value' is not of type $type" } - if {$keep_old_value} {$obj set __oldvalue($var) $value} + if {$keep_old_value} {::xotcl::setinstvar $obj __oldvalue($var) $value} #puts "+++ checking single value done" } ::xotcl::Attribute method check_multiple_values {values predicate type obj var} { foreach value $values { .check_single_value -keep_old_value false $value $predicate $type $obj $var } - $obj set __oldvalue($var) $value + ::xotcl::setinstvar $obj __oldvalue($var) $value } ::xotcl::Attribute method mk_type_checker {} { set __initcmd "" @@ -746,7 +746,7 @@ #puts stderr predicate=$predicate append .valuechangedcmd [subst { [expr {${.multivalued} ? ".check_multiple_values" : ".check_single_value" - }] \[\$obj set ${.name}\] \ + }] \[::xotcl::setinstvar \$obj ${.name}\] \ {$predicate} [list ${.type}] \$obj ${.name} }] append __initcmd [subst -nocommands { @@ -895,8 +895,8 @@ puts stderr "deprecated parameter usage '$arg'; use '-slots {Attribute ...}' instead" set cl [::xotcl::self] - $po set name $name - $po set cl [::xotcl::self] + ::xotcl::setinstvar $po name $name + ::xotcl::setinstvar $po cl [::xotcl::self] ::eval $po configure [lrange $arg 1 end] if {[$po exists extra] || [$po exists setter] || @@ -921,7 +921,7 @@ } } } - [::xotcl::self]::slot set __parameter $arglist + ::xotcl::setinstvar [::xotcl::self]::slot __parameter $arglist } #