Index: generic/predefined.h =================================================================== diff -u -rf9e18344d59553044453d08e464acce46664ffcf -raef09781efb62a6336ecf355e927549d72b37a7a --- generic/predefined.h (.../predefined.h) (revision f9e18344d59553044453d08e464acce46664ffcf) +++ generic/predefined.h (.../predefined.h) (revision aef09781efb62a6336ecf355e927549d72b37a7a) @@ -14,8 +14,8 @@ "::xotcl::alias ::xotcl::Object $cmd -objscope ::$cmd}\n" "foreach cmd [info command ::xotcl::cmd::Class::*] {\n" "::xotcl::alias ::xotcl::Class [namespace tail $cmd] $cmd}\n" -"::xotcl::Object instproc init args {}\n" -"::xotcl::Object instproc objectparameter {} {;}\n" +"::xotcl::Object method init args {}\n" +"::xotcl::Object method objectparameter {} {;}\n" "::xotcl::Class create ::xotcl::ParameterType\n" "foreach cmd [info command ::xotcl::cmd::ParameterType::*] {\n" "::xotcl::alias ::xotcl::ParameterType [namespace tail $cmd] $cmd}\n" @@ -40,23 +40,23 @@ "regsub -all \" \" $msg \"\" msg\n" "regsub {\\\"} $msg \"\\\"info \" msg\n" "error $msg \"\"}\n" -"::xotcl::objectInfo proc info {obj} {\n" +"::xotcl::objectInfo method info {obj} {\n" "set methods [list]\n" "foreach m [::info commands ::xotcl::objectInfo::*] {\n" "set name [namespace tail $m]\n" "if {$name eq \"unknown\"} continue\n" "lappend methods $name}\n" "return \"valid options are: [join [lsort $methods] {, }]\"}\n" -"::xotcl::objectInfo proc unknown {method args} {\n" +"::xotcl::objectInfo method unknown {method args} {\n" "error \"unknown info option \\\"$method\\\"; [my info info]\"}\n" -"::xotcl::classInfo proc info {cl} {\n" +"::xotcl::classInfo method info {cl} {\n" "set methods [list]\n" "foreach m [::info commands ::xotcl::classInfo::*] {\n" "set name [namespace tail $m]\n" "if {$name eq \"unknown\"} continue\n" "lappend methods $name}\n" "return \"valid options are: [join [lsort $methods] {, }]\"}\n" -"::xotcl::classInfo proc unknown {method args} {\n" +"::xotcl::classInfo method unknown {method args} {\n" "error \"unknown info option \\\"$method\\\"; [my info info]\"}\n" "# info instargs\n" "# istype\n" @@ -86,34 +86,49 @@ "set default \"\"\n" "return 0}}\n" "error \"procedure \\\"$method\\\" doesn't have an argument \\\"$varName\\\"\"}\n" -"::xotcl::classInfo proc instargs {o method} {::xotcl::info_args inst $o $method}\n" -"::xotcl::classInfo proc args {o method} {::xotcl::info_args \"\" $o $method}\n" -"::xotcl::objectInfo proc args {o method} {::xotcl::info_args \"\" $o $method}\n" -"::xotcl::classInfo proc instnonposargs {o method} {::xotcl::info_nonposargs inst $o $method}\n" -"::xotcl::classInfo proc nonposargs {o method} {::xotcl::info_nonposargs \"\" $o $method}\n" -"::xotcl::objectInfo proc nonposargs {o method} {::xotcl::info_nonposargs \"\" $o $method}\n" -"::xotcl::classInfo proc instdefault {o method arg var} {::xotcl::info_default inst $o $method $arg $var}\n" -"::xotcl::classInfo proc default {o method arg var} {::xotcl::info_default \"\" $o $method $arg $var}\n" -"::xotcl::objectInfo proc default {o method arg var} {::xotcl::info_default \"\" $o $method $arg $var}\n" -"::xotcl::Object instproc isobject {{object:substdefault \"[self]\"}} {::xotcl::is $object object}\n" -"::xotcl::Object instproc isclass {{class:substdefault \"[self]\"}} {::xotcl::is $class class}\n" -"::xotcl::Object instproc ismetaclass {{class:substdefault \"[self]\"}} {::xotcl::is $class metaclass}\n" -"::xotcl::Object instproc ismixin {class} {::xotcl::is [self] mixin $class}\n" -"::xotcl::Object instproc istype {class} {::xotcl::is [self] type $class}\n" +"::xotcl::classInfo method instargs {o method} {::xotcl::info_args inst $o $method}\n" +"::xotcl::classInfo method args {o method} {::xotcl::info_args \"\" $o $method}\n" +"::xotcl::objectInfo method args {o method} {::xotcl::info_args \"\" $o $method}\n" +"::xotcl::classInfo method instnonposargs {o method} {::xotcl::info_nonposargs inst $o $method}\n" +"::xotcl::classInfo method nonposargs {o method} {::xotcl::info_nonposargs \"\" $o $method}\n" +"::xotcl::objectInfo method nonposargs {o method} {::xotcl::info_nonposargs \"\" $o $method}\n" +"::xotcl::classInfo method instdefault {o method arg var} {::xotcl::info_default inst $o $method $arg $var}\n" +"::xotcl::classInfo method default {o method arg var} {::xotcl::info_default \"\" $o $method $arg $var}\n" +"::xotcl::objectInfo method default {o method arg var} {::xotcl::info_default \"\" $o $method $arg $var}\n" +"::xotcl::Object method isobject {{object:substdefault \"[self]\"}} {::xotcl::is $object object}\n" +"::xotcl::Object method isclass {{class:substdefault \"[self]\"}} {::xotcl::is $class class}\n" +"::xotcl::Object method ismetaclass {{class:substdefault \"[self]\"}} {::xotcl::is $class metaclass}\n" +"::xotcl::Object method ismixin {class} {::xotcl::is [self] mixin $class}\n" +"::xotcl::Object method istype {class} {::xotcl::is [self] type $class}\n" +"::xotcl::Object method proc {name arglist body precondition:optional postcondition:optional} {\n" +"set cmd [list my method $name $arglist $body]\n" +"if {[info exists precondition]} {lappend cmd -precondition $precondition}\n" +"if {[info exists postcondition]} {lappend cmd -postcondition $postcondition}\n" +"eval $cmd}\n" +"::xotcl::Class method proc {name arglist body precondition:optional postcondition:optional} {\n" +"set cmd [list my method -per-object $name $arglist $body]\n" +"if {[info exists precondition]} {lappend cmd -precondition $precondition}\n" +"if {[info exists postcondition]} {lappend cmd -postcondition $postcondition}\n" +"eval $cmd}\n" +"::xotcl::Class method instproc {name arglist body precondition:optional postcondition:optional} {\n" +"set cmd [list my method $name $arglist $body]\n" +"if {[info exists precondition]} {lappend cmd -precondition $precondition}\n" +"if {[info exists postcondition]} {lappend cmd -postcondition $postcondition}\n" +"eval $cmd}\n" "::xotcl::Object create ::xotcl::@\n" -"::xotcl::@ proc unknown args {}\n" +"::xotcl::@ method unknown args {}\n" "proc ::xotcl::myproc {args} {linsert $args 0 [::xotcl::self]}\n" "proc ::xotcl::myvar {var} {::xotcl::my requireNamespace; return [::xotcl::self]::$var}\n" "namespace export Object Class @ myproc myvar Attribute\n" "::xotcl::Class create ::xotcl::MetaSlot\n" "::xotcl::relation ::xotcl::MetaSlot superclass ::xotcl::Class\n" -"::xotcl::MetaSlot instproc new args {\n" +"::xotcl::MetaSlot method new args {\n" "set slotobject [::xotcl::self callingobject]::slot\n" "if {![::xotcl::is $slotobject object]} {::xotcl::Object create $slotobject}\n" "eval next -childof $slotobject $args}\n" "::xotcl::MetaSlot create ::xotcl::Slot\n" "::xotcl::MetaSlot invalidateobjectparameter\n" -"::xotcl::Object instproc objectparameter {} {\n" +"::xotcl::Object method objectparameter {} {\n" "set parameterdefinitions [list]\n" "set slots [::xotcl::objectInfo slotobjects [self]]\n" "foreach slot $slots {\n" @@ -171,30 +186,30 @@ "type}\n" "::xotcl::alias ::xotcl::Slot get ::xotcl::setinstvar\n" "::xotcl::alias ::xotcl::Slot assign ::xotcl::setinstvar\n" -"::xotcl::Slot instproc add {obj prop value {pos 0}} {\n" +"::xotcl::Slot method add {obj prop value {pos 0}} {\n" "if {![::xotcl::my multivalued]} {\n" "error \"Property $prop of [::xotcl::my 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::Slot instproc delete {-nocomplain:switch obj prop value} {\n" +"::xotcl::Slot method delete {-nocomplain:switch obj prop value} {\n" "set old [$obj set $prop]\n" "set p [lsearch -glob $old $value]\n" "if {$p>-1} {$obj set $prop [lreplace $old $p $p]} else {\n" "error \"$value is not a $prop of $obj (valid are: $old)\"}}\n" -"::xotcl::Slot instproc unknown {method args} {\n" +"::xotcl::Slot method unknown {method args} {\n" "set methods [list]\n" "foreach m [::xotcl::my info methods] {\n" "if {[::xotcl::Object info methods $m] ne \"\"} continue\n" "if {[string match __* $m]} continue\n" "lappend methods $m}\n" "error \"Method '$method' unknown for slot [::xotcl::self]; valid are: {[lsort $methods]]}\"}\n" -"::xotcl::Slot instproc destroy {} {\n" +"::xotcl::Slot method destroy {} {\n" "::xotcl::instvar domain\n" "if {$domain ne \"\"} {\n" "$domain invalidateobjectparameter}\n" "next}\n" -"::xotcl::Slot instproc init {} {\n" +"::xotcl::Slot method init {} {\n" "::xotcl::instvar name domain manager per-object\n" "set forwarder [expr {${per-object} ? \"forward\" : \"instforward\"}]\n" "if {$domain eq \"\"} {\n" @@ -206,12 +221,12 @@ "{multivalued true}\n" "{elementtype ::xotcl::Class}}\n" "::xotcl::relation ::xotcl::InfoSlot superclass ::xotcl::Slot\n" -"::xotcl::InfoSlot instproc get {obj prop} {$obj info $prop}\n" -"::xotcl::InfoSlot instproc add {obj prop value {pos 0}} {\n" +"::xotcl::InfoSlot method get {obj prop} {$obj info $prop}\n" +"::xotcl::InfoSlot method add {obj prop value {pos 0}} {\n" "if {![::xotcl::my multivalued]} {\n" "error \"Property $prop of [::xotcl::my domain]->$obj ist not multivalued\"}\n" "$obj $prop [linsert [$obj info $prop] $pos $value]}\n" -"::xotcl::InfoSlot instproc delete {-nocomplain:switch obj prop value} {\n" +"::xotcl::InfoSlot method delete {-nocomplain:switch obj prop value} {\n" "set old [$obj info $prop]\n" "if {[string first * $value] > -1 || [string first \\[ $value] > -1} {\n" "if {[my elementtype] ne \"\" && ![string match ::* $value]} {\n" @@ -231,7 +246,7 @@ "::xotcl::relation ::xotcl::InterceptorSlot superclass ::xotcl::InfoSlot\n" "::xotcl::alias ::xotcl::InterceptorSlot set ::xotcl::relation ;# for backwards compatibility\n" "::xotcl::alias ::xotcl::InterceptorSlot assign ::xotcl::relation\n" -"::xotcl::InterceptorSlot instproc add {obj prop value {pos 0}} {\n" +"::xotcl::InterceptorSlot method add {obj prop value {pos 0}} {\n" "if {![::xotcl::my multivalued]} {\n" "error \"Property $prop of [::xotcl::my domain]->$obj ist not multivalued\"}\n" "$obj $prop [linsert [$obj info $prop -guards] $pos $value]}\n" @@ -257,14 +272,14 @@ "initcmd\n" "valuecmd\n" "valuechangedcmd}\n" -"::xotcl::Attribute instproc __default_from_cmd {obj cmd var sub op} {\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::Attribute instproc __value_from_cmd {obj cmd var sub op} {\n" +"::xotcl::Attribute method __value_from_cmd {obj cmd var sub op} {\n" "$obj set $var [$obj eval $cmd]}\n" -"::xotcl::Attribute instproc __value_changed_cmd {obj cmd var sub op} {\n" +"::xotcl::Attribute method __value_changed_cmd {obj cmd var sub op} {\n" "eval $cmd}\n" -"::xotcl::Attribute instproc check_single_value {\n" +"::xotcl::Attribute method check_single_value {\n" "{-keep_old_value:boolean true}\n" "value predicate type obj var} {\n" "if {![expr $predicate]} {\n" @@ -273,11 +288,11 @@ "$obj unset -nocomplain $var}\n" "error \"'$value' is not of type $type\"}\n" "if {$keep_old_value} {$obj set __oldvalue($var) $value}}\n" -"::xotcl::Attribute instproc check_multiple_values {values predicate type obj var} {\n" +"::xotcl::Attribute method check_multiple_values {values predicate type obj var} {\n" "foreach value $values {\n" "::xotcl::my check_single_value -keep_old_value false $value $predicate $type $obj $var}\n" "$obj set __oldvalue($var) $value}\n" -"::xotcl::Attribute instproc mk_type_checker {} {\n" +"::xotcl::Attribute method mk_type_checker {} {\n" "set __initcmd \"\"\n" "if {[::xotcl::my exists type]} {\n" "::xotcl::my instvar type name\n" @@ -293,7 +308,7 @@ "append __initcmd [subst -nocommands {\n" "if {[::xotcl::my exists $name]} {::xotcl::my set __oldvalue($name) [::xotcl::my set $name]}\\n}]}\n" "return $__initcmd}\n" -"::xotcl::Attribute instproc init {} {\n" +"::xotcl::Attribute method init {} {\n" "::xotcl::my instvar domain name\n" "next ;# do first ordinary slot initialization\n" "set __initcmd \"\"\n" @@ -308,13 +323,13 @@ "if {$__initcmd ne \"\"} {\n" "my set initcmd $__initcmd}}\n" "::xotcl::Class create ::xotcl::Slot::Nocheck \\\n" -"-instproc check_single_value args {;} -instproc check_multiple_values args {;} \\\n" -"-instproc mk_type_checker args {return \"\"}\n" +"-method check_single_value args {;} -method check_multiple_values args {;} \\\n" +"-method mk_type_checker args {return \"\"}\n" "::xotcl::Class create ::xotcl::Slot::Optimizer \\\n" -"-instproc proc args {::xotcl::next; ::xotcl::my optimize} \\\n" -"-instproc forward args {::xotcl::next; ::xotcl::my optimize} \\\n" -"-instproc init args {::xotcl::next; ::xotcl::my optimize} \\\n" -"-instproc optimize {} {\n" +"-method proc args {::xotcl::next; ::xotcl::my optimize} \\\n" +"-method forward args {::xotcl::next; ::xotcl::my optimize} \\\n" +"-method init args {::xotcl::next; ::xotcl::my optimize} \\\n" +"-method optimize {} {\n" "if {[::xotcl::my multivalued]} return\n" "if {[::xotcl::my defaultmethods] ne {get assign}} return\n" "if {[::xotcl::my procsearch assign] ne \"::xotcl::Slot instcmd assign\"} return\n" @@ -326,13 +341,13 @@ "createBootstrapAttributeSlots ::xotcl::ScopedNew {\n" "{withclass ::xotcl::Object}\n" "inobject}\n" -"::xotcl::ScopedNew instproc init {} {\n" -"::xotcl::my instproc new {-childof args} {\n" +"::xotcl::ScopedNew method init {} {\n" +"::xotcl::my method new {-childof args} {\n" "[::xotcl::self class] instvar {inobject object} withclass\n" "if {![::xotcl::is $object object]} {\n" "$withclass create $object}\n" "eval ::xotcl::next -childof $object $args}}\n" -"::xotcl::Object instproc contains {\n" +"::xotcl::Object method contains {\n" "{-withnew:boolean true}\n" "-object\n" "{-class ::xotcl::Object}\n" @@ -349,7 +364,7 @@ "namespace eval $object $cmds}}\n" "::xotcl::Class instforward slots %self contains \\\n" "-object {%::xotcl::my subst [::xotcl::self]::slot}\n" -"::xotcl::Class instproc parameter arglist {\n" +"::xotcl::Class method parameter arglist {\n" "if {![::xotcl::is [::xotcl::self]::slot object]} {\n" "::xotcl::Object create [::xotcl::self]::slot}\n" "foreach arg $arglist {\n" @@ -392,33 +407,33 @@ "if {![info exists setter]} {set setter set}\n" "if {![info exists getter]} {set getter set}\n" "if {![info exists access]} {set access ::xotcl::my}\n" -"$cl instproc $name args \"\n" +"$cl method $name args \"\n" "if {\\[llength \\$args] == 0} {\n" "return \\[$access $getter $extra $name\\]} else {\n" "return \\[eval $access $setter $extra $name \\$args $defaultParam \\]}\"\n" "foreach instvar {extra defaultParam setter getter access} {\n" "$po unset -nocomplain $instvar}} else {\n" "::xotcl::my instparametercmd $name}}}\n" "[::xotcl::self]::slot set __parameter $arglist}\n" -"::xotcl::Object instproc self {} {::xotcl::self}\n" -"::xotcl::Object instproc defaultmethod {} {\n" +"::xotcl::Object method self {} {::xotcl::self}\n" +"::xotcl::Object method defaultmethod {} {\n" "return [::xotcl::self]}\n" -"::xotcl::Object instproc hasclass cl {\n" +"::xotcl::Object method hasclass cl {\n" "if {[::xotcl::is [self] mixin $cl]} {return 1}\n" "::xotcl::is [self] type $cl}\n" -"::xotcl::Class instproc allinstances {} {\n" +"::xotcl::Class method allinstances {} {\n" "return [::xotcl::my info instances -closure]}\n" -"::xotcl::Object proc unsetExitHandler {} {\n" -"::xotcl::Object proc __exitHandler {} {\n" +"::xotcl::Object method -per-object unsetExitHandler {} {\n" +"::xotcl::Object method -per-object __exitHandler {} {\n" ";}}\n" "::xotcl::Object unsetExitHandler\n" -"::xotcl::Object proc setExitHandler {newbody} {\n" -"::xotcl::Object proc __exitHandler {} $newbody}\n" -"::xotcl::Object proc getExitHandler {} {\n" +"::xotcl::Object method -per-object setExitHandler {newbody} {\n" +"::xotcl::Object method -per-object __exitHandler {} $newbody}\n" +"::xotcl::Object method -per-object getExitHandler {} {\n" "::xotcl::Object info body __exitHandler}\n" "proc ::xotcl::__exitHandler {} {\n" "::xotcl::Object __exitHandler}\n" -"::xotcl::Object instproc abstract {methtype methname arglist} {\n" +"::xotcl::Object method abstract {methtype methname arglist} {\n" "if {$methtype ne \"proc\" && $methtype ne \"instproc\" && $methtype ne \"method\"} {\n" "error \"invalid method type '$methtype', \\\n" "must be either 'proc', 'instproc' or 'method'.\"}\n" @@ -430,7 +445,7 @@ "{targetList \"\"}\n" "{dest \"\"}\n" "objLength}\n" -"::xotcl::Object::CopyHandler instproc makeTargetList t {\n" +"::xotcl::Object::CopyHandler method makeTargetList t {\n" "::xotcl::my lappend targetList $t\n" "if {[::xotcl::is $t object]} {\n" "if {[$t info hasnamespace]} {\n" @@ -441,13 +456,13 @@ "lappend children [namespace children $t]}}\n" "foreach c $children {\n" "::xotcl::my makeTargetList $c}}\n" -"::xotcl::Object::CopyHandler instproc copyNSVarsAndCmds {orig dest} {\n" +"::xotcl::Object::CopyHandler method copyNSVarsAndCmds {orig dest} {\n" "::xotcl::namespace_copyvars $orig $dest\n" "::xotcl::namespace_copycmds $orig $dest}\n" -"::xotcl::Object::CopyHandler instproc getDest origin {\n" +"::xotcl::Object::CopyHandler method getDest origin {\n" "set tail [string range $origin [::xotcl::my set objLength] end]\n" "return ::[string trimleft [::xotcl::my set dest]$tail :]}\n" -"::xotcl::Object::CopyHandler instproc copyTargets {} {\n" +"::xotcl::Object::CopyHandler method copyTargets {} {\n" "foreach origin [::xotcl::my set targetList] {\n" "set dest [::xotcl::my getDest $origin]\n" "if {[::xotcl::is $origin object]} {\n" @@ -489,15 +504,15 @@ "set newslot ${dest}::slot::[namespace tail $oldslot]\n" "if {[$oldslot domain] eq $origin} {$newslot domain $cl}\n" "if {[$oldslot manager] eq $oldslot} {$newslot manager $newslot}}}}}\n" -"::xotcl::Object::CopyHandler instproc copy {obj dest} {\n" +"::xotcl::Object::CopyHandler method copy {obj dest} {\n" "::xotcl::my set objLength [string length $obj]\n" "::xotcl::my set dest $dest\n" "::xotcl::my makeTargetList $obj\n" "::xotcl::my copyTargets}\n" -"::xotcl::Object instproc copy newName {\n" +"::xotcl::Object method copy newName {\n" "if {[string compare [string trimleft $newName :] [string trimleft [::xotcl::self] :]]} {\n" "[[::xotcl::self class]::CopyHandler new -volatile] copy [::xotcl::self] $newName}}\n" -"::xotcl::Object instproc move newName {\n" +"::xotcl::Object method move newName {\n" "if {[string trimleft $newName :] ne [string trimleft [::xotcl::self] :]} {\n" "if {$newName ne \"\"} {\n" "::xotcl::my copy $newName}\n" @@ -509,14 +524,14 @@ "$subclass superclass $scl}} }\n" "::xotcl::my destroy}}\n" "::xotcl::Object create ::xotcl::config\n" -"::xotcl::config proc load {obj file} {\n" +"::xotcl::config method load {obj file} {\n" "source $file\n" "foreach i [array names ::auto_index [list $obj *proc *]] {\n" "set type [lindex $i 1]\n" "set meth [lindex $i 2]\n" "if {[$obj info ${type}s $meth] == {}} {\n" "$obj $type $meth auto $::auto_index($i)}}}\n" -"::xotcl::config proc mkindex {meta dir args} {\n" +"::xotcl::config method mkindex {meta dir args} {\n" "set sp {[ ]+}\n" "set st {^[ ]*}\n" "set wd {([^ ;]+)}\n" @@ -566,7 +581,7 @@ "close $t\n" "cd $old\n" "return \"$oc objects, $mc methods\"}\n" -"::xotcl::Object instproc extractConfigureArg {al name {cutTheArg 0}} {\n" +"::xotcl::Object method extractConfigureArg {al name {cutTheArg 0}} {\n" "set value \"\"\n" "upvar $al argList\n" "set largs [llength $argList]\n" @@ -582,15 +597,15 @@ "set argList [lreplace $argList $startIndex [expr {$endIndex - 1}]]}\n" "return $value}\n" "::xotcl::Object create ::xotcl::rcs\n" -"::xotcl::rcs proc date string {\n" +"::xotcl::rcs method date string {\n" "lreplace [lreplace $string 0 0] end end}\n" -"::xotcl::rcs proc version string {\n" +"::xotcl::rcs method version string {\n" "lindex $string 2}\n" "if {![info exists ::env(HOME)]} {set ::env(HOME) /root}\n" "set ::xotcl::confdir ~/.xotcl\n" "set ::xotcl::logdir $::xotcl::confdir/log\n" -"::xotcl::Class proc __unknown name {}\n" -"::xotcl::Class instproc uses list {\n" +"::xotcl::Class method -per-object __unknown name {}\n" +"::xotcl::Class method uses list {\n" "foreach package $list {\n" "::xotcl::package import -into [::xotcl::self] $package\n" "puts stderr \"*** using ${package}::* in [::xotcl::self]\"}}\n" @@ -599,14 +614,14 @@ "{version 1.0}\n" "{autoexport {}}\n" "{export {}}}\n" -"::xotcl::package proc create {name args} {\n" +"::xotcl::package method -per-object create {name args} {\n" "set nq [namespace qualifiers $name]\n" "if {$nq ne \"\" && ![namespace exists $nq]} {Object create $nq}\n" "next}\n" -"::xotcl::package proc extend {name args} {\n" +"::xotcl::package method -per-object extend {name args} {\n" "my require $name\n" "eval $name configure $args}\n" -"::xotcl::package instproc contains script {\n" +"::xotcl::package method -per-object contains script {\n" "if {[my exists provide]} {\n" "package provide [my provide] [my version]} else {\n" "package provide [::xotcl::self] [::xotcl::my version]}\n" @@ -623,11 +638,11 @@ "-set component . \\\n" "-set verbose 0 \\\n" "-set packagecmd ::package\n" -"::xotcl::package proc unknown args {\n" +"::xotcl::package method -per-object unknown args {\n" "eval [my set packagecmd] $args}\n" -"::xotcl::package proc verbose value {\n" +"::xotcl::package method -per-object verbose value {\n" "my set verbose $value}\n" -"::xotcl::package proc present args {\n" +"::xotcl::package method -per-object present args {\n" "if {$::tcl_version<8.3} {\n" "my instvar loaded\n" "switch -exact -- [lindex $args 0] {\n" @@ -637,15 +652,15 @@ "return $loaded($pkg)} else {\n" "error \"not found\"}} else {\n" "eval [my set packagecmd] present $args}}\n" -"::xotcl::package proc import {{-into ::} pkg} {\n" +"::xotcl::package method -per-object import {{-into ::} pkg} {\n" "my require $pkg\n" "namespace eval $into [subst -nocommands {\n" "namespace import ${pkg}::*}]\n" "foreach e [$pkg export] {\n" "set nq [namespace qualifiers $e]\n" "if {$nq ne \"\"} {\n" "namespace eval $into$nq [list namespace import ${pkg}::$e]}}}\n" -"::xotcl::package proc require args {\n" +"::xotcl::package method -per-object require args {\n" "::xotcl::my instvar component verbose uses loaded\n" "set prevComponent $component\n" "if {[catch {set v [eval package present $args]} msg]} {\n" @@ -661,12 +676,6 @@ "set loaded($pkg) $v ;# loaded stuff needed for Tcl 8.0}}\n" "set component $prevComponent\n" "return $v}\n" -"::xotcl::Object instproc method {name arguments body} {\n" -"my proc name $arguments $body }\n" -"::xotcl::Class instproc method {-per-object:switch name arguments body} {\n" -"if {${per-object}} {\n" -"my proc $name $arguments $body} else {\n" -"my instproc $name $arguments $body}}\n" "proc ::xotcl::tmpdir {} {\n" "foreach e [list TMPDIR TEMP TMP] {\n" "if {[info exists ::env($e)] \\\n"