Index: xotcl/generic/predefined.h =================================================================== diff -u -r1aa7246cc8e44078c9dbd33e03992478615f314f -r20e421dc641dc39b53106b1296ac7e09d0b206f2 --- xotcl/generic/predefined.h (.../predefined.h) (revision 1aa7246cc8e44078c9dbd33e03992478615f314f) +++ xotcl/generic/predefined.h (.../predefined.h) (revision 20e421dc641dc39b53106b1296ac7e09d0b206f2) @@ -1,51 +1,38 @@ static char cmd[] = -"# $Id: predefined.h,v 1.12 2006/09/27 08:12:40 neumann Exp $\n" -"foreach cmd [info command ::xotcl::Object::instcmd::*] {\n" +"# $Id: predefined.h,v 1.13 2006/10/04 20:40:23 neumann Exp $\n" +"if {[info command oo::object] ne \"\"} {\n" +"::xotcl::alias ::oo::class alloc ::xotcl::cmd::Class::alloc\n" +"oo::class alloc ::xotcl::Object\n" +"oo::class alloc ::xotcl::Class\n" +"::xotcl::setrelation ::xotcl::Class superclass {::oo::class ::xotcl::Object}\n" +"::xotcl::setrelation ::xotcl::Object class ::xotcl::Class\n" +"::xotcl::setrelation ::xotcl::Class class ::xotcl::Class}\n" +"foreach cmd [info command ::xotcl::cmd::Object::*] {\n" "::xotcl::alias ::xotcl::Object [namespace tail $cmd] $cmd}\n" "foreach cmd {array append eval incr lappend trace subst unset} {\n" "::xotcl::alias ::xotcl::Object $cmd -objscope ::$cmd}\n" -"foreach cmd [info command ::xotcl::Class::instcmd::*] {\n" +"foreach cmd [info command ::xotcl::cmd::Class::*] {\n" "::xotcl::alias ::xotcl::Class [namespace tail $cmd] $cmd}\n" -"unset cmd\n" "::xotcl::Object instproc init args {}\n" +"::xotcl::Class array set __defaults {__default_superclass ::xotcl::Object}\n" +"::xotcl::Class instparametercmd __default_superclass\n" +"::xotcl::Class set __default_superclass ::xotcl::Object\n" +"::xotcl::Class create ::xotcl::NonposArgs\n" +"foreach cmd [info command ::xotcl::cmd::NonposArgs::*] {\n" +"::xotcl::alias ::xotcl::NonposArgs [namespace tail $cmd] $cmd}\n" +"::xotcl::NonposArgs create ::xotcl::nonposArgs\n" +"unset cmd\n" "::xotcl::Object create ::xotcl::@\n" "::xotcl::@ proc 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 eval ::xotcl { namespace export @ myproc myvar Attribute}\n" -"::xotcl::setrelation ::xotcl::Class::Parameter superclass ::xotcl::Class\n" -"::xotcl::Class::Parameter instproc mkParameter {obj name args} {\n" -"if {[$obj exists $name]} {\n" -"eval [$obj set $name] configure $args} else {\n" -"$obj set $name [eval ::xotcl::my new -childof $obj $args]}}\n" -"::xotcl::Class::Parameter instproc getParameter {obj name args} {\n" -"[$obj set $name]}\n" -"::xotcl::Class::Parameter proc Class {param args} {\n" -"::xotcl::my set access [lindex $param 0]\n" -"::xotcl::my set setter mkParameter\n" -"::xotcl::my set getter getParameter\n" -"::xotcl::my set extra {[::xotcl::self]}\n" -"::xotcl::my set defaultParam [lrange $param 1 end]}\n" -"::xotcl::Class::Parameter proc default {val} {\n" -"[::xotcl::my set cl] set __defaults([::xotcl::my set name]) $val}\n" -"::xotcl::Class::Parameter proc setter x {\n" -"::xotcl::my set setter $x}\n" -"::xotcl::Class::Parameter proc getter x {\n" -"::xotcl::my set getter $x}\n" -"::xotcl::Class::Parameter proc access obj {\n" -"::xotcl::my set access $obj\n" -"::xotcl::my set extra \\[::xotcl::self\\]\n" -"foreach v [$obj info vars] {::xotcl::my set $v [$obj set $v]}}\n" -"::xotcl::Class::Parameter proc values {param args} {\n" -"set cl [::xotcl::my set cl]\n" -"set ci [$cl info instinvar]\n" -"set valueTest {}\n" -"foreach a $args {\n" -"::lappend valueTest \"\\[\\$cl set $param\\] == [list $a]\"}\n" -"::lappend ci [join $valueTest \" || \"]\n" -"$cl instinvar $ci}\n" +"namespace eval ::xotcl { namespace export Object Class @ myproc myvar Attribute}\n" +"# }\n" +"# ::xotcl::my set getter $x\n" +"# }\n" "::xotcl::Class create ::xotcl::MetaSlot\n" "::xotcl::setrelation ::xotcl::MetaSlot superclass ::xotcl::Class\n" +"::xotcl::MetaSlot initslots\n" "::xotcl::MetaSlot instproc new args {\n" "set slotobject [self callingobject]::slot\n" "if {![my isobject $slotobject]} {Object create $slotobject}\n" @@ -198,7 +185,7 @@ "::xotcl::ScopedNew instparametercmd withclass\n" "::xotcl::ScopedNew instparametercmd inobject\n" "::xotcl::ScopedNew instproc init {} {\n" -"::xotcl::my instproc new args {\n" +"::xotcl::my instproc new {-childof args} {\n" "[::xotcl::self class] instvar {inobject object} withclass\n" "if {![::xotcl::my isobject $object]} {\n" "$withclass create $object}\n" @@ -214,7 +201,7 @@ "if {$withnew} {\n" "set m [::xotcl::ScopedNew new \\\n" "-inobject $object -withclass $class -volatile]\n" -"::xotcl::Class instmixin add $m\n" +"::xotcl::Class instmixin add $m end\n" "namespace eval $object $cmds\n" "::xotcl::Class instmixin delete $m} else {\n" "namespace eval $object $cmds}}\n" @@ -274,6 +261,8 @@ "::xotcl::Object proc __exitHandler {} $newbody}\n" "::xotcl::Object proc getExitHandler {} {\n" "::xotcl::Object info body __exitHandler}\n" +"proc ::xotcl::__exitHandler {} {\n" +"::xotcl::Object __exitHandler}\n" "::xotcl::Object instproc abstract {methtype methname arglist} {\n" "if {$methtype ne \"proc\" && $methtype ne \"instproc\"} {\n" "error \"invalid method type '$methtype', \\\n" @@ -311,7 +300,6 @@ "set cl [[$origin info class] create $dest -noinit]\n" "set obj $cl\n" "$cl superclass [$origin info superclass]\n" -"$cl parameterclass [$origin info parameterclass]\n" "$cl instinvar [$origin info instinvar]\n" "$cl instfilter [$origin info instfilter -guards]\n" "$cl instmixin [$origin info instmixin]\n" @@ -324,7 +312,22 @@ "if {[$origin info hasNamespace]} {\n" "$obj requireNamespace}} else {\n" "namespace eval $dest {}}\n" -"::xotcl::my copyNSVarsAndCmds $origin $dest}\n" +"::xotcl::my copyNSVarsAndCmds $origin $dest\n" +"foreach i [$origin info forward] {\n" +"eval [concat $dest forward $i [$origin info forward -definition $i]]}\n" +"if {[::xotcl::my isclass $origin]} {\n" +"foreach i [$origin info instforward] {\n" +"eval [concat $dest instforward $i [$origin info instforward -definition $i]]}}\n" +"set traces [list]\n" +"foreach var [$origin info vars] {\n" +"set cmds [$origin trace info variable $var]\n" +"if {$cmds ne \"\"} {\n" +"foreach cmd $cmds {\n" +"foreach {op def} $cmd break\n" +"$origin trace remove variable $var $op $def\n" +"if {[lindex $def 0] eq $origin} {\n" +"set def [concat $dest [lrange $def 1 end]]}\n" +"$dest trace add variable $var $op $def}}}}\n" "set origin [lindex [::xotcl::my set targetList] 0]\n" "if {[::xotcl::my isclass $origin]} {\n" "foreach oldslot [$origin info slots] {\n"