Index: generic/predefined.h =================================================================== diff -u -rdb7c710aa3b6386c33af9a318876f21a88b8aafd -r666f7ad2cb2562f3d62fc9aea54efb9b0826f6b0 --- generic/predefined.h (.../predefined.h) (revision db7c710aa3b6386c33af9a318876f21a88b8aafd) +++ generic/predefined.h (.../predefined.h) (revision 666f7ad2cb2562f3d62fc9aea54efb9b0826f6b0) @@ -22,22 +22,12 @@ "Object method defaultmethod {} {::xotcl::self}\n" "Object method objectparameter {} {;}\n" "Class method -per-object __unknown {name} {}\n" -"Object method alias {-per-object:switch methodName -cmd -source-object -source-method -source-per-object:switch} {\n" -"if {[info exists cmd]} {\n" -"set cmd [namespace origin $cmd]} elseif {[info exists source-method]} {\n" -"if {![info exists source-object]} {\n" -"set source-object [self]} else {\n" -"set source-object [::xotcl::dispatch ${source-object} -objscope ::xotcl::self]}\n" -"if {${source-per-object}} {\n" -"set cmd ${source-object}::$methodName} else {\n" -"set cmd ::xotcl::classes${source-object}::${source-method}}}\n" -"if {${per-object} && [::xotcl::is [self] class]} {\n" -"eval ::xotcl::alias [self] $methodName -per-object $cmd} else {\n" -"eval ::xotcl::alias [self] $methodName $cmd}}\n" +"Object method alias {-per-object:switch methodName cmd} {\n" +"::xotcl::alias [self] $methodName {*}[expr {${per-object} ? \"-per-object\" : \"\"}] $cmd}\n" "Object create ::xotcl2::objectInfo\n" "Object create ::xotcl2::classInfo\n" "::xotcl::dispatch objectInfo -objscope ::eval {\n" -".alias is -cmd ::xotcl::is\n" +".alias is ::xotcl::is\n" ".method info {obj} {\n" "set methods [list]\n" "foreach name [::xotcl::cmd::ObjectInfo::methods [self] -defined] {\n" @@ -47,19 +37,19 @@ ".method unknown {method obj args} {\n" "error \"[::xotcl::self] unknown info option \\\"$method\\\"; [$obj info info]\"}}\n" "::xotcl::dispatch classInfo -objscope ::eval {\n" -".alias is -cmd ::xotcl::is\n" -".alias classparent -cmd ::xotcl::cmd::ObjectInfo::parent\n" -".alias classchildren -cmd ::xotcl::cmd::ObjectInfo::children\n" -".alias info -source-object objectInfo -source-per-object -source-method info\n" -".alias unknown -source-object objectInfo -source-per-object -source-method unknown}\n" +".alias is ::xotcl::is\n" +".alias classparent ::xotcl::cmd::ObjectInfo::parent\n" +".alias classchildren ::xotcl::cmd::ObjectInfo::children\n" +".alias info [::xotcl::cmd::ObjectInfo::method objectInfo -per-object name info]\n" +".alias unknown [::xotcl::cmd::ObjectInfo::method objectInfo -per-object name info]}\n" "foreach cmd [info command ::xotcl::cmd::ObjectInfo::*] {\n" "::xotcl::alias ::xotcl2::objectInfo [namespace tail $cmd] $cmd\n" "::xotcl::alias ::xotcl2::classInfo [namespace tail $cmd] $cmd}\n" "foreach cmd [info command ::xotcl::cmd::ClassInfo::*] {\n" "::xotcl::alias ::xotcl2::classInfo [namespace tail $cmd] $cmd}\n" "unset cmd\n" -"Object instforward info -onerror ::xotcl::infoError ::xotcl2::objectInfo %1 {%@2 %self}\n" -"Class instforward info -onerror ::xotcl::infoError ::xotcl2::classInfo %1 {%@2 %self}\n" +"Object forward info -onerror ::xotcl::infoError ::xotcl2::objectInfo %1 {%@2 %self}\n" +"Class forward info -onerror ::xotcl::infoError ::xotcl2::classInfo %1 {%@2 %self}\n" "proc ::xotcl::infoError msg {\n" "regsub -all \" \" $msg \"\" msg\n" "regsub -all \" \" $msg \"\" msg\n" @@ -131,7 +121,7 @@ "if {[info exists default]} {\n" "::xotcl::setinstvar ${class}::slot::$att default $default\n" "unset default}\n" -"$class instparametercmd $att}\n" +"$class setter $att}\n" "foreach att $definitions {\n" "if {[llength $att]>1} {foreach {att default} $att break}\n" "if {[info exists default]} {\n" @@ -177,12 +167,13 @@ "${.domain} invalidateobjectparameter}\n" "next}\n" "::xotcl::Slot method init {args} {\n" -"set forwarder [expr {${.per-object} ? \"forward\" : \"instforward\"}]\n" "if {${.domain} eq \"\"} {\n" "set .domain [::xotcl::self callingobject]}\n" "if {${.domain} ne \"\"} {\n" "${.domain} invalidateobjectparameter\n" -"${.domain} $forwarder ${.name} -default [${.manager} defaultmethods] ${.manager} %1 %self %proc}}\n" +"::xotcl::dispatch ${.domain} ::xotcl::cmd::Class::forward \\\n" +"{*}[expr {${.per-object} ? \"-per-object\" : \"\"}] ${.name} \\\n" +"-default [${.manager} defaultmethods] ${.manager} %1 %self %proc}}\n" "::xotcl::MetaSlot create ::xotcl::InfoSlot\n" "createBootstrapAttributeSlots ::xotcl::InfoSlot {\n" "{multivalued true}\n" @@ -299,8 +290,7 @@ "if {[set .defaultmethods] ne {get assign}} return\n" "if {[.procsearch assign] ne \"::xotcl::Slot instcmd assign\"} return\n" "if {[.procsearch get] ne \"::xotcl::Slot instcmd get\"} return\n" -"set forwarder [expr {[set .per-object] ? \"parametercmd\":\"instparametercmd\"}]\n" -"${.domain} $forwarder ${.name}}}\n" +"${.domain} setter {*}[expr {${.per-object} ? \"-per-object\" : \"\"}] ${.name}}}\n" "::xotcl::Attribute instmixin add ::xotcl::Slot::Optimizer\n" "::xotcl2::Class create ::xotcl::ScopedNew -superclass ::xotcl2::Class\n" "createBootstrapAttributeSlots ::xotcl::ScopedNew {\n" @@ -327,7 +317,7 @@ "namespace eval $object $cmds\n" "::xotcl2::Class instmixin delete $m} else {\n" "namespace eval $object $cmds}}\n" -"::xotcl2::Class instforward slots %self contains \\\n" +"::xotcl2::Class forward slots %self contains \\\n" "-object {%::xotcl::dispatch [::xotcl::self] -objscope ::subst [::xotcl::self]::slot}\n" "::xotcl2::Class method parameter arglist {\n" "if {![::xotcl::is [::xotcl::self]::slot object]} {\n" @@ -378,7 +368,7 @@ "return \\[eval $access $setter $extra $name \\$args $defaultParam \\]}\"\n" "foreach instvar {extra defaultParam setter getter access} {\n" "$po unset -nocomplain $instvar}} else {\n" -".instparametercmd $name}}}\n" +".setter $name}}}\n" "::xotcl::setinstvar [::xotcl::self]::slot __parameter $arglist}\n" "::xotcl2::Class create ::xotcl::CopyHandler -parameter {\n" "{targetList \"\"}\n"