Index: generic/predefined.h =================================================================== diff -u -r1f0231a5c7cbb8dfef4eaf78335c9ad571863660 -r04747ba752ca2b7a4f30586348e39ab04f190da9 --- generic/predefined.h (.../predefined.h) (revision 1f0231a5c7cbb8dfef4eaf78335c9ad571863660) +++ generic/predefined.h (.../predefined.h) (revision 04747ba752ca2b7a4f30586348e39ab04f190da9) @@ -8,6 +8,10 @@ "::xotcl::alias Object [namespace tail $cmd] $cmd}\n" "foreach cmd [info command ::xotcl::cmd::Class::*] {\n" "::xotcl::alias Class [namespace tail $cmd] $cmd}\n" +"foreach cmd [list __next cleanup noinit residualargs] {\n" +"::xotcl::methodproperty Object $cmd protected 1}\n" +"foreach cmd [list recreate] {\n" +"::xotcl::methodproperty Class $cmd protected 1}\n" "::xotcl::methodproperty Object destroy static true\n" "::xotcl::methodproperty Class alloc static true\n" "::xotcl::methodproperty Class dealloc static true\n" @@ -22,13 +26,12 @@ "Object method defaultmethod {} {::xotcl::self}\n" "Object method objectparameter {} {;}\n" "Class method -per-object __unknown {name} {}\n" -"::xotcl::alias Object $cmd -objscope ::$cmd\n" -"Object method alias {-objscope:switch -protected:switch methodName cmd} {\n" +"Object method -public alias {-objscope:switch -protected:switch methodName cmd} {\n" "::xotcl::alias [self] $methodName \\\n" "{*}[expr {${objscope} ? \"-objscope\" : \"\"}] \\\n" "{*}[expr {${protected} ? \"-protected\" : \"\"}] \\\n" "$cmd}\n" -"Class method alias {-objscope:switch -per-object:switch -protected:switch methodName cmd} {\n" +"Class method -public alias {-objscope:switch -per-object:switch -protected:switch methodName cmd} {\n" "::xotcl::alias [self] $methodName \\\n" "{*}[expr {${objscope} ? \"-objscope\" : \"\"}] \\\n" "{*}[expr {${per-object} ? \"-per-object\" : \"\"}] \\\n" @@ -38,7 +41,7 @@ "Object create ::xotcl2::classInfo\n" "::xotcl::dispatch objectInfo -objscope ::eval {\n" ".alias is ::xotcl::is\n" -".method info {obj} {\n" +".method -public info {obj} {\n" "set methods [list]\n" "foreach name [::xotcl::cmd::ObjectInfo::methods [self]] {\n" "if {$name eq \"unknown\"} continue\n" @@ -87,12 +90,12 @@ "namespace export Object Class}\n" "::xotcl2::Class create ::xotcl::MetaSlot\n" "::xotcl::relation ::xotcl::MetaSlot superclass ::xotcl2::Class\n" -"::xotcl::MetaSlot method new args {\n" +"::xotcl::MetaSlot method -public new args {\n" "set slotobject [::xotcl::self callingobject]::slot\n" "if {![::xotcl::is $slotobject object]} {::xotcls::Object create $slotobject}\n" "eval next -childof $slotobject $args}\n" "::xotcl::MetaSlot create ::xotcl::Slot\n" -"::xotcl::MetaSlot invalidateobjectparameter\n" +"::xotcl::MetaSlot __invalidateobjectparameter\n" "proc ::xotcl::parametersFromSlots {obj} {\n" "set parameterdefinitions [list]\n" "set slots [::xotcl2::objectInfo slotobjects $obj]\n" @@ -150,7 +153,7 @@ "set default [::xotcl::dispatch $i -objscope ::eval subst $default]}\n" "::xotcl::setinstvar $i $att $default}}\n" "unset default}}\n" -"$class invalidateobjectparameter}\n" +"$class __invalidateobjectparameter}\n" "createBootstrapAttributeSlots ::xotcl::Slot {\n" "{name \"[namespace tail [::xotcl::self]]\"}\n" "{domain \"[lindex [regexp -inline {^(.*)::slot::[^:]+$} [::xotcl::self]] 1]\"}\n" @@ -164,13 +167,13 @@ "type}\n" "::xotcl::alias ::xotcl::Slot get ::xotcl::setinstvar\n" "::xotcl::alias ::xotcl::Slot assign ::xotcl::setinstvar\n" -"::xotcl::Slot method add {obj prop value {pos 0}} {\n" +"::xotcl::Slot method -public add {obj prop value {pos 0}} {\n" "if {![set .multivalued]} {\n" "error \"Property $prop of [set .domain]->$obj ist not multivalued\"}\n" "if {[$obj exists $prop]} {\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" +"::xotcl::Slot method -public delete {-nocomplain:switch obj prop value} {\n" "set old [::xotcl::setinstvar $obj $prop]\n" "set p [lsearch -glob $old $value]\n" "if {$p>-1} {::xotcl::setinstvar $obj $prop [lreplace $old $p $p]} else {\n" @@ -182,15 +185,15 @@ "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 method destroy {} {\n" +"::xotcl::Slot method -public destroy {} {\n" "if {${.domain} ne \"\"} {\n" -"${.domain} invalidateobjectparameter}\n" +"${.domain} __invalidateobjectparameter}\n" "next}\n" "::xotcl::Slot method init {args} {\n" "if {${.domain} eq \"\"} {\n" "set .domain [::xotcl::self callingobject]}\n" "if {${.domain} ne \"\"} {\n" -"${.domain} invalidateobjectparameter\n" +"${.domain} __invalidateobjectparameter\n" "::xotcl::dispatch ${.domain} ::xotcl::cmd::Class::forward \\\n" "{*}[expr {${.per-object} ? \"-per-object\" : \"\"}] ${.name} \\\n" "${.manager} [list %1 [${.manager} defaultmethods]] %self \\\n" @@ -201,14 +204,14 @@ "{multivalued true}\n" "{elementtype ::xotcl2::Class}}\n" "::xotcl::relation ::xotcl::InfoSlot superclass ::xotcl::Slot\n" -"::xotcl::InfoSlot method get {obj prop} {\n" +"::xotcl::InfoSlot method -public get {obj prop} {\n" "$obj info $prop}\n" -"::xotcl::InfoSlot method add {obj prop value {pos 0}} {\n" +"::xotcl::InfoSlot method -public add {obj prop value {pos 0}} {\n" "if {![set .multivalued]} {\n" "error \"Property $prop of ${.domain}->$obj ist not multivalued\"}\n" "puts stderr \"adding infoslot: $obj $prop [linsert [$obj info $prop] $pos $value]\"\n" "$obj $prop [linsert [$obj info $prop] $pos $value]}\n" -"::xotcl::InfoSlot method delete {-nocomplain:switch obj prop value} {\n" +"::xotcl::InfoSlot method -public delete {-nocomplain:switch obj prop value} {\n" "puts stderr infoslot-delete-[self args]\n" "set old [$obj info $prop]\n" "if {[string first * $value] > -1 || [string first \\[ $value] > -1} {\n" @@ -229,9 +232,9 @@ "::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 method get {obj -per-object:switch prop} {\n" +"::xotcl::InterceptorSlot method -public get {obj -per-object:switch prop} {\n" "::xotcl::relation $obj {*}[expr {${per-object} ? \"-per-object\" : \"\"}] $prop}\n" -"::xotcl::InterceptorSlot method add {obj -per-object:switch prop value {pos 0}} {\n" +"::xotcl::InterceptorSlot method -public add {obj -per-object:switch prop value {pos 0}} {\n" "if {![set .multivalued]} {\n" "error \"Property $prop of ${.domain}->$obj ist not multivalued\"}\n" "set perObject [expr {${per-object} ? \"-per-object\" : \"\"}]\n" @@ -249,7 +252,7 @@ "::xotcl::InterceptorSlot create ${os}::Object::slot::filter \\\n" "-elementtype \"\" -type relation}\n" "::xotcl::register_system_slots ::xotcl2\n" -"::xotcl::MetaSlot invalidateobjectparameter\n" +"::xotcl::MetaSlot __invalidateobjectparameter\n" "::xotcl::MetaSlot create ::xotcl::Attribute -superclass ::xotcl::Slot\n" "createBootstrapAttributeSlots ::xotcl::Attribute {\n" "{value_check once}\n" @@ -306,10 +309,10 @@ ".method check_multiple_values args {;}\n" ".method mk_type_checker args {return \"\"}}\n" "::xotcl2::Class create ::xotcl::Slot::Optimizer {\n" -".method proc args {::xotcl::next; .optimize}\n" +".method method args {::xotcl::next; .optimize}\n" ".method forward args {::xotcl::next; .optimize}\n" ".method init args {::xotcl::next; .optimize}\n" -".method optimize {} {\n" +".method -public optimize {} {\n" "if {[set .multivalued]} return\n" "if {[set .defaultmethods] ne {get assign}} return\n" "if {[.info callable -which assign] ne \"::xotcl::Slot alias assign ::xotcl::setinstvar\"} return\n" @@ -321,12 +324,12 @@ "{withclass ::xotcl2::Object}\n" "inobject}\n" "::xotcl::ScopedNew method init {} {\n" -".method new {-childof args} {\n" +".method -public new {-childof args} {\n" "::xotcl::instvar -object [::xotcl::self class] {inobject object} withclass\n" "if {![::xotcl::is $object object]} {\n" "$withclass create $object}\n" "eval ::xotcl::next -childof $object $args}}\n" -"::xotcl2::Object method contains {\n" +"::xotcl2::Object method -public contains {\n" "{-withnew:boolean true}\n" "-object\n" "{-class ::xotcl2::Object}\n" @@ -343,7 +346,7 @@ "namespace eval $object $cmds}}\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" +"::xotcl2::Class method -public parameter arglist {\n" "if {![::xotcl::is [::xotcl::self]::slot object]} {\n" "::xotcl2::Object create [::xotcl::self]::slot}\n" "foreach arg $arglist {\n" @@ -386,7 +389,7 @@ "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 method $name args \"\n" +"$cl method -public $name args \"\n" "if {\\[llength \\$args] == 0} {\n" "return \\[$access $getter $extra $name\\]} else {\n" "return \\[eval $access $setter $extra $name \\$args $defaultParam \\]}\"\n" @@ -457,15 +460,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" -".method copy {obj dest} {\n" +".method -public copy {obj dest} {\n" "set .objLength [string length $obj]\n" "set .dest $dest\n" ".makeTargetList $obj\n" ".copyTargets}}\n" -"::xotcl2::Object method copy newName {\n" +"::xotcl2::Object method -public copy newName {\n" "if {[string compare [string trimleft $newName :] [string trimleft [::xotcl::self] :]]} {\n" "[::xotcl::CopyHandler new -volatile] copy [::xotcl::self] $newName}}\n" -"::xotcl2::Object method move newName {\n" +"::xotcl2::Object method -public move newName {\n" "if {[string trimleft $newName :] ne [string trimleft [::xotcl::self] :]} {\n" "if {$newName ne \"\"} {\n" ".copy $newName}\n"