Index: generic/gentclAPI.decls =================================================================== diff -u -r81c800c8b9cb42ef6743d9b80ac2be5ca211a69a -r3f0573cc75724179f416942b974373e5a62ec05e --- generic/gentclAPI.decls (.../gentclAPI.decls) (revision 81c800c8b9cb42ef6743d9b80ac2be5ca211a69a) +++ generic/gentclAPI.decls (.../gentclAPI.decls) (revision 3f0573cc75724179f416942b974373e5a62ec05e) @@ -5,12 +5,12 @@ # namespaces for types of methods array set ns { - xotclCmd "::next::core" - objectMethod "::next::core::cmd::Object" - classMethod "::next::core::cmd::Class" - checkMethod "::next::core::cmd::ParameterType" - infoClassMethod "::next::core::cmd::ClassInfo" - infoObjectMethod "::next::core::cmd::ObjectInfo" + xotclCmd "::nx::core" + objectMethod "::nx::core::cmd::Object" + classMethod "::nx::core::cmd::Class" + checkMethod "::nx::core::cmd::ParameterType" + infoClassMethod "::nx::core::cmd::ClassInfo" + infoObjectMethod "::nx::core::cmd::ObjectInfo" } # Index: generic/predefined.h =================================================================== diff -u -r81c800c8b9cb42ef6743d9b80ac2be5ca211a69a -r3f0573cc75724179f416942b974373e5a62ec05e --- generic/predefined.h (.../predefined.h) (revision 81c800c8b9cb42ef6743d9b80ac2be5ca211a69a) +++ generic/predefined.h (.../predefined.h) (revision 3f0573cc75724179f416942b974373e5a62ec05e) @@ -1,8 +1,8 @@ static char cmd[] = "\n" -"namespace eval ::next {\n" +"namespace eval ::nx {\n" "set bootstrap 1\n" -"::next::core::createobjectsystem ::next::Object ::next::Class {\n" +"::nx::core::createobjectsystem ::nx::Object ::nx::Class {\n" "-class.alloc alloc\n" "-class.create create\n" "-class.dealloc dealloc\n" @@ -16,117 +16,117 @@ "-object.objectparameter objectparameter\n" "-object.residualargs residualargs\n" "-object.unknown unknown}\n" -"namespace eval ::next::core {\n" +"namespace eval ::nx::core {\n" "namespace export next self \\\n" "my is relation interp}\n" -"namespace import ::next::core::next ::next::core::self\n" -"foreach cmd [info command ::next::core::cmd::Object::*] {\n" +"namespace import ::nx::core::next ::nx::core::self\n" +"foreach cmd [info command ::nx::core::cmd::Object::*] {\n" "set cmdName [namespace tail $cmd]\n" "if {$cmdName in [list \"instvar\"]} continue\n" -"::next::core::alias Object $cmdName $cmd}\n" -"::next::core::alias Object eval -nonleaf ::eval\n" -"foreach cmd [info command ::next::core::cmd::Class::*] {\n" +"::nx::core::alias Object $cmdName $cmd}\n" +"::nx::core::alias Object eval -nonleaf ::eval\n" +"foreach cmd [info command ::nx::core::cmd::Class::*] {\n" "set cmdName [namespace tail $cmd]\n" -"::next::core::alias Class $cmdName $cmd}\n" +"::nx::core::alias Class $cmdName $cmd}\n" "foreach cmd [list __next cleanup noinit residualargs uplevel upvar] {\n" -"::next::core::methodproperty Object $cmd protected 1}\n" +"::nx::core::methodproperty Object $cmd protected 1}\n" "foreach cmd [list recreate] {\n" -"::next::core::methodproperty Class $cmd protected 1}\n" -"::next::core::methodproperty Object destroy redefine-protected true\n" -"::next::core::methodproperty Class alloc redefine-protected true\n" -"::next::core::methodproperty Class dealloc redefine-protected true\n" -"::next::core::methodproperty Class create redefine-protected true\n" -"::next::core::method Class method {\n" +"::nx::core::methodproperty Class $cmd protected 1}\n" +"::nx::core::methodproperty Object destroy redefine-protected true\n" +"::nx::core::methodproperty Class alloc redefine-protected true\n" +"::nx::core::methodproperty Class dealloc redefine-protected true\n" +"::nx::core::methodproperty Class create redefine-protected true\n" +"::nx::core::method Class method {\n" "name arguments body -precondition -postcondition} {\n" "set conditions [list]\n" "if {[info exists precondition]} {lappend conditions -precondition $precondition}\n" "if {[info exists postcondition]} {lappend conditions -postcondition $postcondition}\n" -"::next::core::method [::next::core::current object] $name $arguments $body {*}$conditions}\n" -"::next::core::method Object method {\n" +"::nx::core::method [::nx::core::current object] $name $arguments $body {*}$conditions}\n" +"::nx::core::method Object method {\n" "name arguments body -precondition -postcondition} {\n" "set conditions [list]\n" "if {[info exists precondition]} {lappend conditions -precondition $precondition}\n" "if {[info exists postcondition]} {lappend conditions -postcondition $postcondition}\n" -"::next::core::method [::next::core::current object] -per-object $name $arguments $body {*}$conditions}\n" +"::nx::core::method [::nx::core::current object] -per-object $name $arguments $body {*}$conditions}\n" "Class eval {\n" ":method object {what args} {\n" "if {$what in [list \"alias\" \"attribute\" \"forward\" \"method\" \"setter\"]} {\n" -"return [::next::core::dispatch [::next::core::current object] ::next::core::classes::next::Object::$what {*}$args]}\n" +"return [::nx::core::dispatch [::nx::core::current object] ::nx::core::classes::nx::Object::$what {*}$args]}\n" "if {$what in [list \"info\"]} {\n" -"return [::next::objectInfo [lindex $args 0] [::next::core::current object] {*}[lrange $args 1 end]]}\n" +"return [::nx::objectInfo [lindex $args 0] [::nx::core::current object] {*}[lrange $args 1 end]]}\n" "if {$what in [list \"filter\" \"mixin\"]} {\n" "return [:object-$what {*}$args]}\n" "if {$what in [list \"filterguard\" \"mixinguard\"]} {\n" -"return [::next::core::dispatch [::next::core::current object] ::next::core::cmd::Object::$what {*}$args]}}\n" +"return [::nx::core::dispatch [::nx::core::current object] ::nx::core::cmd::Object::$what {*}$args]}}\n" ":method unknown {m args} {\n" -"error \"Method '$m' unknown for [::next::core::current object].\\\n" -"Consider '[::next::core::current object] create $m $args' instead of '[::next::core::current object] $m $args'\"}\n" -"::next::core::methodproperty [::next::core::current object] unknown protected 1}\n" +"error \"Method '$m' unknown for [::nx::core::current object].\\\n" +"Consider '[::nx::core::current object] create $m $args' instead of '[::nx::core::current object] $m $args'\"}\n" +"::nx::core::methodproperty [::nx::core::current object] unknown protected 1}\n" "Object eval {\n" ":method public {args} {\n" "set p [lsearch -regexp $args {^(method|alias|attribute|forward|setter)$}]\n" "if {$p == -1} {error \"$args is not a method defining method\"}\n" "set r [{*}:$args]\n" -"::next::core::methodproperty [::next::core::current object] $r protected false\n" +"::nx::core::methodproperty [::nx::core::current object] $r protected false\n" "return $r}\n" ":method protected {args} {\n" "set p [lsearch -regexp $args {^(method|alias|attribute|forward|setter)$}]\n" "if {$p == -1} {error \"$args is not a method defining command\"}\n" "set r [{*}:$args]\n" -"::next::core::methodproperty [::next::core::current object] $r [::next::core::current method] true\n" +"::nx::core::methodproperty [::nx::core::current object] $r [::nx::core::current method] true\n" "return $r}\n" ":protected method unknown {m args} {\n" -"if {![::next::core::current isnext]} {\n" -"error \"[::next::core::current object]: unable to dispatch method '$m'\"}}\n" +"if {![::nx::core::current isnext]} {\n" +"error \"[::nx::core::current object]: unable to dispatch method '$m'\"}}\n" ":protected method init args {}\n" -":protected method defaultmethod {} {::next::core::current object}\n" +":protected method defaultmethod {} {::nx::core::current object}\n" ":protected method objectparameter {} {;}}\n" -"::next::core::forward Object forward ::next::core::forward %self -per-object\n" -"::next::core::forward Class forward ::next::core::forward %self\n" +"::nx::core::forward Object forward ::nx::core::forward %self -per-object\n" +"::nx::core::forward Class forward ::nx::core::forward %self\n" "Class protected object method __unknown {name} {}\n" "Object public method alias {-nonleaf:switch -objscope:switch methodName cmd} {\n" -"::next::core::alias [::next::core::current object] -per-object $methodName \\\n" +"::nx::core::alias [::nx::core::current object] -per-object $methodName \\\n" "{*}[expr {${objscope} ? \"-objscope\" : \"\"}] \\\n" "{*}[expr {${nonleaf} ? \"-nonleaf\" : \"\"}] \\\n" "$cmd}\n" "Class public method alias {-nonleaf:switch -objscope:switch methodName cmd} {\n" -"::next::core::alias [::next::core::current object] $methodName \\\n" +"::nx::core::alias [::nx::core::current object] $methodName \\\n" "{*}[expr {${objscope} ? \"-objscope\" : \"\"}] \\\n" "{*}[expr {${nonleaf} ? \"-nonleaf\" : \"\"}] \\\n" "$cmd}\n" "Object public method setter {methodName} {\n" -"::next::core::setter [::next::core::current object] -per-object $methodName}\n" +"::nx::core::setter [::nx::core::current object] -per-object $methodName}\n" "Class public method setter {methodName} {\n" -"::next::core::setter [::next::core::current object] $methodName}\n" -"Object create ::next::objectInfo\n" -"Object create ::next::classInfo\n" +"::nx::core::setter [::nx::core::current object] $methodName}\n" +"Object create ::nx::objectInfo\n" +"Object create ::nx::classInfo\n" "objectInfo eval {\n" -":alias is ::next::core::objectproperty\n" +":alias is ::nx::core::objectproperty\n" ":public method info {obj} {\n" "set methods [list]\n" -"foreach name [::next::core::cmd::ObjectInfo::methods [::next::core::current object]] {\n" +"foreach name [::nx::core::cmd::ObjectInfo::methods [::nx::core::current object]] {\n" "if {$name eq \"unknown\"} continue\n" "lappend methods $name}\n" "return \"valid options are: [join [lsort $methods] {, }]\"}\n" ":method unknown {method obj args} {\n" -"error \"[::next::core::current object] unknown info option \\\"$method\\\"; [$obj info info]\"}}\n" +"error \"[::nx::core::current object] unknown info option \\\"$method\\\"; [$obj info info]\"}}\n" "classInfo eval {\n" -":alias is ::next::core::objectproperty\n" -":alias classparent ::next::core::cmd::ObjectInfo::parent\n" -":alias classchildren ::next::core::cmd::ObjectInfo::children\n" -":alias info [::next::core::cmd::ObjectInfo::method objectInfo name info]\n" -":alias unknown [::next::core::cmd::ObjectInfo::method objectInfo name info]}\n" -"foreach cmd [info command ::next::core::cmd::ObjectInfo::*] {\n" -"::next::core::alias ::next::objectInfo [namespace tail $cmd] $cmd\n" -"::next::core::alias ::next::classInfo [namespace tail $cmd] $cmd}\n" -"foreach cmd [info command ::next::core::cmd::ClassInfo::*] {\n" +":alias is ::nx::core::objectproperty\n" +":alias classparent ::nx::core::cmd::ObjectInfo::parent\n" +":alias classchildren ::nx::core::cmd::ObjectInfo::children\n" +":alias info [::nx::core::cmd::ObjectInfo::method objectInfo name info]\n" +":alias unknown [::nx::core::cmd::ObjectInfo::method objectInfo name info]}\n" +"foreach cmd [info command ::nx::core::cmd::ObjectInfo::*] {\n" +"::nx::core::alias ::nx::objectInfo [namespace tail $cmd] $cmd\n" +"::nx::core::alias ::nx::classInfo [namespace tail $cmd] $cmd}\n" +"foreach cmd [info command ::nx::core::cmd::ClassInfo::*] {\n" "set cmdName [namespace tail $cmd]\n" "if {$cmdName in [list \"object-mixin-of\" \"class-mixin-of\"]} continue\n" -"::next::core::alias ::next::classInfo $cmdName $cmd}\n" +"::nx::core::alias ::nx::classInfo $cmdName $cmd}\n" "unset cmd\n" -"Object forward info -onerror ::next::core::infoError ::next::objectInfo %1 {%@2 %self}\n" -"Class forward info -onerror ::next::core::infoError ::next::classInfo %1 {%@2 %self}\n" -"proc ::next::core::infoError msg {\n" +"Object forward info -onerror ::nx::core::infoError ::nx::objectInfo %1 {%@2 %self}\n" +"Class forward info -onerror ::nx::core::infoError ::nx::classInfo %1 {%@2 %self}\n" +"proc ::nx::core::infoError msg {\n" "regsub -all \" \" $msg \"\" msg\n" "regsub -all \" \" $msg \"\" msg\n" "regsub {\\\"} $msg \"\\\"info \" msg\n" @@ -135,27 +135,27 @@ "if {$methtype ne \"method\"} {\n" "error \"invalid method type '$methtype', must be 'method'\"}\n" "set body \"\n" -"if {!\\[::next::core::current isnextcall\\]} {\n" -"error \\\"Abstract method $methname $arglist called\\\"} else {::next::core::next}\n" +"if {!\\[::nx::core::current isnextcall\\]} {\n" +"error \\\"Abstract method $methname $arglist called\\\"} else {::nx::core::next}\n" "\"\n" "if {${per-object}} {\n" ":method -per-object $methname $arglist $body} else {\n" ":method $methname $arglist $body}}\n" -"proc ::next::core::unsetExitHandler {} {\n" -"proc ::next::core::__exitHandler {} {}}\n" -"proc ::next::core::setExitHandler {newbody} {::proc ::next::core::__exitHandler {} $newbody}\n" -"proc ::next::core::getExitHandler {} {::info body ::next::core::__exitHandler}\n" -"::next::core::unsetExitHandler\n" +"proc ::nx::core::unsetExitHandler {} {\n" +"proc ::nx::core::__exitHandler {} {}}\n" +"proc ::nx::core::setExitHandler {newbody} {::proc ::nx::core::__exitHandler {} $newbody}\n" +"proc ::nx::core::getExitHandler {} {::info body ::nx::core::__exitHandler}\n" +"::nx::core::unsetExitHandler\n" "namespace export Object Class next self}\n" -"namespace eval ::next {\n" -"::next::Class create ::next::MetaSlot\n" -"::next::core::relation ::next::MetaSlot superclass ::next::Class\n" -"::next::MetaSlot public method slotName {name baseObject} {\n" +"namespace eval ::nx {\n" +"::nx::Class create ::nx::MetaSlot\n" +"::nx::core::relation ::nx::MetaSlot superclass ::nx::Class\n" +"::nx::MetaSlot public method slotName {name baseObject} {\n" "set slotParent ${baseObject}::slot\n" -"if {![::next::core::objectproperty ${slotParent} object]} {\n" -"::next::Object create ${slotParent}}\n" +"if {![::nx::core::objectproperty ${slotParent} object]} {\n" +"::nx::Object create ${slotParent}}\n" "return ${slotParent}::$name}\n" -"::next::MetaSlot method createFromParameterSyntax {target -per-object:switch\n" +"::nx::MetaSlot method createFromParameterSyntax {target -per-object:switch\n" "{-initblock \"\"}\n" "value default:optional} {\n" "set opts [list]\n" @@ -182,87 +182,87 @@ "set info ObjectInfo} else {\n" "set info ClassInfo}\n" ":create [:slotName $name $target] {*}$opts $initblock\n" -"return [::next::core::cmd::${info}::method $target name $name]}\n" -"::next::MetaSlot create ::next::Slot\n" -"::next::MetaSlot create ::next::ObjectParameterSlot\n" -"::next::core::relation ::next::ObjectParameterSlot superclass ::next::Slot\n" -"::next::MetaSlot create ::next::MethodParameterSlot\n" -"::next::core::relation ::next::MethodParameterSlot superclass ::next::Slot\n" -"::next::MethodParameterSlot create ::next::methodParameterSlot\n" +"return [::nx::core::cmd::${info}::method $target name $name]}\n" +"::nx::MetaSlot create ::nx::Slot\n" +"::nx::MetaSlot create ::nx::ObjectParameterSlot\n" +"::nx::core::relation ::nx::ObjectParameterSlot superclass ::nx::Slot\n" +"::nx::MetaSlot create ::nx::MethodParameterSlot\n" +"::nx::core::relation ::nx::MethodParameterSlot superclass ::nx::Slot\n" +"::nx::MethodParameterSlot create ::nx::methodParameterSlot\n" "proc createBootstrapAttributeSlots {class definitions} {\n" "foreach att $definitions {\n" "if {[llength $att]>1} {foreach {att default} $att break}\n" -"set slotObj [::next::ObjectParameterSlot slotName $att $class]\n" -"::next::ObjectParameterSlot create $slotObj\n" +"set slotObj [::nx::ObjectParameterSlot slotName $att $class]\n" +"::nx::ObjectParameterSlot create $slotObj\n" "if {[info exists default]} {\n" -"::next::core::setvar $slotObj default $default\n" +"::nx::core::setvar $slotObj default $default\n" "unset default}\n" -"::next::core::setter $class $att}\n" +"::nx::core::setter $class $att}\n" "foreach att $definitions {\n" "if {[llength $att]>1} {foreach {att default} $att break}\n" "if {[info exists default]} {\n" -"foreach i [::next::core::cmd::ClassInfo::instances $class] {\n" +"foreach i [::nx::core::cmd::ClassInfo::instances $class] {\n" "if {![$i exists $att]} {\n" "if {[string match {*\\[*\\]*} $default]} {\n" -"set value [::next::core::dispatch $i -objscope ::eval subst $default]} else {\n" +"set value [::nx::core::dispatch $i -objscope ::eval subst $default]} else {\n" "set value $default}\n" -"::next::core::setvar $i $att $value}}\n" +"::nx::core::setvar $i $att $value}}\n" "unset default}}\n" "$class __invalidateobjectparameter}\n" -"createBootstrapAttributeSlots ::next::Slot {\n" +"createBootstrapAttributeSlots ::nx::Slot {\n" "{name}\n" "{multivalued false}\n" "{required false}\n" "default\n" "type}\n" -"createBootstrapAttributeSlots ::next::ObjectParameterSlot {\n" -"{name \"[namespace tail [::next::core::current object]]\"}\n" +"createBootstrapAttributeSlots ::nx::ObjectParameterSlot {\n" +"{name \"[namespace tail [::nx::core::current object]]\"}\n" "{methodname}\n" -"{domain \"[lindex [regexp -inline {^(.*)::slot::[^:]+$} [::next::core::current object]] 1]\"}\n" +"{domain \"[lindex [regexp -inline {^(.*)::slot::[^:]+$} [::nx::core::current object]] 1]\"}\n" "{defaultmethods {get assign}}\n" -"{manager \"[::next::core::current object]\"}\n" +"{manager \"[::nx::core::current object]\"}\n" "{per-object false}}\n" -"::next::core::alias ::next::ObjectParameterSlot get ::next::core::setvar\n" -"::next::core::alias ::next::ObjectParameterSlot assign ::next::core::setvar\n" -"::next::ObjectParameterSlot public method add {obj prop value {pos 0}} {\n" +"::nx::core::alias ::nx::ObjectParameterSlot get ::nx::core::setvar\n" +"::nx::core::alias ::nx::ObjectParameterSlot assign ::nx::core::setvar\n" +"::nx::ObjectParameterSlot public method 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" -"::next::core::setvar $obj $prop [linsert [::next::core::setvar $obj $prop] $pos $value]} else {\n" -"::next::core::setvar $obj $prop [list $value]}}\n" -"::next::ObjectParameterSlot public method delete {-nocomplain:switch obj prop value} {\n" -"set old [::next::core::setvar $obj $prop]\n" +"::nx::core::setvar $obj $prop [linsert [::nx::core::setvar $obj $prop] $pos $value]} else {\n" +"::nx::core::setvar $obj $prop [list $value]}}\n" +"::nx::ObjectParameterSlot public method delete {-nocomplain:switch obj prop value} {\n" +"set old [::nx::core::setvar $obj $prop]\n" "set p [lsearch -glob $old $value]\n" -"if {$p>-1} {::next::core::setvar $obj $prop [lreplace $old $p $p]} else {\n" +"if {$p>-1} {::nx::core::setvar $obj $prop [lreplace $old $p $p]} else {\n" "error \"$value is not a $prop of $obj (valid are: $old)\"}}\n" -"::next::ObjectParameterSlot method unknown {method args} {\n" +"::nx::ObjectParameterSlot method unknown {method args} {\n" "set methods [list]\n" "foreach m [:info callable] {\n" -"if {[::next::Object info callable $m] ne \"\"} continue\n" +"if {[::nx::Object info callable $m] ne \"\"} continue\n" "if {[string match __* $m]} continue\n" "lappend methods $m}\n" -"error \"Method '$method' unknown for slot [::next::core::current object]; valid are: {[lsort $methods]}\"}\n" -"::next::ObjectParameterSlot public method destroy {} {\n" -"if {${:domain} ne \"\" && [::next::core::objectproperty ${:domain} class]} {\n" +"error \"Method '$method' unknown for slot [::nx::core::current object]; valid are: {[lsort $methods]}\"}\n" +"::nx::ObjectParameterSlot public method destroy {} {\n" +"if {${:domain} ne \"\" && [::nx::core::objectproperty ${:domain} class]} {\n" "${:domain} __invalidateobjectparameter}\n" -"::next::core::next}\n" -"::next::ObjectParameterSlot protected method init {args} {\n" +"::nx::core::next}\n" +"::nx::ObjectParameterSlot protected method init {args} {\n" "if {${:domain} eq \"\"} {\n" -"set :domain [::next::core::current callingobject]}\n" +"set :domain [::nx::core::current callingobject]}\n" "if {${:domain} ne \"\"} {\n" "if {![info exists :methodname]} {\n" "set :methodname ${:name}}\n" -"if {[::next::core::objectproperty ${:domain} class]} {\n" +"if {[::nx::core::objectproperty ${:domain} class]} {\n" "${:domain} __invalidateobjectparameter}\n" "if {${:per-object} && [info exists :default] } {\n" -"::next::core::setvar ${:domain} ${:name} ${:default}}\n" +"::nx::core::setvar ${:domain} ${:name} ${:default}}\n" "set cl [expr {${:per-object} ? \"Object\" : \"Class\"}]\n" -"::next::core::forward ${:domain} ${:name} \\\n" +"::nx::core::forward ${:domain} ${:name} \\\n" "${:manager} \\\n" "[list %1 [${:manager} defaultmethods]] %self \\\n" "${:methodname}}}\n" -"::next::MetaSlot __invalidateobjectparameter\n" -"::next::ObjectParameterSlot method toParameterSyntax {{name:substdefault ${:name}}} {\n" +"::nx::MetaSlot __invalidateobjectparameter\n" +"::nx::ObjectParameterSlot method toParameterSyntax {{name:substdefault ${:name}}} {\n" "set objparamdefinition $name\n" "set methodparamdefinition \"\"\n" "set objopts [list]\n" @@ -273,7 +273,7 @@ "lappend methodopts required}\n" "if {[info exists :type]} {\n" "if {[string match ::* ${:type}]} {\n" -"set type [expr {[::next::core::objectproperty ${:type} metaclass] ? \"class\" : \"object\"}]\n" +"set type [expr {[::nx::core::objectproperty ${:type} metaclass] ? \"class\" : \"object\"}]\n" "lappend objopts type=${:type}\n" "lappend methodopts type=${:type}} else {\n" "set type ${:type}}}\n" @@ -297,126 +297,126 @@ "if {$type ne \"\"} {\n" "set objopts [linsert $objopts 0 $type]\n" "set methodopts [linsert $methodopts 0 $type]}\n" -"lappend objopts slot=[::next::core::current object]\n" +"lappend objopts slot=[::nx::core::current object]\n" "if {[llength $objopts] > 0} {\n" "append objparamdefinition :[join $objopts ,]}\n" "if {[llength $methodopts] > 0} {\n" "set methodparamdefinition [join $methodopts ,]}\n" "if {[info exists arg]} {\n" "lappend objparamdefinition $arg}\n" "return [list oparam $objparamdefinition mparam $methodparamdefinition]}\n" -"proc ::next::core::parametersFromSlots {obj} {\n" +"proc ::nx::core::parametersFromSlots {obj} {\n" "set parameterdefinitions [list]\n" -"foreach slot [::next::objectInfo slotobjects $obj] {\n" -"if {[::next::core::objectproperty $obj type ::xotcl::Object] &&\n" +"foreach slot [::nx::objectInfo slotobjects $obj] {\n" +"if {[::nx::core::objectproperty $obj type ::xotcl::Object] &&\n" "([$slot name] eq \"mixin\" || [$slot name] eq \"filter\")} continue\n" "array set \"\" [$slot toParameterSyntax]\n" "lappend parameterdefinitions -$(oparam)}\n" "return $parameterdefinitions}\n" -"::next::Object protected method objectparameter {{lastparameter __initcmd:initcmd,optional}} {\n" -"set parameterdefinitions [::next::core::parametersFromSlots [::next::core::current object]]\n" -"if {[::next::core::objectproperty [::next::core::current object] class]} {\n" +"::nx::Object protected method objectparameter {{lastparameter __initcmd:initcmd,optional}} {\n" +"set parameterdefinitions [::nx::core::parametersFromSlots [::nx::core::current object]]\n" +"if {[::nx::core::objectproperty [::nx::core::current object] class]} {\n" "lappend parameterdefinitions -parameter:method,optional}\n" "lappend parameterdefinitions \\\n" "-noinit:method,optional,noarg \\\n" "-volatile:method,optional,noarg \\\n" "{*}$lastparameter\n" "return $parameterdefinitions}\n" -"::next::MetaSlot create ::next::RelationSlot\n" -"createBootstrapAttributeSlots ::next::RelationSlot {\n" +"::nx::MetaSlot create ::nx::RelationSlot\n" +"createBootstrapAttributeSlots ::nx::RelationSlot {\n" "{multivalued true}\n" "{type relation}\n" -"{elementtype ::next::Class}}\n" -"::next::core::relation ::next::RelationSlot superclass ::next::ObjectParameterSlot\n" -"::next::core::alias ::next::RelationSlot assign ::next::core::relation\n" -"::next::RelationSlot protected method init {} {\n" +"{elementtype ::nx::Class}}\n" +"::nx::core::relation ::nx::RelationSlot superclass ::nx::ObjectParameterSlot\n" +"::nx::core::alias ::nx::RelationSlot assign ::nx::core::relation\n" +"::nx::RelationSlot protected method init {} {\n" "if {${:type} ne \"relation\"} {\n" "error \"RelationSlot requires type == \\\"relation\\\"\"}\n" -"::next::core::next}\n" -"::next::RelationSlot protected method delete_value {obj prop old value} {\n" +"::nx::core::next}\n" +"::nx::RelationSlot protected method delete_value {obj prop old value} {\n" "if {[string first * $value] > -1 || [string first \\[ $value] > -1} {\n" "if {${:elementtype} ne \"\" && ![string match ::* $value]} {\n" "set value ::$value}\n" "return [lsearch -all -not -glob -inline $old $value]} elseif {${:elementtype} ne \"\"} {\n" "if {[string first :: $value] == -1} {\n" -"if {![::next::core::objectproperty $value object]} {\n" +"if {![::nx::core::objectproperty $value object]} {\n" "error \"$value does not appear to be an object\"}\n" -"set value [::next::core::dispatch $value -objscope ::next::core::current object]}\n" -"if {![::next::core::objectproperty ${:elementtype} class]} {\n" +"set value [::nx::core::dispatch $value -objscope ::nx::core::current object]}\n" +"if {![::nx::core::objectproperty ${:elementtype} class]} {\n" "error \"$value does not appear to be of type ${:elementtype}\"}}\n" "set p [lsearch -exact $old $value]\n" "if {$p > -1} {\n" "return [lreplace $old $p $p]} else {\n" "error \"$value is not a $prop of $obj (valid are: $old)\"}}\n" -"::next::RelationSlot public method delete {-nocomplain:switch obj prop value} {\n" +"::nx::RelationSlot public method delete {-nocomplain:switch obj prop value} {\n" "$obj $prop [:delete_value $obj $prop [$obj info $prop] $value]}\n" -"::next::RelationSlot public method get {obj prop} {\n" -"::next::core::relation $obj $prop}\n" -"::next::RelationSlot public method add {obj prop value {pos 0}} {\n" +"::nx::RelationSlot public method get {obj prop} {\n" +"::nx::core::relation $obj $prop}\n" +"::nx::RelationSlot public method add {obj prop value {pos 0}} {\n" "if {![set :multivalued]} {\n" "error \"Property $prop of ${:domain}->$obj ist not multivalued\"}\n" -"set oldSetting [::next::core::relation $obj $prop]\n" -"uplevel [list ::next::core::relation $obj $prop [linsert $oldSetting $pos $value]]}\n" -"::next::RelationSlot public method delete {-nocomplain:switch obj prop value} {\n" -"uplevel [list ::next::core::relation $obj $prop [:delete_value $obj $prop [::next::core::relation $obj $prop] $value]]}\n" -"proc ::next::core::register_system_slots {os} {\n" +"set oldSetting [::nx::core::relation $obj $prop]\n" +"uplevel [list ::nx::core::relation $obj $prop [linsert $oldSetting $pos $value]]}\n" +"::nx::RelationSlot public method delete {-nocomplain:switch obj prop value} {\n" +"uplevel [list ::nx::core::relation $obj $prop [:delete_value $obj $prop [::nx::core::relation $obj $prop] $value]]}\n" +"proc ::nx::core::register_system_slots {os} {\n" "${os}::Object alloc ${os}::Class::slot\n" "${os}::Object alloc ${os}::Object::slot\n" -"::next::RelationSlot create ${os}::Class::slot::superclass\n" -"::next::core::alias ${os}::Class::slot::superclass assign ::next::core::relation\n" -"::next::RelationSlot create ${os}::Object::slot::class -multivalued false\n" -"::next::core::alias ${os}::Object::slot::class assign ::next::core::relation\n" -"::next::RelationSlot create ${os}::Object::slot::mixin -methodname object-mixin\n" -"::next::RelationSlot create ${os}::Object::slot::filter -elementtype \"\"\n" -"::next::RelationSlot create ${os}::Class::slot::mixin -methodname class-mixin\n" -"::next::RelationSlot create ${os}::Class::slot::filter -elementtype \"\" \\\n" +"::nx::RelationSlot create ${os}::Class::slot::superclass\n" +"::nx::core::alias ${os}::Class::slot::superclass assign ::nx::core::relation\n" +"::nx::RelationSlot create ${os}::Object::slot::class -multivalued false\n" +"::nx::core::alias ${os}::Object::slot::class assign ::nx::core::relation\n" +"::nx::RelationSlot create ${os}::Object::slot::mixin -methodname object-mixin\n" +"::nx::RelationSlot create ${os}::Object::slot::filter -elementtype \"\"\n" +"::nx::RelationSlot create ${os}::Class::slot::mixin -methodname class-mixin\n" +"::nx::RelationSlot create ${os}::Class::slot::filter -elementtype \"\" \\\n" "-methodname class-filter\n" -"::next::RelationSlot create ${os}::Class::slot::object-mixin\n" -"::next::RelationSlot create ${os}::Class::slot::object-filter -elementtype \"\"}\n" -"::next::core::register_system_slots ::next\n" -"proc ::next::core::register_system_slots {} {}\n" -"::next::MetaSlot __invalidateobjectparameter\n" -"::next::MetaSlot create ::next::Attribute -superclass ::next::ObjectParameterSlot\n" -"createBootstrapAttributeSlots ::next::Attribute {\n" +"::nx::RelationSlot create ${os}::Class::slot::object-mixin\n" +"::nx::RelationSlot create ${os}::Class::slot::object-filter -elementtype \"\"}\n" +"::nx::core::register_system_slots ::nx\n" +"proc ::nx::core::register_system_slots {} {}\n" +"::nx::MetaSlot __invalidateobjectparameter\n" +"::nx::MetaSlot create ::nx::Attribute -superclass ::nx::ObjectParameterSlot\n" +"createBootstrapAttributeSlots ::nx::Attribute {\n" "{value_check once}\n" "incremental\n" "initcmd\n" "valuecmd\n" "valuechangedcmd\n" "arg}\n" -"::next::Attribute method __default_from_cmd {obj cmd var sub op} {\n" -"$obj trace remove variable $var $op [list [::next::core::current object] [::next::core::current method] $obj $cmd]\n" -"::next::core::setvar $obj $var [$obj eval $cmd]}\n" -"::next::Attribute method __value_from_cmd {obj cmd var sub op} {\n" -"::next::core::setvar $obj $var [$obj eval $cmd]}\n" -"::next::Attribute method __value_changed_cmd {obj cmd var sub op} {\n" +"::nx::Attribute method __default_from_cmd {obj cmd var sub op} {\n" +"$obj trace remove variable $var $op [list [::nx::core::current object] [::nx::core::current method] $obj $cmd]\n" +"::nx::core::setvar $obj $var [$obj eval $cmd]}\n" +"::nx::Attribute method __value_from_cmd {obj cmd var sub op} {\n" +"::nx::core::setvar $obj $var [$obj eval $cmd]}\n" +"::nx::Attribute method __value_changed_cmd {obj cmd var sub op} {\n" "eval $cmd}\n" -"::next::Attribute protected method init {} {\n" -"::next::core::next ;# do first ordinary slot initialization\n" +"::nx::Attribute protected method init {} {\n" +"::nx::core::next ;# do first ordinary slot initialization\n" "set __initcmd \"\"\n" "if {[:exists default]} {} elseif [:exists initcmd] {\n" "append __initcmd \":trace add variable [list ${:name}] read \\\n" -"\\[list [::next::core::current object] __default_from_cmd \\[::next::core::current object\\] [list [set :initcmd]]\\]\\n\"} elseif [:exists valuecmd] {\n" +"\\[list [::nx::core::current object] __default_from_cmd \\[::nx::core::current object\\] [list [set :initcmd]]\\]\\n\"} elseif [:exists valuecmd] {\n" "append __initcmd \":trace add variable [list ${:name}] read \\\n" -"\\[list [::next::core::current object] __value_from_cmd \\[::next::core::current object\\] [list [set :valuecmd]]\\]\"}\n" +"\\[list [::nx::core::current object] __value_from_cmd \\[::nx::core::current object\\] [list [set :valuecmd]]\\]\"}\n" "array set \"\" [:toParameterSyntax ${:name}]\n" "if {$(mparam) ne \"\"} {\n" "if {[info exists :multivalued] && ${:multivalued}} {\n" -":method assign [list obj var value:$(mparam),multivalued,slot=[::next::core::current object]] {\n" -"::next::core::setvar $obj $var $value}\n" -":method add [list obj prop value:$(mparam),slot=[::next::core::current object] {pos 0}] {\n" -"::next::core::next}} else {\n" -":method assign [list obj var value:$(mparam),slot=[::next::core::current object]] {\n" -"::next::core::setvar $obj $var $value}}}\n" +":method assign [list obj var value:$(mparam),multivalued,slot=[::nx::core::current object]] {\n" +"::nx::core::setvar $obj $var $value}\n" +":method add [list obj prop value:$(mparam),slot=[::nx::core::current object] {pos 0}] {\n" +"::nx::core::next}} else {\n" +":method assign [list obj var value:$(mparam),slot=[::nx::core::current object]] {\n" +"::nx::core::setvar $obj $var $value}}}\n" "if {[:exists valuechangedcmd]} {\n" "append __initcmd \":trace add variable [list ${:name}] write \\\n" -"\\[list [::next::core::current object] __value_changed_cmd \\[::next::core::current object\\] [list [set :valuechangedcmd]]\\]\"}\n" +"\\[list [::nx::core::current object] __value_changed_cmd \\[::nx::core::current object\\] [list [set :valuechangedcmd]]\\]\"}\n" "if {$__initcmd ne \"\"} {\n" "set :initcmd $__initcmd}}\n" -"::next::Class create ::next::Attribute::Optimizer {\n" -":method method args {::next::core::next; :optimize}\n" -":method forward args {::next::core::next; :optimize}\n" -":protected method init args {::next::core::next; :optimize}\n" +"::nx::Class create ::nx::Attribute::Optimizer {\n" +":method method args {::nx::core::next; :optimize}\n" +":method forward args {::nx::core::next; :optimize}\n" +":protected method init args {::nx::core::next; :optimize}\n" ":public method optimize {} {\n" "if {![info exists :methodname]} {return}\n" "set object [expr {${:per-object} ? {object} : {}}]\n" @@ -425,157 +425,157 @@ "set infokind Object} else {\n" "set perObject \"\"\n" "set infokind Class}\n" -"if {[::next::core::cmd::${infokind}Info::method ${:domain} name ${:name}] ne \"\"} {\n" -"::next::core::forward ${:domain} {*}$perObject ${:name} \\\n" +"if {[::nx::core::cmd::${infokind}Info::method ${:domain} name ${:name}] ne \"\"} {\n" +"::nx::core::forward ${:domain} {*}$perObject ${:name} \\\n" "${:manager} \\\n" "[list %1 [${:manager} defaultmethods]] %self \\\n" "${:methodname}}\n" "if {[info exists :incremental] && ${:incremental}} return\n" "if {[set :defaultmethods] ne {get assign}} return\n" "set assignInfo [:info callable -which assign]\n" -"if {$assignInfo ne \"::next::ObjectParameterSlot alias assign ::next::core::setvar\" &&\n" -"[lindex $assignInfo {end 0}] ne \"::next::core::setvar\" } return\n" -"if {[:info callable -which get] ne \"::next::ObjectParameterSlot alias get ::next::core::setvar\"} return\n" +"if {$assignInfo ne \"::nx::ObjectParameterSlot alias assign ::nx::core::setvar\" &&\n" +"[lindex $assignInfo {end 0}] ne \"::nx::core::setvar\" } return\n" +"if {[:info callable -which get] ne \"::nx::ObjectParameterSlot alias get ::nx::core::setvar\"} return\n" "array set \"\" [:toParameterSyntax ${:name}]\n" "if {$(mparam) ne \"\"} {\n" "set setterParam [lindex $(oparam) 0]} else {\n" "set setterParam ${:name}}\n" -"::next::core::setter ${:domain} {*}$perObject $setterParam}}\n" -"::next::Attribute mixin add ::next::Attribute::Optimizer\n" -"::next::Class method attribute {spec {-slotclass ::next::Attribute} {initblock \"\"}} {\n" -"$slotclass createFromParameterSyntax [::next::core::current object] -initblock $initblock {*}$spec}\n" -"::next::Object method attribute {spec {-slotclass ::next::Attribute} {initblock \"\"}} {\n" -"$slotclass createFromParameterSyntax [::next::core::current object] -per-object -initblock $initblock {*}$spec}\n" -"::next::Class public method parameter arglist {\n" +"::nx::core::setter ${:domain} {*}$perObject $setterParam}}\n" +"::nx::Attribute mixin add ::nx::Attribute::Optimizer\n" +"::nx::Class method attribute {spec {-slotclass ::nx::Attribute} {initblock \"\"}} {\n" +"$slotclass createFromParameterSyntax [::nx::core::current object] -initblock $initblock {*}$spec}\n" +"::nx::Object method attribute {spec {-slotclass ::nx::Attribute} {initblock \"\"}} {\n" +"$slotclass createFromParameterSyntax [::nx::core::current object] -per-object -initblock $initblock {*}$spec}\n" +"::nx::Class public method parameter arglist {\n" "foreach arg $arglist {\n" -"::next::Attribute createFromParameterSyntax [::next::core::current object] {*}$arg}\n" -"set slot [::next::core::current object]::slot\n" -"if {![::next::core::objectproperty $slot object]} {::next::Object create $slot}\n" -"::next::core::setvar $slot __parameter $arglist}\n" +"::nx::Attribute createFromParameterSyntax [::nx::core::current object] {*}$arg}\n" +"set slot [::nx::core::current object]::slot\n" +"if {![::nx::core::objectproperty $slot object]} {::nx::Object create $slot}\n" +"::nx::core::setvar $slot __parameter $arglist}\n" "proc createBootstrapAttributeSlots {} {}\n" -"::next::Slot method type=hasmixin {name value arg} {\n" -"if {![::next::core::objectproperty $value hasmixin $arg]} {\n" +"::nx::Slot method type=hasmixin {name value arg} {\n" +"if {![::nx::core::objectproperty $value hasmixin $arg]} {\n" "error \"expected object with mixin $arg but got \\\"$value\\\" for parameter $name\"}\n" "return $value}\n" -"::next::Slot method type=baseclass {name value} {\n" -"if {![::next::core::objectproperty $value baseclass]} {\n" +"::nx::Slot method type=baseclass {name value} {\n" +"if {![::nx::core::objectproperty $value baseclass]} {\n" "error \"expected baseclass but got \\\"$value\\\" for parameter $name\"}\n" "return $value}\n" -"::next::Slot method type=metaclass {name value} {\n" -"if {![::next::core::objectproperty $value metaclass]} {\n" +"::nx::Slot method type=metaclass {name value} {\n" +"if {![::nx::core::objectproperty $value metaclass]} {\n" "error \"expected metaclass but got \\\"$value\\\" for parameter $name\"}\n" "return $value}}\n" -"::next::Class create ::next::ScopedNew -superclass ::next::Class {\n" -":attribute {withclass ::next::Object}\n" +"::nx::Class create ::nx::ScopedNew -superclass ::nx::Class {\n" +":attribute {withclass ::nx::Object}\n" ":attribute container\n" ":protected method init {} {\n" ":public method new {-childof args} {\n" -"::next::core::importvar [::next::core::current class] {container object} withclass\n" -"if {![::next::core::objectproperty $object object]} {\n" +"::nx::core::importvar [::nx::core::current class] {container object} withclass\n" +"if {![::nx::core::objectproperty $object object]} {\n" "$withclass create $object}\n" -"eval ::next::core::next -childof $object $args}}}\n" -"::next::Object public method contains {\n" +"eval ::nx::core::next -childof $object $args}}}\n" +"::nx::Object public method contains {\n" "{-withnew:boolean true}\n" "-object\n" -"{-class ::next::Object}\n" +"{-class ::nx::Object}\n" "cmds} {\n" -"if {![info exists object]} {set object [::next::core::current object]}\n" -"if {![::next::core::objectproperty $object object]} {$class create $object}\n" +"if {![info exists object]} {set object [::nx::core::current object]}\n" +"if {![::nx::core::objectproperty $object object]} {$class create $object}\n" "$object requireNamespace\n" "if {$withnew} {\n" -"set m [::next::ScopedNew new -volatile \\\n" +"set m [::nx::ScopedNew new -volatile \\\n" "-container $object -withclass $class]\n" -"::next::Class mixin add $m end\n" -"if {[::next::core::objectproperty ::xotcl::Class class]} {::xotcl::Class instmixin add $m end}\n" +"::nx::Class mixin add $m end\n" +"if {[::nx::core::objectproperty ::xotcl::Class class]} {::xotcl::Class instmixin add $m end}\n" "namespace eval $object $cmds\n" -"::next::Class mixin delete $m\n" -"if {[::next::core::objectproperty ::xotcl::Class class]} {::xotcl::Class instmixin delete $m}} else {\n" +"::nx::Class mixin delete $m\n" +"if {[::nx::core::objectproperty ::xotcl::Class class]} {::xotcl::Class instmixin delete $m}} else {\n" "namespace eval $object $cmds}}\n" -"::next::Class forward slots %self contains \\\n" -"-object {%::next::core::dispatch [::next::core::current object] -objscope ::subst [::next::core::current object]::slot}\n" -"::next::Class create ::next::CopyHandler {\n" +"::nx::Class forward slots %self contains \\\n" +"-object {%::nx::core::dispatch [::nx::core::current object] -objscope ::subst [::nx::core::current object]::slot}\n" +"::nx::Class create ::nx::CopyHandler {\n" ":attribute {targetList \"\"}\n" ":attribute {dest \"\"}\n" ":attribute objLength\n" ":method makeTargetList {t} {\n" "lappend :targetList $t\n" -"if {[::next::core::objectproperty $t object]} {\n" +"if {[::nx::core::objectproperty $t object]} {\n" "if {[$t info hasnamespace]} {\n" "set children [$t info children]} else {\n" "return}}\n" "foreach c [namespace children $t] {\n" -"if {![::next::core::objectproperty $c object]} {\n" +"if {![::nx::core::objectproperty $c object]} {\n" "lappend children [namespace children $t]}}\n" "foreach c $children {\n" ":makeTargetList $c}}\n" ":method copyNSVarsAndCmds {orig dest} {\n" -"::next::core::namespace_copyvars $orig $dest\n" -"::next::core::namespace_copycmds $orig $dest}\n" +"::nx::core::namespace_copyvars $orig $dest\n" +"::nx::core::namespace_copycmds $orig $dest}\n" ":method getDest origin {\n" "set tail [string range $origin [set :objLength] end]\n" "return ::[string trimleft [set :dest]$tail :]}\n" ":method copyTargets {} {\n" "foreach origin [set :targetList] {\n" "set dest [:getDest $origin]\n" -"if {[::next::core::objectproperty $origin object]} {\n" -"if {[::next::core::objectproperty $origin class]} {\n" +"if {[::nx::core::objectproperty $origin object]} {\n" +"if {[::nx::core::objectproperty $origin class]} {\n" "set cl [[$origin info class] create $dest -noinit]\n" "set obj $cl\n" "$cl superclass [$origin info superclass]\n" -"::next::core::assertion $cl class-invar [::next::core::assertion $origin class-invar]\n" -"::next::core::relation $cl class-filter [::next::core::relation $origin class-filter]\n" -"::next::core::relation $cl class-mixin [::next::core::relation $origin class-mixin]\n" -":copyNSVarsAndCmds ::next::core::classes$origin ::next::core::classes$dest} else {\n" +"::nx::core::assertion $cl class-invar [::nx::core::assertion $origin class-invar]\n" +"::nx::core::relation $cl class-filter [::nx::core::relation $origin class-filter]\n" +"::nx::core::relation $cl class-mixin [::nx::core::relation $origin class-mixin]\n" +":copyNSVarsAndCmds ::nx::core::classes$origin ::nx::core::classes$dest} else {\n" "set obj [[$origin info class] create $dest -noinit]}\n" -"::next::core::assertion $obj check [::next::core::assertion $origin check]\n" -"::next::core::assertion $obj object-invar [::next::core::assertion $origin object-invar]\n" -"::next::core::relation $obj object-filter [::next::core::relation $origin object-filter]\n" -"::next::core::relation $obj object-mixin [::next::core::relation $origin object-mixin]\n" +"::nx::core::assertion $obj check [::nx::core::assertion $origin check]\n" +"::nx::core::assertion $obj object-invar [::nx::core::assertion $origin object-invar]\n" +"::nx::core::relation $obj object-filter [::nx::core::relation $origin object-filter]\n" +"::nx::core::relation $obj object-mixin [::nx::core::relation $origin object-mixin]\n" "if {[$origin info hasnamespace]} {\n" "$obj requireNamespace}} else {\n" "namespace eval $dest {}}\n" ":copyNSVarsAndCmds $origin $dest\n" -"foreach i [::next::core::cmd::ObjectInfo::forward $origin] {\n" -"eval [concat ::next::core::forward $dest -per-object $i [::next::core::cmd::ObjectInfo::forward $origin -definition $i]]}\n" -"if {[::next::core::objectproperty $origin class]} {\n" -"foreach i [::next::core::cmd::ClassInfo::forward $origin] {\n" -"eval [concat ::next::core::forward $dest $i [::next::core::cmd::ClassInfo::forward $origin -definition $i]]}}\n" +"foreach i [::nx::core::cmd::ObjectInfo::forward $origin] {\n" +"eval [concat ::nx::core::forward $dest -per-object $i [::nx::core::cmd::ObjectInfo::forward $origin -definition $i]]}\n" +"if {[::nx::core::objectproperty $origin class]} {\n" +"foreach i [::nx::core::cmd::ClassInfo::forward $origin] {\n" +"eval [concat ::nx::core::forward $dest $i [::nx::core::cmd::ClassInfo::forward $origin -definition $i]]}}\n" "set traces [list]\n" "foreach var [$origin info vars] {\n" -"set cmds [::next::core::dispatch $origin -objscope ::trace info variable $var]\n" +"set cmds [::nx::core::dispatch $origin -objscope ::trace info variable $var]\n" "if {$cmds ne \"\"} {\n" "foreach cmd $cmds {\n" "foreach {op def} $cmd break\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" "foreach origin [set :targetList] {\n" -"if {[::next::core::objectproperty $origin class]} {\n" +"if {[::nx::core::objectproperty $origin class]} {\n" "set dest [:getDest $origin]\n" "foreach oldslot [$origin info slots] {\n" -"set newslot [::next::Slot slotName [namespace tail $oldslot] $dest]\n" +"set newslot [::nx::Slot slotName [namespace tail $oldslot] $dest]\n" "if {[$oldslot domain] eq $origin} {$newslot domain $cl}\n" "if {[$oldslot manager] eq $oldslot} {$newslot manager $newslot}}}}}\n" ":public method copy {obj dest} {\n" "set :objLength [string length $obj]\n" "set :dest $dest\n" ":makeTargetList $obj\n" ":copyTargets}}\n" -"::next::Object public method copy newName {\n" -"if {[string compare [string trimleft $newName :] [string trimleft [::next::core::current object] :]]} {\n" -"[::next::CopyHandler new -volatile] copy [::next::core::current object] $newName}}\n" -"::next::Object public method move newName {\n" -"if {[string trimleft $newName :] ne [string trimleft [::next::core::current object] :]} {\n" +"::nx::Object public method copy newName {\n" +"if {[string compare [string trimleft $newName :] [string trimleft [::nx::core::current object] :]]} {\n" +"[::nx::CopyHandler new -volatile] copy [::nx::core::current object] $newName}}\n" +"::nx::Object public method move newName {\n" +"if {[string trimleft $newName :] ne [string trimleft [::nx::core::current object] :]} {\n" "if {$newName ne \"\"} {\n" ":copy $newName}\n" -"if {[::next::core::objectproperty [::next::core::current object] class] && $newName ne \"\"} {\n" +"if {[::nx::core::objectproperty [::nx::core::current object] class] && $newName ne \"\"} {\n" "foreach subclass [:info subclass] {\n" "set scl [$subclass info superclass]\n" -"if {[set index [lsearch -exact $scl [::next::core::current object]]] != -1} {\n" +"if {[set index [lsearch -exact $scl [::nx::core::current object]]] != -1} {\n" "set scl [lreplace $scl $index $index $newName]\n" "$subclass superclass $scl}} }\n" ":destroy}}\n" -"namespace eval ::next::core {\n" +"namespace eval ::nx::core {\n" "proc tmpdir {} {\n" "foreach e [list TMPDIR TEMP TMP] {\n" "if {[info exists ::env($e)] \\\n" @@ -596,13 +596,13 @@ "if {$callingNs ne \"::xotcl\"} {uplevel {namespace import -force ::xotcl::*}}}\n" "default {\n" "if {$callingNs ne \"::xotcl\"} {uplevel {namespace import -force ::xotcl::*}}\n" -"if {$callingNs ne \"::next\"} {uplevel {namespace import -force ::next::*}}}}}\n" +"if {$callingNs ne \"::next\"} {uplevel {namespace import -force ::nx::*}}}}}\n" "namespace export tmpdir use}\n" -"namespace eval ::next {\n" +"namespace eval ::nx {\n" "namespace export Attribute current\n" "if {![info exists ::env(HOME)]} {set ::env(HOME) /root}\n" -"set ::next::confdir ~/.xotcl\n" -"set ::next::logdir $::next::confdir/log\n" +"set ::nx::confdir ~/.xotcl\n" +"set ::nx::logdir $::nx::confdir/log\n" "unset bootstrap}\n" ""; Index: generic/predefined.xotcl =================================================================== diff -u -r81c800c8b9cb42ef6743d9b80ac2be5ca211a69a -r3f0573cc75724179f416942b974373e5a62ec05e --- generic/predefined.xotcl (.../predefined.xotcl) (revision 81c800c8b9cb42ef6743d9b80ac2be5ca211a69a) +++ generic/predefined.xotcl (.../predefined.xotcl) (revision 3f0573cc75724179f416942b974373e5a62ec05e) @@ -1,5 +1,5 @@ -namespace eval ::next { +namespace eval ::nx { # # By setting the variable bootstrap, we can check later, whether we # are in bootstrapping mode @@ -9,9 +9,9 @@ #namespace path ::xotcl # - # First create the ::next object system. + # First create the ::nx object system. # - ::next::core::createobjectsystem ::next::Object ::next::Class { + ::nx::core::createobjectsystem ::nx::Object ::nx::Class { -class.alloc alloc -class.create create -class.dealloc dealloc @@ -30,62 +30,62 @@ # # get frequenly used primitiva into the ::next namespace # - namespace eval ::next::core { + namespace eval ::nx::core { namespace export next self \ my is relation interp } - namespace import ::next::core::next ::next::core::self + namespace import ::nx::core::next ::nx::core::self # - # provide the standard command set for ::next::Object + # provide the standard command set for ::nx::Object # - foreach cmd [info command ::next::core::cmd::Object::*] { + foreach cmd [info command ::nx::core::cmd::Object::*] { set cmdName [namespace tail $cmd] if {$cmdName in [list "instvar"]} continue - ::next::core::alias Object $cmdName $cmd + ::nx::core::alias Object $cmdName $cmd } - # provide ::eval as method for ::next::Object - ::next::core::alias Object eval -nonleaf ::eval + # provide ::eval as method for ::nx::Object + ::nx::core::alias Object eval -nonleaf ::eval # provide the standard command set for Class - foreach cmd [info command ::next::core::cmd::Class::*] { + foreach cmd [info command ::nx::core::cmd::Class::*] { set cmdName [namespace tail $cmd] - ::next::core::alias Class $cmdName $cmd + ::nx::core::alias Class $cmdName $cmd } # set a few aliases as protected foreach cmd [list __next cleanup noinit residualargs uplevel upvar] { - ::next::core::methodproperty Object $cmd protected 1 + ::nx::core::methodproperty Object $cmd protected 1 } foreach cmd [list recreate] { - ::next::core::methodproperty Class $cmd protected 1 + ::nx::core::methodproperty Class $cmd protected 1 } # TODO: info methods shows finally "slots" and "slot". Wanted? # protect some methods against redefinition - ::next::core::methodproperty Object destroy redefine-protected true - ::next::core::methodproperty Class alloc redefine-protected true - ::next::core::methodproperty Class dealloc redefine-protected true - ::next::core::methodproperty Class create redefine-protected true + ::nx::core::methodproperty Object destroy redefine-protected true + ::nx::core::methodproperty Class alloc redefine-protected true + ::nx::core::methodproperty Class dealloc redefine-protected true + ::nx::core::methodproperty Class create redefine-protected true # define method "method" for Class and Object - ::next::core::method Class method { + ::nx::core::method Class method { name arguments body -precondition -postcondition } { set conditions [list] if {[info exists precondition]} {lappend conditions -precondition $precondition} if {[info exists postcondition]} {lappend conditions -postcondition $postcondition} - ::next::core::method [::next::core::current object] $name $arguments $body {*}$conditions + ::nx::core::method [::nx::core::current object] $name $arguments $body {*}$conditions } - ::next::core::method Object method { + ::nx::core::method Object method { name arguments body -precondition -postcondition } { set conditions [list] if {[info exists precondition]} {lappend conditions -precondition $precondition} if {[info exists postcondition]} {lappend conditions -postcondition $postcondition} - ::next::core::method [::next::core::current object] -per-object $name $arguments $body {*}$conditions + ::nx::core::method [::nx::core::current object] -per-object $name $arguments $body {*}$conditions } # define method modifiers "object", "public" and "protected" @@ -94,26 +94,26 @@ # method-modifier for object specific methos :method object {what args} { if {$what in [list "alias" "attribute" "forward" "method" "setter"]} { - return [::next::core::dispatch [::next::core::current object] ::next::core::classes::next::Object::$what {*}$args] + return [::nx::core::dispatch [::nx::core::current object] ::nx::core::classes::nx::Object::$what {*}$args] } if {$what in [list "info"]} { - return [::next::objectInfo [lindex $args 0] [::next::core::current object] {*}[lrange $args 1 end]] + return [::nx::objectInfo [lindex $args 0] [::nx::core::current object] {*}[lrange $args 1 end]] } if {$what in [list "filter" "mixin"]} { return [:object-$what {*}$args] } if {$what in [list "filterguard" "mixinguard"]} { - return [::next::core::dispatch [::next::core::current object] ::next::core::cmd::Object::$what {*}$args] + return [::nx::core::dispatch [::nx::core::current object] ::nx::core::cmd::Object::$what {*}$args] } } # define unknown handler for class :method unknown {m args} { - error "Method '$m' unknown for [::next::core::current object].\ - Consider '[::next::core::current object] create $m $args' instead of '[::next::core::current object] $m $args'" + error "Method '$m' unknown for [::nx::core::current object].\ + Consider '[::nx::core::current object] create $m $args' instead of '[::nx::core::current object] $m $args'" } # protected is not jet defined - ::next::core::methodproperty [::next::core::current object] unknown protected 1 + ::nx::core::methodproperty [::nx::core::current object] unknown protected 1 } @@ -124,7 +124,7 @@ set p [lsearch -regexp $args {^(method|alias|attribute|forward|setter)$}] if {$p == -1} {error "$args is not a method defining method"} set r [{*}:$args] - ::next::core::methodproperty [::next::core::current object] $r protected false + ::nx::core::methodproperty [::nx::core::current object] $r protected false return $r } @@ -133,31 +133,31 @@ set p [lsearch -regexp $args {^(method|alias|attribute|forward|setter)$}] if {$p == -1} {error "$args is not a method defining command"} set r [{*}:$args] - ::next::core::methodproperty [::next::core::current object] $r [::next::core::current method] true + ::nx::core::methodproperty [::nx::core::current object] $r [::nx::core::current method] true return $r } # unknown handler for Object :protected method unknown {m args} { - if {![::next::core::current isnext]} { - error "[::next::core::current object]: unable to dispatch method '$m'" + if {![::nx::core::current isnext]} { + error "[::nx::core::current object]: unable to dispatch method '$m'" } } # "init" must exist on Object. per default it is empty. :protected method init args {} # this method is called on calls to object without a specified method - :protected method defaultmethod {} {::next::core::current object} + :protected method defaultmethod {} {::nx::core::current object} # provide a placeholder for the bootup process. The real definition # is based on slots, which are not available at this point. :protected method objectparameter {} {;} } # define forward methods - ::next::core::forward Object forward ::next::core::forward %self -per-object - ::next::core::forward Class forward ::next::core::forward %self + ::nx::core::forward Object forward ::nx::core::forward %self -per-object + ::nx::core::forward Class forward ::nx::core::forward %self # The method __unknown is called in cases, where we try to resolve # an unkown class. one could define a custom resolver with this name @@ -174,13 +174,13 @@ # -objscope implies -nonleaf # Object public method alias {-nonleaf:switch -objscope:switch methodName cmd} { - ::next::core::alias [::next::core::current object] -per-object $methodName \ + ::nx::core::alias [::nx::core::current object] -per-object $methodName \ {*}[expr {${objscope} ? "-objscope" : ""}] \ {*}[expr {${nonleaf} ? "-nonleaf" : ""}] \ $cmd } Class public method alias {-nonleaf:switch -objscope:switch methodName cmd} { - ::next::core::alias [::next::core::current object] $methodName \ + ::nx::core::alias [::nx::core::current object] $methodName \ {*}[expr {${objscope} ? "-objscope" : ""}] \ {*}[expr {${nonleaf} ? "-nonleaf" : ""}] \ $cmd @@ -189,64 +189,64 @@ # Add setter methods. # Object public method setter {methodName} { - ::next::core::setter [::next::core::current object] -per-object $methodName + ::nx::core::setter [::nx::core::current object] -per-object $methodName } Class public method setter {methodName} { - ::next::core::setter [::next::core::current object] $methodName + ::nx::core::setter [::nx::core::current object] $methodName } ######################## # Info definition ######################## - Object create ::next::objectInfo - Object create ::next::classInfo + Object create ::nx::objectInfo + Object create ::nx::classInfo # # It would be nice to do here "objectInfo configure {alias ..}", but # we have no working objectparameter yet due to bootstrapping # objectInfo eval { - :alias is ::next::core::objectproperty + :alias is ::nx::core::objectproperty # info info :public method info {obj} { set methods [list] - foreach name [::next::core::cmd::ObjectInfo::methods [::next::core::current object]] { + foreach name [::nx::core::cmd::ObjectInfo::methods [::nx::core::current object]] { if {$name eq "unknown"} continue lappend methods $name } return "valid options are: [join [lsort $methods] {, }]" } :method unknown {method obj args} { - error "[::next::core::current object] unknown info option \"$method\"; [$obj info info]" + error "[::nx::core::current object] unknown info option \"$method\"; [$obj info info]" } } classInfo eval { - :alias is ::next::core::objectproperty - :alias classparent ::next::core::cmd::ObjectInfo::parent - :alias classchildren ::next::core::cmd::ObjectInfo::children - :alias info [::next::core::cmd::ObjectInfo::method objectInfo name info] - :alias unknown [::next::core::cmd::ObjectInfo::method objectInfo name info] + :alias is ::nx::core::objectproperty + :alias classparent ::nx::core::cmd::ObjectInfo::parent + :alias classchildren ::nx::core::cmd::ObjectInfo::children + :alias info [::nx::core::cmd::ObjectInfo::method objectInfo name info] + :alias unknown [::nx::core::cmd::ObjectInfo::method objectInfo name info] } - foreach cmd [info command ::next::core::cmd::ObjectInfo::*] { - ::next::core::alias ::next::objectInfo [namespace tail $cmd] $cmd - ::next::core::alias ::next::classInfo [namespace tail $cmd] $cmd + foreach cmd [info command ::nx::core::cmd::ObjectInfo::*] { + ::nx::core::alias ::nx::objectInfo [namespace tail $cmd] $cmd + ::nx::core::alias ::nx::classInfo [namespace tail $cmd] $cmd } - foreach cmd [info command ::next::core::cmd::ClassInfo::*] { + foreach cmd [info command ::nx::core::cmd::ClassInfo::*] { set cmdName [namespace tail $cmd] if {$cmdName in [list "object-mixin-of" "class-mixin-of"]} continue - ::next::core::alias ::next::classInfo $cmdName $cmd + ::nx::core::alias ::nx::classInfo $cmdName $cmd } unset cmd # register method "info" on Object and Class - Object forward info -onerror ::next::core::infoError ::next::objectInfo %1 {%@2 %self} - Class forward info -onerror ::next::core::infoError ::next::classInfo %1 {%@2 %self} + Object forward info -onerror ::nx::core::infoError ::nx::objectInfo %1 {%@2 %self} + Class forward info -onerror ::nx::core::infoError ::nx::classInfo %1 {%@2 %self} - proc ::next::core::infoError msg { + proc ::nx::core::infoError msg { #puts stderr "INFO ERROR: <$msg>\n$::errorInfo" regsub -all " " $msg "" msg regsub -all " " $msg "" msg @@ -262,9 +262,9 @@ error "invalid method type '$methtype', must be 'method'" } set body " - if {!\[::next::core::current isnextcall\]} { + if {!\[::nx::core::current isnextcall\]} { error \"Abstract method $methname $arglist called\" - } else {::next::core::next} + } else {::nx::core::next} " if {${per-object}} { :method -per-object $methname $arglist $body @@ -276,15 +276,15 @@ # # exit handlers # - proc ::next::core::unsetExitHandler {} { - proc ::next::core::__exitHandler {} { + proc ::nx::core::unsetExitHandler {} { + proc ::nx::core::__exitHandler {} { # clients should append exit handlers to this proc body } } - proc ::next::core::setExitHandler {newbody} {::proc ::next::core::__exitHandler {} $newbody} - proc ::next::core::getExitHandler {} {::info body ::next::core::__exitHandler} + proc ::nx::core::setExitHandler {newbody} {::proc ::nx::core::__exitHandler {} $newbody} + proc ::nx::core::getExitHandler {} {::info body ::nx::core::__exitHandler} # initialize exit handler - ::next::core::unsetExitHandler + ::nx::core::unsetExitHandler namespace export Object Class next self } @@ -293,26 +293,26 @@ ######################################## # Slot definitions ######################################## -namespace eval ::next { +namespace eval ::nx { # # We are in bootstrap code; we cannot use slots/parameter to define # slots, so the code is a little low level. After the defintion of # the slots, we can use slot-based code such as "-parameter" or # "objectparameter". # - ::next::Class create ::next::MetaSlot - ::next::core::relation ::next::MetaSlot superclass ::next::Class + ::nx::Class create ::nx::MetaSlot + ::nx::core::relation ::nx::MetaSlot superclass ::nx::Class - ::next::MetaSlot public method slotName {name baseObject} { + ::nx::MetaSlot public method slotName {name baseObject} { # Create slot parent object if needed set slotParent ${baseObject}::slot - if {![::next::core::objectproperty ${slotParent} object]} { - ::next::Object create ${slotParent} + if {![::nx::core::objectproperty ${slotParent} object]} { + ::nx::Object create ${slotParent} } return ${slotParent}::$name } - ::next::MetaSlot method createFromParameterSyntax {target -per-object:switch + ::nx::MetaSlot method createFromParameterSyntax {target -per-object:switch {-initblock ""} value default:optional} { set opts [list] @@ -353,34 +353,34 @@ } :create [:slotName $name $target] {*}$opts $initblock - return [::next::core::cmd::${info}::method $target name $name] + return [::nx::core::cmd::${info}::method $target name $name] } - ::next::MetaSlot create ::next::Slot - ::next::MetaSlot create ::next::ObjectParameterSlot - ::next::core::relation ::next::ObjectParameterSlot superclass ::next::Slot + ::nx::MetaSlot create ::nx::Slot + ::nx::MetaSlot create ::nx::ObjectParameterSlot + ::nx::core::relation ::nx::ObjectParameterSlot superclass ::nx::Slot # # create class and object for method parameter slots - ::next::MetaSlot create ::next::MethodParameterSlot - ::next::core::relation ::next::MethodParameterSlot superclass ::next::Slot + ::nx::MetaSlot create ::nx::MethodParameterSlot + ::nx::core::relation ::nx::MethodParameterSlot superclass ::nx::Slot # create an object for dispatching - ::next::MethodParameterSlot create ::next::methodParameterSlot + ::nx::MethodParameterSlot create ::nx::methodParameterSlot # use low level interface for defining slot values. Normally, this is # done via slot objects, which are defined later. proc createBootstrapAttributeSlots {class definitions} { foreach att $definitions { if {[llength $att]>1} {foreach {att default} $att break} - set slotObj [::next::ObjectParameterSlot slotName $att $class] - ::next::ObjectParameterSlot create $slotObj + set slotObj [::nx::ObjectParameterSlot slotName $att $class] + ::nx::ObjectParameterSlot create $slotObj if {[info exists default]} { - ::next::core::setvar $slotObj default $default + ::nx::core::setvar $slotObj default $default unset default } - ::next::core::setter $class $att + ::nx::core::setter $class $att } # @@ -392,14 +392,14 @@ if {[info exists default]} { # checking subclasses is not required during bootstrap - foreach i [::next::core::cmd::ClassInfo::instances $class] { + foreach i [::nx::core::cmd::ClassInfo::instances $class] { if {![$i exists $att]} { if {[string match {*\[*\]*} $default]} { - set value [::next::core::dispatch $i -objscope ::eval subst $default] + set value [::nx::core::dispatch $i -objscope ::eval subst $default] } else { set value $default } - ::next::core::setvar $i $att $value + ::nx::core::setvar $i $att $value } } unset default @@ -414,82 +414,82 @@ ############################################ # Define slots for slots ############################################ - createBootstrapAttributeSlots ::next::Slot { + createBootstrapAttributeSlots ::nx::Slot { {name} {multivalued false} {required false} default type } - createBootstrapAttributeSlots ::next::ObjectParameterSlot { - {name "[namespace tail [::next::core::current object]]"} + createBootstrapAttributeSlots ::nx::ObjectParameterSlot { + {name "[namespace tail [::nx::core::current object]]"} {methodname} - {domain "[lindex [regexp -inline {^(.*)::slot::[^:]+$} [::next::core::current object]] 1]"} + {domain "[lindex [regexp -inline {^(.*)::slot::[^:]+$} [::nx::core::current object]] 1]"} {defaultmethods {get assign}} - {manager "[::next::core::current object]"} + {manager "[::nx::core::current object]"} {per-object false} } # maybe add the following slots at some later time here # initcmd # valuecmd # valuechangedcmd - ::next::core::alias ::next::ObjectParameterSlot get ::next::core::setvar - ::next::core::alias ::next::ObjectParameterSlot assign ::next::core::setvar + ::nx::core::alias ::nx::ObjectParameterSlot get ::nx::core::setvar + ::nx::core::alias ::nx::ObjectParameterSlot assign ::nx::core::setvar - ::next::ObjectParameterSlot public method add {obj prop value {pos 0}} { + ::nx::ObjectParameterSlot public method add {obj prop value {pos 0}} { if {![set :multivalued]} { error "Property $prop of [set :domain]->$obj ist not multivalued" } if {[$obj exists $prop]} { - ::next::core::setvar $obj $prop [linsert [::next::core::setvar $obj $prop] $pos $value] + ::nx::core::setvar $obj $prop [linsert [::nx::core::setvar $obj $prop] $pos $value] } else { - ::next::core::setvar $obj $prop [list $value] + ::nx::core::setvar $obj $prop [list $value] } } - ::next::ObjectParameterSlot public method delete {-nocomplain:switch obj prop value} { - set old [::next::core::setvar $obj $prop] + ::nx::ObjectParameterSlot public method delete {-nocomplain:switch obj prop value} { + set old [::nx::core::setvar $obj $prop] set p [lsearch -glob $old $value] - if {$p>-1} {::next::core::setvar $obj $prop [lreplace $old $p $p]} else { + if {$p>-1} {::nx::core::setvar $obj $prop [lreplace $old $p $p]} else { error "$value is not a $prop of $obj (valid are: $old)" } } - ::next::ObjectParameterSlot method unknown {method args} { + ::nx::ObjectParameterSlot method unknown {method args} { set methods [list] foreach m [:info callable] { - if {[::next::Object info callable $m] ne ""} continue + if {[::nx::Object info callable $m] ne ""} continue if {[string match __* $m]} continue lappend methods $m } - error "Method '$method' unknown for slot [::next::core::current object]; valid are: {[lsort $methods]}" + error "Method '$method' unknown for slot [::nx::core::current object]; valid are: {[lsort $methods]}" } - ::next::ObjectParameterSlot public method destroy {} { - if {${:domain} ne "" && [::next::core::objectproperty ${:domain} class]} { + ::nx::ObjectParameterSlot public method destroy {} { + if {${:domain} ne "" && [::nx::core::objectproperty ${:domain} class]} { ${:domain} __invalidateobjectparameter } - ::next::core::next + ::nx::core::next } - ::next::ObjectParameterSlot protected method init {args} { + ::nx::ObjectParameterSlot protected method init {args} { if {${:domain} eq ""} { - set :domain [::next::core::current callingobject] + set :domain [::nx::core::current callingobject] } if {${:domain} ne ""} { if {![info exists :methodname]} { set :methodname ${:name} } - if {[::next::core::objectproperty ${:domain} class]} { + if {[::nx::core::objectproperty ${:domain} class]} { ${:domain} __invalidateobjectparameter } if {${:per-object} && [info exists :default] } { - ::next::core::setvar ${:domain} ${:name} ${:default} + ::nx::core::setvar ${:domain} ${:name} ${:default} } set cl [expr {${:per-object} ? "Object" : "Class"}] - #puts stderr "Slot [::next::core::current object] init, forwarder on ${:domain}" - ::next::core::forward ${:domain} ${:name} \ + #puts stderr "Slot [::nx::core::current object] init, forwarder on ${:domain}" + ::nx::core::forward ${:domain} ${:name} \ ${:manager} \ [list %1 [${:manager} defaultmethods]] %self \ ${:methodname} @@ -503,11 +503,11 @@ # definition here before we refine the slot definitions. # # Invalidate previously defined object parameter. - ::next::MetaSlot __invalidateobjectparameter + ::nx::MetaSlot __invalidateobjectparameter # Provide the a slot based mechanism for building an object # configuration interface from slot definitions - ::next::ObjectParameterSlot method toParameterSyntax {{name:substdefault ${:name}}} { + ::nx::ObjectParameterSlot method toParameterSyntax {{name:substdefault ${:name}}} { set objparamdefinition $name set methodparamdefinition "" set objopts [list] @@ -519,7 +519,7 @@ } if {[info exists :type]} { if {[string match ::* ${:type}]} { - set type [expr {[::next::core::objectproperty ${:type} metaclass] ? "class" : "object"}] + set type [expr {[::nx::core::objectproperty ${:type} metaclass] ? "class" : "object"}] lappend objopts type=${:type} lappend methodopts type=${:type} } else { @@ -554,14 +554,14 @@ if {${:methodname} ne ${:name}} { lappend objopts arg=${:methodname} lappend methodopts arg=${:methodname} - #puts stderr "..... setting arg for methodname: [::next::core::current object] has arg arg=${:methodname}" + #puts stderr "..... setting arg for methodname: [::nx::core::current object] has arg arg=${:methodname}" } } if {$type ne ""} { set objopts [linsert $objopts 0 $type] set methodopts [linsert $methodopts 0 $type] } - lappend objopts slot=[::next::core::current object] + lappend objopts slot=[::nx::core::current object] if {[llength $objopts] > 0} { append objparamdefinition :[join $objopts ,] @@ -572,16 +572,16 @@ if {[info exists arg]} { lappend objparamdefinition $arg } - #puts stderr "[::next::core::current method] ${name} returns [list oparam $objparamdefinition mparam $methodparamdefinition]" + #puts stderr "[::nx::core::current method] ${name} returns [list oparam $objparamdefinition mparam $methodparamdefinition]" return [list oparam $objparamdefinition mparam $methodparamdefinition] } - proc ::next::core::parametersFromSlots {obj} { + proc ::nx::core::parametersFromSlots {obj} { set parameterdefinitions [list] - foreach slot [::next::objectInfo slotobjects $obj] { + foreach slot [::nx::objectInfo slotobjects $obj] { # Skip some slots for xotcl; # TODO: maybe different parameterFromSlots for xotcl? - if {[::next::core::objectproperty $obj type ::xotcl::Object] && + if {[::nx::core::objectproperty $obj type ::xotcl::Object] && ([$slot name] eq "mixin" || [$slot name] eq "filter") } continue array set "" [$slot toParameterSyntax] @@ -590,40 +590,40 @@ return $parameterdefinitions } - ::next::Object protected method objectparameter {{lastparameter __initcmd:initcmd,optional}} { - #puts stderr "... objectparameter [::next::core::current object]" - set parameterdefinitions [::next::core::parametersFromSlots [::next::core::current object]] - if {[::next::core::objectproperty [::next::core::current object] class]} { + ::nx::Object protected method objectparameter {{lastparameter __initcmd:initcmd,optional}} { + #puts stderr "... objectparameter [::nx::core::current object]" + set parameterdefinitions [::nx::core::parametersFromSlots [::nx::core::current object]] + if {[::nx::core::objectproperty [::nx::core::current object] class]} { lappend parameterdefinitions -parameter:method,optional } lappend parameterdefinitions \ -noinit:method,optional,noarg \ -volatile:method,optional,noarg \ {*}$lastparameter - #puts stderr "*** parameter definition for [::next::core::current object]: $parameterdefinitions" + #puts stderr "*** parameter definition for [::nx::core::current object]: $parameterdefinitions" return $parameterdefinitions } ############################################ # RelationSlot ############################################ - ::next::MetaSlot create ::next::RelationSlot - createBootstrapAttributeSlots ::next::RelationSlot { + ::nx::MetaSlot create ::nx::RelationSlot + createBootstrapAttributeSlots ::nx::RelationSlot { {multivalued true} {type relation} - {elementtype ::next::Class} + {elementtype ::nx::Class} } - ::next::core::relation ::next::RelationSlot superclass ::next::ObjectParameterSlot - ::next::core::alias ::next::RelationSlot assign ::next::core::relation + ::nx::core::relation ::nx::RelationSlot superclass ::nx::ObjectParameterSlot + ::nx::core::alias ::nx::RelationSlot assign ::nx::core::relation - ::next::RelationSlot protected method init {} { + ::nx::RelationSlot protected method init {} { if {${:type} ne "relation"} { error "RelationSlot requires type == \"relation\"" } - ::next::core::next + ::nx::core::next } - ::next::RelationSlot protected method delete_value {obj prop old value} { + ::nx::RelationSlot protected method delete_value {obj prop old value} { if {[string first * $value] > -1 || [string first \[ $value] > -1} { # value contains globbing meta characters if {${:elementtype} ne "" && ![string match ::* $value]} { @@ -635,12 +635,12 @@ # value contains no globbing meta characters, but elementtype is given if {[string first :: $value] == -1} { # get fully qualified name - if {![::next::core::objectproperty $value object]} { + if {![::nx::core::objectproperty $value object]} { error "$value does not appear to be an object" } - set value [::next::core::dispatch $value -objscope ::next::core::current object] + set value [::nx::core::dispatch $value -objscope ::nx::core::current object] } - if {![::next::core::objectproperty ${:elementtype} class]} { + if {![::nx::core::objectproperty ${:elementtype} class]} { error "$value does not appear to be of type ${:elementtype}" } } @@ -652,61 +652,61 @@ } } - ::next::RelationSlot public method delete {-nocomplain:switch obj prop value} { - #puts stderr RelationSlot-delete-[::next::core::current args] + ::nx::RelationSlot public method delete {-nocomplain:switch obj prop value} { + #puts stderr RelationSlot-delete-[::nx::core::current args] $obj $prop [:delete_value $obj $prop [$obj info $prop] $value] } - ::next::RelationSlot public method get {obj prop} { - ::next::core::relation $obj $prop + ::nx::RelationSlot public method get {obj prop} { + ::nx::core::relation $obj $prop } - ::next::RelationSlot public method add {obj prop value {pos 0}} { + ::nx::RelationSlot public method add {obj prop value {pos 0}} { if {![set :multivalued]} { error "Property $prop of ${:domain}->$obj ist not multivalued" } - set oldSetting [::next::core::relation $obj $prop] + set oldSetting [::nx::core::relation $obj $prop] # use uplevel to avoid namespace surprises - uplevel [list ::next::core::relation $obj $prop [linsert $oldSetting $pos $value]] + uplevel [list ::nx::core::relation $obj $prop [linsert $oldSetting $pos $value]] } - ::next::RelationSlot public method delete {-nocomplain:switch obj prop value} { - uplevel [list ::next::core::relation $obj $prop [:delete_value $obj $prop [::next::core::relation $obj $prop] $value]] + ::nx::RelationSlot public method delete {-nocomplain:switch obj prop value} { + uplevel [list ::nx::core::relation $obj $prop [:delete_value $obj $prop [::nx::core::relation $obj $prop] $value]] } ############################################ # system slots ############################################ - proc ::next::core::register_system_slots {os} { + proc ::nx::core::register_system_slots {os} { ${os}::Object alloc ${os}::Class::slot ${os}::Object alloc ${os}::Object::slot - ::next::RelationSlot create ${os}::Class::slot::superclass - ::next::core::alias ${os}::Class::slot::superclass assign ::next::core::relation - ::next::RelationSlot create ${os}::Object::slot::class -multivalued false - ::next::core::alias ${os}::Object::slot::class assign ::next::core::relation + ::nx::RelationSlot create ${os}::Class::slot::superclass + ::nx::core::alias ${os}::Class::slot::superclass assign ::nx::core::relation + ::nx::RelationSlot create ${os}::Object::slot::class -multivalued false + ::nx::core::alias ${os}::Object::slot::class assign ::nx::core::relation - ::next::RelationSlot create ${os}::Object::slot::mixin -methodname object-mixin - ::next::RelationSlot create ${os}::Object::slot::filter -elementtype "" + ::nx::RelationSlot create ${os}::Object::slot::mixin -methodname object-mixin + ::nx::RelationSlot create ${os}::Object::slot::filter -elementtype "" - ::next::RelationSlot create ${os}::Class::slot::mixin -methodname class-mixin - ::next::RelationSlot create ${os}::Class::slot::filter -elementtype "" \ + ::nx::RelationSlot create ${os}::Class::slot::mixin -methodname class-mixin + ::nx::RelationSlot create ${os}::Class::slot::filter -elementtype "" \ -methodname class-filter # Create two conveniance slots to allow configuration of # object-slots for classes via object-mixin - ::next::RelationSlot create ${os}::Class::slot::object-mixin - ::next::RelationSlot create ${os}::Class::slot::object-filter -elementtype "" + ::nx::RelationSlot create ${os}::Class::slot::object-mixin + ::nx::RelationSlot create ${os}::Class::slot::object-filter -elementtype "" } - ::next::core::register_system_slots ::next - proc ::next::core::register_system_slots {} {} + ::nx::core::register_system_slots ::nx + proc ::nx::core::register_system_slots {} {} ############################################ # Attribute slots ############################################ - ::next::MetaSlot __invalidateobjectparameter - ::next::MetaSlot create ::next::Attribute -superclass ::next::ObjectParameterSlot + ::nx::MetaSlot __invalidateobjectparameter + ::nx::MetaSlot create ::nx::Attribute -superclass ::nx::ObjectParameterSlot - createBootstrapAttributeSlots ::next::Attribute { + createBootstrapAttributeSlots ::nx::Attribute { {value_check once} incremental initcmd @@ -715,68 +715,68 @@ arg } - ::next::Attribute method __default_from_cmd {obj cmd var sub op} { - #puts "GETVAR [::next::core::current method] obj=$obj cmd=$cmd, var=$var, op=$op" - $obj trace remove variable $var $op [list [::next::core::current object] [::next::core::current method] $obj $cmd] - ::next::core::setvar $obj $var [$obj eval $cmd] + ::nx::Attribute method __default_from_cmd {obj cmd var sub op} { + #puts "GETVAR [::nx::core::current method] obj=$obj cmd=$cmd, var=$var, op=$op" + $obj trace remove variable $var $op [list [::nx::core::current object] [::nx::core::current method] $obj $cmd] + ::nx::core::setvar $obj $var [$obj eval $cmd] } - ::next::Attribute method __value_from_cmd {obj cmd var sub op} { - #puts "GETVAR [::next::core::current method] obj=$obj cmd=$cmd, var=$var, op=$op" - ::next::core::setvar $obj $var [$obj eval $cmd] + ::nx::Attribute method __value_from_cmd {obj cmd var sub op} { + #puts "GETVAR [::nx::core::current method] obj=$obj cmd=$cmd, var=$var, op=$op" + ::nx::core::setvar $obj $var [$obj eval $cmd] } - ::next::Attribute method __value_changed_cmd {obj cmd var sub op} { + ::nx::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 -> [::next::core::setvar $obj $var]" + # puts "valuechanged obj=$obj cmd=$cmd, var=$var, op=$op, ...\n$obj exists $var -> [::nx::core::setvar $obj $var]" eval $cmd } - ::next::Attribute protected method init {} { - ::next::core::next ;# do first ordinary slot initialization + ::nx::Attribute protected method init {} { + ::nx::core::next ;# do first ordinary slot initialization # there might be already default values registered on the class set __initcmd "" if {[:exists default]} { } elseif [:exists initcmd] { append __initcmd ":trace add variable [list ${:name}] read \ - \[list [::next::core::current object] __default_from_cmd \[::next::core::current object\] [list [set :initcmd]]\]\n" + \[list [::nx::core::current object] __default_from_cmd \[::nx::core::current object\] [list [set :initcmd]]\]\n" } elseif [:exists valuecmd] { append __initcmd ":trace add variable [list ${:name}] read \ - \[list [::next::core::current object] __value_from_cmd \[::next::core::current object\] [list [set :valuecmd]]\]" + \[list [::nx::core::current object] __value_from_cmd \[::nx::core::current object\] [list [set :valuecmd]]\]" } array set "" [:toParameterSyntax ${:name}] - #puts stderr "Attribute.init valueParam for [::next::core::current object] is $(mparam)" + #puts stderr "Attribute.init valueParam for [::nx::core::current object] is $(mparam)" if {$(mparam) ne ""} { if {[info exists :multivalued] && ${:multivalued}} { - #puts stderr "adding assign [list obj var value:$(mparam),multivalued] // for [::next::core::current object] with $(mparam)" - :method assign [list obj var value:$(mparam),multivalued,slot=[::next::core::current object]] { - ::next::core::setvar $obj $var $value + #puts stderr "adding assign [list obj var value:$(mparam),multivalued] // for [::nx::core::current object] with $(mparam)" + :method assign [list obj var value:$(mparam),multivalued,slot=[::nx::core::current object]] { + ::nx::core::setvar $obj $var $value } - #puts stderr "adding add method for [::next::core::current object] with value:$(mparam)" - :method add [list obj prop value:$(mparam),slot=[::next::core::current object] {pos 0}] { - ::next::core::next + #puts stderr "adding add method for [::nx::core::current object] with value:$(mparam)" + :method add [list obj prop value:$(mparam),slot=[::nx::core::current object] {pos 0}] { + ::nx::core::next } } else { - #puts stderr "SV adding assign [list obj var value:$(mparam)] // for [::next::core::current object] with $(mparam)" - :method assign [list obj var value:$(mparam),slot=[::next::core::current object]] { - ::next::core::setvar $obj $var $value + #puts stderr "SV adding assign [list obj var value:$(mparam)] // for [::nx::core::current object] with $(mparam)" + :method assign [list obj var value:$(mparam),slot=[::nx::core::current object]] { + ::nx::core::setvar $obj $var $value } } } if {[:exists valuechangedcmd]} { append __initcmd ":trace add variable [list ${:name}] write \ - \[list [::next::core::current object] __value_changed_cmd \[::next::core::current object\] [list [set :valuechangedcmd]]\]" + \[list [::nx::core::current object] __value_changed_cmd \[::nx::core::current object\] [list [set :valuechangedcmd]]\]" } if {$__initcmd ne ""} { set :initcmd $__initcmd } } # mixin class for optimizing slots - ::next::Class create ::next::Attribute::Optimizer { + ::nx::Class create ::nx::Attribute::Optimizer { - :method method args {::next::core::next; :optimize} - :method forward args {::next::core::next; :optimize} - :protected method init args {::next::core::next; :optimize} + :method method args {::nx::core::next; :optimize} + :method forward args {::nx::core::next; :optimize} + :protected method init args {::nx::core::next; :optimize} :public method optimize {} { #puts stderr OPTIMIZER-[info exists :incremental] @@ -789,9 +789,9 @@ set perObject "" set infokind Class } - if {[::next::core::cmd::${infokind}Info::method ${:domain} name ${:name}] ne ""} { + if {[::nx::core::cmd::${infokind}Info::method ${:domain} name ${:name}] ne ""} { #puts stderr "OPTIMIZER RESETTING ${:domain} slot ${:name}" - ::next::core::forward ${:domain} {*}$perObject ${:name} \ + ::nx::core::forward ${:domain} {*}$perObject ${:name} \ ${:manager} \ [list %1 [${:manager} defaultmethods]] %self \ ${:methodname} @@ -802,9 +802,9 @@ set assignInfo [:info callable -which assign] #puts stderr "OPTIMIZER assign=$assignInfo//[lindex $assignInfo {end 0}]//[:info precedence]" - if {$assignInfo ne "::next::ObjectParameterSlot alias assign ::next::core::setvar" && - [lindex $assignInfo {end 0}] ne "::next::core::setvar" } return - if {[:info callable -which get] ne "::next::ObjectParameterSlot alias get ::next::core::setvar"} return + if {$assignInfo ne "::nx::ObjectParameterSlot alias assign ::nx::core::setvar" && + [lindex $assignInfo {end 0}] ne "::nx::core::setvar" } return + if {[:info callable -which get] ne "::nx::ObjectParameterSlot alias get ::nx::core::setvar"} return array set "" [:toParameterSyntax ${:name}] if {$(mparam) ne ""} { @@ -813,35 +813,35 @@ } else { set setterParam ${:name} } - ::next::core::setter ${:domain} {*}$perObject $setterParam - #puts stderr "::next::core::setter ${:domain} {*}$perObject $setterParam" + ::nx::core::setter ${:domain} {*}$perObject $setterParam + #puts stderr "::nx::core::setter ${:domain} {*}$perObject $setterParam" } } # register the optimizer per default - ::next::Attribute mixin add ::next::Attribute::Optimizer + ::nx::Attribute mixin add ::nx::Attribute::Optimizer ############################################ # Define method "attribute" for convenience ############################################ - ::next::Class method attribute {spec {-slotclass ::next::Attribute} {initblock ""}} { - $slotclass createFromParameterSyntax [::next::core::current object] -initblock $initblock {*}$spec + ::nx::Class method attribute {spec {-slotclass ::nx::Attribute} {initblock ""}} { + $slotclass createFromParameterSyntax [::nx::core::current object] -initblock $initblock {*}$spec } - ::next::Object method attribute {spec {-slotclass ::next::Attribute} {initblock ""}} { - $slotclass createFromParameterSyntax [::next::core::current object] -per-object -initblock $initblock {*}$spec + ::nx::Object method attribute {spec {-slotclass ::nx::Attribute} {initblock ""}} { + $slotclass createFromParameterSyntax [::nx::core::current object] -per-object -initblock $initblock {*}$spec } ############################################ # Define method "parameter" for backward # compatibility and convenience ############################################ - ::next::Class public method parameter arglist { + ::nx::Class public method parameter arglist { foreach arg $arglist { - ::next::Attribute createFromParameterSyntax [::next::core::current object] {*}$arg + ::nx::Attribute createFromParameterSyntax [::nx::core::current object] {*}$arg } # todo needed? - set slot [::next::core::current object]::slot - if {![::next::core::objectproperty $slot object]} {::next::Object create $slot} - ::next::core::setvar $slot __parameter $arglist + set slot [::nx::core::current object]::slot + if {![::nx::core::objectproperty $slot object]} {::nx::Object create $slot} + ::nx::core::setvar $slot __parameter $arglist } ################################################################## @@ -853,25 +853,25 @@ proc createBootstrapAttributeSlots {} {} ################################################################## - # create user-level converter/checker based on ::next::core primitves + # create user-level converter/checker based on ::nx::core primitves ################################################################## - ::next::Slot method type=hasmixin {name value arg} { - if {![::next::core::objectproperty $value hasmixin $arg]} { + ::nx::Slot method type=hasmixin {name value arg} { + if {![::nx::core::objectproperty $value hasmixin $arg]} { error "expected object with mixin $arg but got \"$value\" for parameter $name" } return $value } - ::next::Slot method type=baseclass {name value} { - if {![::next::core::objectproperty $value baseclass]} { + ::nx::Slot method type=baseclass {name value} { + if {![::nx::core::objectproperty $value baseclass]} { error "expected baseclass but got \"$value\" for parameter $name" } return $value } - ::next::Slot method type=metaclass {name value} { - if {![::next::core::objectproperty $value metaclass]} { + ::nx::Slot method type=metaclass {name value} { + if {![::nx::core::objectproperty $value metaclass]} { error "expected metaclass but got \"$value\" for parameter $name" } return $value @@ -881,22 +881,22 @@ ################################################################## # Create a mixin class to overload method "new" such it does not -# allocate new objects in ::next::*, but in the specified object +# allocate new objects in ::nx::*, but in the specified object # (without syntactic overhead). ################################################################## -::next::Class create ::next::ScopedNew -superclass ::next::Class { +::nx::Class create ::nx::ScopedNew -superclass ::nx::Class { - :attribute {withclass ::next::Object} + :attribute {withclass ::nx::Object} :attribute container :protected method init {} { :public method new {-childof args} { - ::next::core::importvar [::next::core::current class] {container object} withclass - if {![::next::core::objectproperty $object object]} { + ::nx::core::importvar [::nx::core::current class] {container object} withclass + if {![::nx::core::objectproperty $object object]} { $withclass create $object } - eval ::next::core::next -childof $object $args + eval ::nx::core::next -childof $object $args } } } @@ -908,36 +908,36 @@ # creating new objects in the specified scope can be turned off. ################################################################## -::next::Object public method contains { +::nx::Object public method contains { {-withnew:boolean true} -object - {-class ::next::Object} + {-class ::nx::Object} cmds } { - if {![info exists object]} {set object [::next::core::current object]} - if {![::next::core::objectproperty $object object]} {$class create $object} + if {![info exists object]} {set object [::nx::core::current object]} + if {![::nx::core::objectproperty $object object]} {$class create $object} $object requireNamespace if {$withnew} { - set m [::next::ScopedNew new -volatile \ + set m [::nx::ScopedNew new -volatile \ -container $object -withclass $class] - ::next::Class mixin add $m end + ::nx::Class mixin add $m end # TODO: the following is not pretty; however, contains might build xotcl1 and next objects. - if {[::next::core::objectproperty ::xotcl::Class class]} {::xotcl::Class instmixin add $m end} + if {[::nx::core::objectproperty ::xotcl::Class class]} {::xotcl::Class instmixin add $m end} namespace eval $object $cmds - ::next::Class mixin delete $m - if {[::next::core::objectproperty ::xotcl::Class class]} {::xotcl::Class instmixin delete $m} + ::nx::Class mixin delete $m + if {[::nx::core::objectproperty ::xotcl::Class class]} {::xotcl::Class instmixin delete $m} } else { namespace eval $object $cmds } } -::next::Class forward slots %self contains \ - -object {%::next::core::dispatch [::next::core::current object] -objscope ::subst [::next::core::current object]::slot} +::nx::Class forward slots %self contains \ + -object {%::nx::core::dispatch [::nx::core::current object] -objscope ::subst [::nx::core::current object]::slot} ################################################################## # copy/move implementation ################################################################## -::next::Class create ::next::CopyHandler { +::nx::Class create ::nx::CopyHandler { :attribute {targetList ""} :attribute {dest ""} @@ -947,7 +947,7 @@ lappend :targetList $t #puts stderr "COPY makeTargetList $t target= ${:targetList}" # if it is an object without namespace, it is a leaf - if {[::next::core::objectproperty $t object]} { + if {[::nx::core::objectproperty $t object]} { if {[$t info hasnamespace]} { # make target list from all children set children [$t info children] @@ -959,7 +959,7 @@ # now append all namespaces that are in the obj, but that # are not objects foreach c [namespace children $t] { - if {![::next::core::objectproperty $c object]} { + if {![::nx::core::objectproperty $c object]} { lappend children [namespace children $t] } } @@ -973,8 +973,8 @@ :method copyNSVarsAndCmds {orig dest} { - ::next::core::namespace_copyvars $orig $dest - ::next::core::namespace_copycmds $orig $dest + ::nx::core::namespace_copyvars $orig $dest + ::nx::core::namespace_copycmds $orig $dest } # construct destination obj name from old qualified ns name @@ -987,44 +987,44 @@ #puts stderr "COPY will copy targetList = [set :targetList]" foreach origin [set :targetList] { set dest [:getDest $origin] - if {[::next::core::objectproperty $origin object]} { + if {[::nx::core::objectproperty $origin object]} { # copy class information - if {[::next::core::objectproperty $origin class]} { + if {[::nx::core::objectproperty $origin class]} { set cl [[$origin info class] create $dest -noinit] # class object set obj $cl $cl superclass [$origin info superclass] - ::next::core::assertion $cl class-invar [::next::core::assertion $origin class-invar] - ::next::core::relation $cl class-filter [::next::core::relation $origin class-filter] - ::next::core::relation $cl class-mixin [::next::core::relation $origin class-mixin] - :copyNSVarsAndCmds ::next::core::classes$origin ::next::core::classes$dest + ::nx::core::assertion $cl class-invar [::nx::core::assertion $origin class-invar] + ::nx::core::relation $cl class-filter [::nx::core::relation $origin class-filter] + ::nx::core::relation $cl class-mixin [::nx::core::relation $origin class-mixin] + :copyNSVarsAndCmds ::nx::core::classes$origin ::nx::core::classes$dest } else { # create obj set obj [[$origin info class] create $dest -noinit] } # copy object -> may be a class obj - ::next::core::assertion $obj check [::next::core::assertion $origin check] - ::next::core::assertion $obj object-invar [::next::core::assertion $origin object-invar] - ::next::core::relation $obj object-filter [::next::core::relation $origin object-filter] - ::next::core::relation $obj object-mixin [::next::core::relation $origin object-mixin] + ::nx::core::assertion $obj check [::nx::core::assertion $origin check] + ::nx::core::assertion $obj object-invar [::nx::core::assertion $origin object-invar] + ::nx::core::relation $obj object-filter [::nx::core::relation $origin object-filter] + ::nx::core::relation $obj object-mixin [::nx::core::relation $origin object-mixin] if {[$origin info hasnamespace]} { $obj requireNamespace } } else { namespace eval $dest {} } :copyNSVarsAndCmds $origin $dest - foreach i [::next::core::cmd::ObjectInfo::forward $origin] { - eval [concat ::next::core::forward $dest -per-object $i [::next::core::cmd::ObjectInfo::forward $origin -definition $i]] + foreach i [::nx::core::cmd::ObjectInfo::forward $origin] { + eval [concat ::nx::core::forward $dest -per-object $i [::nx::core::cmd::ObjectInfo::forward $origin -definition $i]] } - if {[::next::core::objectproperty $origin class]} { - foreach i [::next::core::cmd::ClassInfo::forward $origin] { - eval [concat ::next::core::forward $dest $i [::next::core::cmd::ClassInfo::forward $origin -definition $i]] + if {[::nx::core::objectproperty $origin class]} { + foreach i [::nx::core::cmd::ClassInfo::forward $origin] { + eval [concat ::nx::core::forward $dest $i [::nx::core::cmd::ClassInfo::forward $origin -definition $i]] } } set traces [list] foreach var [$origin info vars] { - set cmds [::next::core::dispatch $origin -objscope ::trace info variable $var] + set cmds [::nx::core::dispatch $origin -objscope ::trace info variable $var] if {$cmds ne ""} { foreach cmd $cmds { foreach {op def} $cmd break @@ -1040,10 +1040,10 @@ } # alter 'domain' and 'manager' in slot objects for classes foreach origin [set :targetList] { - if {[::next::core::objectproperty $origin class]} { + if {[::nx::core::objectproperty $origin class]} { set dest [:getDest $origin] foreach oldslot [$origin info slots] { - set newslot [::next::Slot slotName [namespace tail $oldslot] $dest] + set newslot [::nx::Slot slotName [namespace tail $oldslot] $dest] if {[$oldslot domain] eq $origin} {$newslot domain $cl} if {[$oldslot manager] eq $oldslot} {$newslot manager $newslot} } @@ -1052,7 +1052,7 @@ } :public method copy {obj dest} { - #puts stderr "[::next::core::current object] copy <$obj> <$dest>" + #puts stderr "[::nx::core::current object] copy <$obj> <$dest>" set :objLength [string length $obj] set :dest $dest :makeTargetList $obj @@ -1061,22 +1061,22 @@ } -::next::Object public method copy newName { - if {[string compare [string trimleft $newName :] [string trimleft [::next::core::current object] :]]} { - [::next::CopyHandler new -volatile] copy [::next::core::current object] $newName +::nx::Object public method copy newName { + if {[string compare [string trimleft $newName :] [string trimleft [::nx::core::current object] :]]} { + [::nx::CopyHandler new -volatile] copy [::nx::core::current object] $newName } } -::next::Object public method move newName { - if {[string trimleft $newName :] ne [string trimleft [::next::core::current object] :]} { +::nx::Object public method move newName { + if {[string trimleft $newName :] ne [string trimleft [::nx::core::current object] :]} { if {$newName ne ""} { :copy $newName } ### let all subclasses get the copied class as superclass - if {[::next::core::objectproperty [::next::core::current object] class] && $newName ne ""} { + if {[::nx::core::objectproperty [::nx::core::current object] class] && $newName ne ""} { foreach subclass [:info subclass] { set scl [$subclass info superclass] - if {[set index [lsearch -exact $scl [::next::core::current object]]] != -1} { + if {[set index [lsearch -exact $scl [::nx::core::current object]]] != -1} { set scl [lreplace $scl $index $index $newName] $subclass superclass $scl } @@ -1090,7 +1090,7 @@ # some utilities ####################################################### -namespace eval ::next::core { +namespace eval ::nx::core { # # determine platform aware temp directory # @@ -1123,7 +1123,7 @@ } default { if {$callingNs ne "::xotcl"} {uplevel {namespace import -force ::xotcl::*}} - if {$callingNs ne "::next"} {uplevel {namespace import -force ::next::*}} + if {$callingNs ne "::next"} {uplevel {namespace import -force ::nx::*}} } } } @@ -1133,16 +1133,16 @@ ####################################################################### # common code for all xotcl versions -namespace eval ::next { +namespace eval ::nx { # export the contents for all xotcl versions namespace export Attribute current # if HOME is not set, and ~ is resolved, Tcl chokes on that if {![info exists ::env(HOME)]} {set ::env(HOME) /root} - set ::next::confdir ~/.xotcl - set ::next::logdir $::next::confdir/log + set ::nx::confdir ~/.xotcl + set ::nx::logdir $::nx::confdir/log unset bootstrap } @@ -1151,9 +1151,9 @@ # The following will go away # #namespace eval ::xotcl { -# namespace import ::next::core::use +# namespace import ::nx::core::use #} -#foreach ns {::next ::next::core} { +#foreach ns {::next ::nx::core} { # puts stderr "$ns exports [namespace eval $ns {lsort [namespace export]}]" #} Index: generic/tclAPI.h =================================================================== diff -u -r81c800c8b9cb42ef6743d9b80ac2be5ca211a69a -r3f0573cc75724179f416942b974373e5a62ec05e --- generic/tclAPI.h (.../tclAPI.h) (revision 81c800c8b9cb42ef6743d9b80ac2be5ca211a69a) +++ generic/tclAPI.h (.../tclAPI.h) (revision 3f0573cc75724179f416942b974373e5a62ec05e) @@ -139,11 +139,12 @@ static methodDefinition method_definitions[]; static CONST char *method_command_namespace_names[] = { - "::next::core::cmd::ObjectInfo", - "::next::core::cmd::Object", - "::next::core::cmd::ClassInfo", - "::next::core::cmd::ParameterType", - "::next::core::cmd::Class" + "::nx::core::cmd::ObjectInfo", + "::nx::core::cmd::Object", + "::nx::core", + "::nx::core::cmd::ClassInfo", + "::nx::core::cmd::ParameterType", + "::nx::core::cmd::Class" }; static int XOTclCAllocMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclCCreateMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); @@ -1978,104 +1979,104 @@ } static methodDefinition method_definitions[] = { -{"::next::core::cmd::Class::alloc", XOTclCAllocMethodStub, 1, { +{"::nx::core::cmd::Class::alloc", XOTclCAllocMethodStub, 1, { {"name", 1, 0, convertToTclobj}} }, -{"::next::core::cmd::Class::create", XOTclCCreateMethodStub, 2, { +{"::nx::core::cmd::Class::create", XOTclCCreateMethodStub, 2, { {"name", 1, 0, convertToString}, {"args", 0, 0, convertToNothing}} }, -{"::next::core::cmd::Class::dealloc", XOTclCDeallocMethodStub, 1, { +{"::nx::core::cmd::Class::dealloc", XOTclCDeallocMethodStub, 1, { {"object", 1, 0, convertToTclobj}} }, -{"::next::core::cmd::Class::filterguard", XOTclCFilterGuardMethodStub, 2, { +{"::nx::core::cmd::Class::filterguard", XOTclCFilterGuardMethodStub, 2, { {"filter", 1, 0, convertToString}, {"guard", 1, 0, convertToTclobj}} }, -{"::next::core::cmd::Class::__invalidateobjectparameter", XOTclCInvalidateObjectParameterMethodStub, 0, { +{"::nx::core::cmd::Class::__invalidateobjectparameter", XOTclCInvalidateObjectParameterMethodStub, 0, { } }, -{"::next::core::cmd::Class::mixinguard", XOTclCMixinGuardMethodStub, 2, { +{"::nx::core::cmd::Class::mixinguard", XOTclCMixinGuardMethodStub, 2, { {"mixin", 1, 0, convertToString}, {"guard", 1, 0, convertToTclobj}} }, -{"::next::core::cmd::Class::new", XOTclCNewMethodStub, 2, { +{"::nx::core::cmd::Class::new", XOTclCNewMethodStub, 2, { {"-childof", 0, 1, convertToObject}, {"args", 0, 0, convertToNothing}} }, -{"::next::core::cmd::Class::recreate", XOTclCRecreateMethodStub, 2, { +{"::nx::core::cmd::Class::recreate", XOTclCRecreateMethodStub, 2, { {"name", 1, 0, convertToTclobj}, {"args", 0, 0, convertToNothing}} }, -{"::next::core::cmd::ClassInfo::filter", XOTclClassInfoFilterMethodStub, 3, { +{"::nx::core::cmd::ClassInfo::filter", XOTclClassInfoFilterMethodStub, 3, { {"class", 1, 0, convertToClass}, {"-guards", 0, 0, convertToString}, {"pattern", 0, 0, convertToString}} }, -{"::next::core::cmd::ClassInfo::filterguard", XOTclClassInfoFilterguardMethodStub, 2, { +{"::nx::core::cmd::ClassInfo::filterguard", XOTclClassInfoFilterguardMethodStub, 2, { {"class", 1, 0, convertToClass}, {"filter", 1, 0, convertToString}} }, -{"::next::core::cmd::ClassInfo::forward", XOTclClassInfoForwardMethodStub, 3, { +{"::nx::core::cmd::ClassInfo::forward", XOTclClassInfoForwardMethodStub, 3, { {"class", 1, 0, convertToClass}, {"-definition", 0, 0, convertToString}, {"name", 0, 0, convertToString}} }, -{"::next::core::cmd::ClassInfo::heritage", XOTclClassInfoHeritageMethodStub, 2, { +{"::nx::core::cmd::ClassInfo::heritage", XOTclClassInfoHeritageMethodStub, 2, { {"class", 1, 0, convertToClass}, {"pattern", 0, 0, convertToString}} }, -{"::next::core::cmd::ClassInfo::instances", XOTclClassInfoInstancesMethodStub, 3, { +{"::nx::core::cmd::ClassInfo::instances", XOTclClassInfoInstancesMethodStub, 3, { {"class", 1, 0, convertToClass}, {"-closure", 0, 0, convertToString}, {"pattern", 0, 0, convertToObjpattern}} }, -{"::next::core::cmd::ClassInfo::method", XOTclClassInfoMethodMethodStub, 3, { +{"::nx::core::cmd::ClassInfo::method", XOTclClassInfoMethodMethodStub, 3, { {"class", 0, 0, convertToClass}, {"infomethodsubcmd", 0, 0, convertToInfomethodsubcmd}, {"name", 0, 0, convertToString}} }, -{"::next::core::cmd::ClassInfo::methods", XOTclClassInfoMethodsMethodStub, 6, { +{"::nx::core::cmd::ClassInfo::methods", XOTclClassInfoMethodsMethodStub, 6, { {"object", 0, 0, convertToClass}, {"-methodtype", 0, 1, convertToMethodtype}, {"-callprotection", 0, 1, convertToCallprotection}, {"-nomixins", 0, 0, convertToString}, {"-incontext", 0, 0, convertToString}, {"pattern", 0, 0, convertToString}} }, -{"::next::core::cmd::ClassInfo::mixin", XOTclClassInfoMixinMethodStub, 4, { +{"::nx::core::cmd::ClassInfo::mixin", XOTclClassInfoMixinMethodStub, 4, { {"class", 1, 0, convertToClass}, {"-closure", 0, 0, convertToString}, {"-guards", 0, 0, convertToString}, {"pattern", 0, 0, convertToObjpattern}} }, -{"::next::core::cmd::ClassInfo::mixinof", XOTclClassInfoMixinOfMethodStub, 4, { +{"::nx::core::cmd::ClassInfo::mixinof", XOTclClassInfoMixinOfMethodStub, 4, { {"class", 1, 0, convertToClass}, {"-closure", 0, 0, convertToString}, {"-scope", 0, 1, convertToScope}, {"pattern", 0, 0, convertToObjpattern}} }, -{"::next::core::cmd::ClassInfo::mixinguard", XOTclClassInfoMixinguardMethodStub, 2, { +{"::nx::core::cmd::ClassInfo::mixinguard", XOTclClassInfoMixinguardMethodStub, 2, { {"class", 1, 0, convertToClass}, {"mixin", 1, 0, convertToString}} }, -{"::next::core::cmd::ClassInfo::parameter", XOTclClassInfoParameterMethodStub, 1, { +{"::nx::core::cmd::ClassInfo::parameter", XOTclClassInfoParameterMethodStub, 1, { {"class", 1, 0, convertToClass}} }, -{"::next::core::cmd::ClassInfo::slots", XOTclClassInfoSlotsMethodStub, 1, { +{"::nx::core::cmd::ClassInfo::slots", XOTclClassInfoSlotsMethodStub, 1, { {"class", 1, 0, convertToClass}} }, -{"::next::core::cmd::ClassInfo::subclass", XOTclClassInfoSubclassMethodStub, 3, { +{"::nx::core::cmd::ClassInfo::subclass", XOTclClassInfoSubclassMethodStub, 3, { {"class", 1, 0, convertToClass}, {"-closure", 0, 0, convertToString}, {"pattern", 0, 0, convertToObjpattern}} }, -{"::next::core::cmd::ClassInfo::superclass", XOTclClassInfoSuperclassMethodStub, 3, { +{"::nx::core::cmd::ClassInfo::superclass", XOTclClassInfoSuperclassMethodStub, 3, { {"class", 1, 0, convertToClass}, {"-closure", 0, 0, convertToString}, {"pattern", 0, 0, convertToTclobj}} }, -{"::next::core::cmd::ObjectInfo::callable", XOTclObjInfoCallableMethodStub, 8, { +{"::nx::core::cmd::ObjectInfo::callable", XOTclObjInfoCallableMethodStub, 8, { {"object", 0, 0, convertToObject}, {"-which", 0, 0, convertToString}, {"-methodtype", 0, 1, convertToMethodtype}, @@ -2085,172 +2086,172 @@ {"-incontext", 0, 0, convertToString}, {"pattern", 0, 0, convertToString}} }, -{"::next::core::cmd::ObjectInfo::children", XOTclObjInfoChildrenMethodStub, 2, { +{"::nx::core::cmd::ObjectInfo::children", XOTclObjInfoChildrenMethodStub, 2, { {"object", 1, 0, convertToObject}, {"pattern", 0, 0, convertToString}} }, -{"::next::core::cmd::ObjectInfo::class", XOTclObjInfoClassMethodStub, 1, { +{"::nx::core::cmd::ObjectInfo::class", XOTclObjInfoClassMethodStub, 1, { {"object", 1, 0, convertToObject}} }, -{"::next::core::cmd::ObjectInfo::filter", XOTclObjInfoFilterMethodStub, 4, { +{"::nx::core::cmd::ObjectInfo::filter", XOTclObjInfoFilterMethodStub, 4, { {"object", 1, 0, convertToObject}, {"-order", 0, 0, convertToString}, {"-guards", 0, 0, convertToString}, {"pattern", 0, 0, convertToString}} }, -{"::next::core::cmd::ObjectInfo::filterguard", XOTclObjInfoFilterguardMethodStub, 2, { +{"::nx::core::cmd::ObjectInfo::filterguard", XOTclObjInfoFilterguardMethodStub, 2, { {"object", 1, 0, convertToObject}, {"filter", 1, 0, convertToString}} }, -{"::next::core::cmd::ObjectInfo::forward", XOTclObjInfoForwardMethodStub, 3, { +{"::nx::core::cmd::ObjectInfo::forward", XOTclObjInfoForwardMethodStub, 3, { {"object", 1, 0, convertToObject}, {"-definition", 0, 0, convertToString}, {"name", 0, 0, convertToString}} }, -{"::next::core::cmd::ObjectInfo::hasnamespace", XOTclObjInfoHasnamespaceMethodStub, 1, { +{"::nx::core::cmd::ObjectInfo::hasnamespace", XOTclObjInfoHasnamespaceMethodStub, 1, { {"object", 1, 0, convertToObject}} }, -{"::next::core::cmd::ObjectInfo::method", XOTclObjInfoMethodMethodStub, 3, { +{"::nx::core::cmd::ObjectInfo::method", XOTclObjInfoMethodMethodStub, 3, { {"object", 0, 0, convertToObject}, {"infomethodsubcmd", 0, 0, convertToInfomethodsubcmd}, {"name", 0, 0, convertToString}} }, -{"::next::core::cmd::ObjectInfo::methods", XOTclObjInfoMethodsMethodStub, 6, { +{"::nx::core::cmd::ObjectInfo::methods", XOTclObjInfoMethodsMethodStub, 6, { {"object", 0, 0, convertToObject}, {"-methodtype", 0, 1, convertToMethodtype}, {"-callprotection", 0, 1, convertToCallprotection}, {"-nomixins", 0, 0, convertToString}, {"-incontext", 0, 0, convertToString}, {"pattern", 0, 0, convertToString}} }, -{"::next::core::cmd::ObjectInfo::mixin", XOTclObjInfoMixinMethodStub, 4, { +{"::nx::core::cmd::ObjectInfo::mixin", XOTclObjInfoMixinMethodStub, 4, { {"object", 1, 0, convertToObject}, {"-guards", 0, 0, convertToString}, {"-order", 0, 0, convertToString}, {"pattern", 0, 0, convertToObjpattern}} }, -{"::next::core::cmd::ObjectInfo::mixinguard", XOTclObjInfoMixinguardMethodStub, 2, { +{"::nx::core::cmd::ObjectInfo::mixinguard", XOTclObjInfoMixinguardMethodStub, 2, { {"object", 1, 0, convertToObject}, {"mixin", 1, 0, convertToString}} }, -{"::next::core::cmd::ObjectInfo::parent", XOTclObjInfoParentMethodStub, 1, { +{"::nx::core::cmd::ObjectInfo::parent", XOTclObjInfoParentMethodStub, 1, { {"object", 1, 0, convertToObject}} }, -{"::next::core::cmd::ObjectInfo::precedence", XOTclObjInfoPrecedenceMethodStub, 3, { +{"::nx::core::cmd::ObjectInfo::precedence", XOTclObjInfoPrecedenceMethodStub, 3, { {"object", 1, 0, convertToObject}, {"-intrinsic", 0, 0, convertToString}, {"pattern", 0, 0, convertToString}} }, -{"::next::core::cmd::ObjectInfo::slotobjects", XOTclObjInfoSlotObjectsMethodStub, 2, { +{"::nx::core::cmd::ObjectInfo::slotobjects", XOTclObjInfoSlotObjectsMethodStub, 2, { {"object", 1, 0, convertToObject}, {"pattern", 0, 0, convertToString}} }, -{"::next::core::cmd::ObjectInfo::vars", XOTclObjInfoVarsMethodStub, 2, { +{"::nx::core::cmd::ObjectInfo::vars", XOTclObjInfoVarsMethodStub, 2, { {"object", 1, 0, convertToObject}, {"pattern", 0, 0, convertToString}} }, -{"::next::core::cmd::Object::autoname", XOTclOAutonameMethodStub, 3, { +{"::nx::core::cmd::Object::autoname", XOTclOAutonameMethodStub, 3, { {"-instance", 0, 0, convertToString}, {"-reset", 0, 0, convertToString}, {"name", 1, 0, convertToTclobj}} }, -{"::next::core::cmd::Object::cleanup", XOTclOCleanupMethodStub, 0, { +{"::nx::core::cmd::Object::cleanup", XOTclOCleanupMethodStub, 0, { } }, -{"::next::core::cmd::Object::configure", XOTclOConfigureMethodStub, 1, { +{"::nx::core::cmd::Object::configure", XOTclOConfigureMethodStub, 1, { {"args", 0, 0, convertToNothing}} }, -{"::next::core::cmd::Object::destroy", XOTclODestroyMethodStub, 0, { +{"::nx::core::cmd::Object::destroy", XOTclODestroyMethodStub, 0, { } }, -{"::next::core::cmd::Object::exists", XOTclOExistsMethodStub, 1, { +{"::nx::core::cmd::Object::exists", XOTclOExistsMethodStub, 1, { {"var", 1, 0, convertToString}} }, -{"::next::core::cmd::Object::filterguard", XOTclOFilterGuardMethodStub, 2, { +{"::nx::core::cmd::Object::filterguard", XOTclOFilterGuardMethodStub, 2, { {"filter", 1, 0, convertToString}, {"guard", 1, 0, convertToTclobj}} }, -{"::next::core::cmd::Object::filtersearch", XOTclOFilterSearchMethodStub, 1, { +{"::nx::core::cmd::Object::filtersearch", XOTclOFilterSearchMethodStub, 1, { {"filter", 1, 0, convertToString}} }, -{"::next::core::cmd::Object::instvar", XOTclOInstVarMethodStub, 1, { +{"::nx::core::cmd::Object::instvar", XOTclOInstVarMethodStub, 1, { {"args", 0, 0, convertToNothing}} }, -{"::next::core::cmd::Object::mixinguard", XOTclOMixinGuardMethodStub, 2, { +{"::nx::core::cmd::Object::mixinguard", XOTclOMixinGuardMethodStub, 2, { {"mixin", 1, 0, convertToString}, {"guard", 1, 0, convertToTclobj}} }, -{"::next::core::cmd::Object::__next", XOTclONextMethodStub, 1, { +{"::nx::core::cmd::Object::__next", XOTclONextMethodStub, 1, { {"args", 0, 0, convertToNothing}} }, -{"::next::core::cmd::Object::noinit", XOTclONoinitMethodStub, 0, { +{"::nx::core::cmd::Object::noinit", XOTclONoinitMethodStub, 0, { } }, -{"::next::core::cmd::Object::requireNamespace", XOTclORequireNamespaceMethodStub, 0, { +{"::nx::core::cmd::Object::requireNamespace", XOTclORequireNamespaceMethodStub, 0, { } }, -{"::next::core::cmd::Object::residualargs", XOTclOResidualargsMethodStub, 1, { +{"::nx::core::cmd::Object::residualargs", XOTclOResidualargsMethodStub, 1, { {"args", 0, 0, convertToNothing}} }, -{"::next::core::cmd::Object::uplevel", XOTclOUplevelMethodStub, 1, { +{"::nx::core::cmd::Object::uplevel", XOTclOUplevelMethodStub, 1, { {"args", 0, 0, convertToNothing}} }, -{"::next::core::cmd::Object::upvar", XOTclOUpvarMethodStub, 1, { +{"::nx::core::cmd::Object::upvar", XOTclOUpvarMethodStub, 1, { {"args", 0, 0, convertToNothing}} }, -{"::next::core::cmd::Object::volatile", XOTclOVolatileMethodStub, 0, { +{"::nx::core::cmd::Object::volatile", XOTclOVolatileMethodStub, 0, { } }, -{"::next::core::cmd::Object::vwait", XOTclOVwaitMethodStub, 1, { +{"::nx::core::cmd::Object::vwait", XOTclOVwaitMethodStub, 1, { {"varname", 1, 0, convertToString}} }, -{"::next::core::alias", XOTclAliasCmdStub, 6, { +{"::nx::core::alias", XOTclAliasCmdStub, 6, { {"object", 0, 0, convertToObject}, {"-per-object", 0, 0, convertToString}, {"methodName", 0, 0, convertToString}, {"-nonleaf", 0, 0, convertToString}, {"-objscope", 0, 0, convertToString}, {"cmdName", 1, 0, convertToTclobj}} }, -{"::next::core::assertion", XOTclAssertionCmdStub, 3, { +{"::nx::core::assertion", XOTclAssertionCmdStub, 3, { {"object", 0, 0, convertToObject}, {"assertionsubcmd", 1, 0, convertToAssertionsubcmd}, {"arg", 0, 0, convertToTclobj}} }, -{"::next::core::colon", XOTclColonCmdStub, 1, { +{"::nx::core::colon", XOTclColonCmdStub, 1, { {"args", 0, 0, convertToNothing}} }, -{"::next::core::configure", XOTclConfigureCmdStub, 2, { +{"::nx::core::configure", XOTclConfigureCmdStub, 2, { {"configureoption", 1, 0, convertToConfigureoption}, {"value", 0, 0, convertToTclobj}} }, -{"::next::core::createobjectsystem", XOTclCreateObjectSystemCmdStub, 3, { +{"::nx::core::createobjectsystem", XOTclCreateObjectSystemCmdStub, 3, { {"rootClass", 1, 0, convertToTclobj}, {"rootMetaClass", 1, 0, convertToTclobj}, {"systemMethods", 0, 0, convertToTclobj}} }, -{"::next::core::current", XOTclCurrentCmdStub, 1, { +{"::nx::core::current", XOTclCurrentCmdStub, 1, { {"currentoption", 0, 0, convertToCurrentoption}} }, -{"::next::core::deprecated", XOTclDeprecatedCmdStub, 3, { +{"::nx::core::deprecated", XOTclDeprecatedCmdStub, 3, { {"what", 1, 0, convertToString}, {"oldCmd", 1, 0, convertToString}, {"newCmd", 0, 0, convertToString}} }, -{"::next::core::dispatch", XOTclDispatchCmdStub, 4, { +{"::nx::core::dispatch", XOTclDispatchCmdStub, 4, { {"object", 1, 0, convertToObject}, {"-objscope", 0, 0, convertToString}, {"command", 1, 0, convertToTclobj}, {"args", 0, 0, convertToNothing}} }, -{"::next::core::existsvar", XOTclExistsVarCmdStub, 2, { +{"::nx::core::existsvar", XOTclExistsVarCmdStub, 2, { {"object", 1, 0, convertToObject}, {"var", 1, 0, convertToString}} }, -{"::next::core::finalize", XOTclFinalizeObjCmdStub, 0, { +{"::nx::core::finalize", XOTclFinalizeObjCmdStub, 0, { } }, -{"::next::core::forward", XOTclForwardCmdStub, 11, { +{"::nx::core::forward", XOTclForwardCmdStub, 11, { {"object", 1, 0, convertToObject}, {"-per-object", 0, 0, convertToString}, {"method", 1, 0, convertToTclobj}, @@ -2263,22 +2264,22 @@ {"target", 0, 0, convertToTclobj}, {"args", 0, 0, convertToNothing}} }, -{"::next::core::importvar", XOTclImportvarCmdStub, 2, { +{"::nx::core::importvar", XOTclImportvarCmdStub, 2, { {"object", 0, 0, convertToObject}, {"args", 0, 0, convertToNothing}} }, -{"::next::core::interp", XOTclInterpObjCmdStub, 2, { +{"::nx::core::interp", XOTclInterpObjCmdStub, 2, { {"name", 0, 0, convertToString}, {"args", 0, 0, convertToNothing}} }, -{"::next::core::is", XOTclIsCmdStub, 5, { +{"::nx::core::is", XOTclIsCmdStub, 5, { {"value", 1, 0, convertToTclobj}, {"constraint", 1, 0, convertToTclobj}, {"-hasmixin", 0, 1, convertToTclobj}, {"-type", 0, 1, convertToTclobj}, {"arg", 0, 0, convertToTclobj}} }, -{"::next::core::method", XOTclMethodCmdStub, 9, { +{"::nx::core::method", XOTclMethodCmdStub, 9, { {"object", 1, 0, convertToObject}, {"-inner-namespace", 0, 0, convertToString}, {"-per-object", 0, 0, convertToString}, @@ -2289,53 +2290,53 @@ {"-precondition", 0, 1, convertToTclobj}, {"-postcondition", 0, 1, convertToTclobj}} }, -{"::next::core::methodproperty", XOTclMethodPropertyCmdStub, 5, { +{"::nx::core::methodproperty", XOTclMethodPropertyCmdStub, 5, { {"object", 1, 0, convertToObject}, {"-per-object", 0, 0, convertToString}, {"methodName", 1, 0, convertToTclobj}, {"methodproperty", 1, 0, convertToMethodproperty}, {"value", 0, 0, convertToTclobj}} }, -{"::next::core::my", XOTclMyCmdStub, 3, { +{"::nx::core::my", XOTclMyCmdStub, 3, { {"-local", 0, 0, convertToString}, {"method", 1, 0, convertToTclobj}, {"args", 0, 0, convertToNothing}} }, -{"::next::core::namespace_copycmds", XOTclNSCopyCmdsStub, 2, { +{"::nx::core::namespace_copycmds", XOTclNSCopyCmdsStub, 2, { {"fromNs", 1, 0, convertToTclobj}, {"toNs", 1, 0, convertToTclobj}} }, -{"::next::core::namespace_copyvars", XOTclNSCopyVarsStub, 2, { +{"::nx::core::namespace_copyvars", XOTclNSCopyVarsStub, 2, { {"fromNs", 1, 0, convertToTclobj}, {"toNs", 1, 0, convertToTclobj}} }, -{"::next::core::objectproperty", XOTclObjectpropertyCmdStub, 3, { +{"::nx::core::objectproperty", XOTclObjectpropertyCmdStub, 3, { {"object", 1, 0, convertToTclobj}, {"objectkind", 0, 0, convertToObjectkind}, {"value", 0, 0, convertToTclobj}} }, -{"::next::core::parametercheck", XOTclParametercheckCmdStub, 3, { +{"::nx::core::parametercheck", XOTclParametercheckCmdStub, 3, { {"-nocomplain", 0, 0, convertToString}, {"param", 0, 0, convertToTclobj}, {"value", 0, 0, convertToTclobj}} }, -{"::next::core::__qualify", XOTclQualifyObjCmdStub, 1, { +{"::nx::core::__qualify", XOTclQualifyObjCmdStub, 1, { {"name", 1, 0, convertToTclobj}} }, -{"::next::core::relation", XOTclRelationCmdStub, 3, { +{"::nx::core::relation", XOTclRelationCmdStub, 3, { {"object", 0, 0, convertToObject}, {"relationtype", 1, 0, convertToRelationtype}, {"value", 0, 0, convertToTclobj}} }, -{"::next::core::self", XOTclSelfCmdStub, 1, { +{"::nx::core::self", XOTclSelfCmdStub, 1, { {"selfoption", 0, 0, convertToSelfoption}} }, -{"::next::core::setvar", XOTclSetVarCmdStub, 3, { +{"::nx::core::setvar", XOTclSetVarCmdStub, 3, { {"object", 1, 0, convertToObject}, {"variable", 1, 0, convertToTclobj}, {"value", 0, 0, convertToTclobj}} }, -{"::next::core::setter", XOTclSetterCmdStub, 3, { +{"::nx::core::setter", XOTclSetterCmdStub, 3, { {"object", 1, 0, convertToObject}, {"-per-object", 0, 0, convertToString}, {"parameter", 0, 0, convertToTclobj}} Index: generic/xotcl.c =================================================================== diff -u -r81c800c8b9cb42ef6743d9b80ac2be5ca211a69a -r3f0573cc75724179f416942b974373e5a62ec05e --- generic/xotcl.c (.../xotcl.c) (revision 81c800c8b9cb42ef6743d9b80ac2be5ca211a69a) +++ generic/xotcl.c (.../xotcl.c) (revision 3f0573cc75724179f416942b974373e5a62ec05e) @@ -347,7 +347,7 @@ #if 0 static int duringBootstrap(Tcl_Interp *interp) { - Tcl_Obj *bootstrap = Tcl_GetVar2Ex(interp, "::next::core::bootstrap", NULL, TCL_GLOBAL_ONLY); + Tcl_Obj *bootstrap = Tcl_GetVar2Ex(interp, "::nx::core::bootstrap", NULL, TCL_GLOBAL_ONLY); return (bootstrap != NULL); } #endif @@ -486,14 +486,14 @@ XOTCLINLINE static int isClassName(CONST char *string) { - return (strncmp((string), "::next::core::classes", 21) == 0); + return (strncmp((string), "::nx::core::classes", 19) == 0); } -/* removes preceding ::next::core::classes from a string */ +/* removes preceding ::nx::core::classes from a string */ XOTCLINLINE static CONST char * NSCutXOTclClasses(CONST char *string) { - assert(strncmp((string), "::next::core::classes", 21) == 0); - return string+21; + assert(strncmp((string), "::nx::core::classes", 19) == 0); + return string+19; } XOTCLINLINE static char * @@ -6093,7 +6093,7 @@ INCR_REF_COUNT(resultBody); if (paramDefs && paramPtr->possibleUnknowns > 0) - Tcl_AppendStringsToObj(resultBody, "::next::core::unsetUnknownArgs\n", (char *) NULL); + Tcl_AppendStringsToObj(resultBody, "::nx::core::unsetUnknownArgs\n", (char *) NULL); Tcl_AppendStringsToObj(resultBody, ObjStr(body), (char *) NULL); return resultBody; @@ -7004,8 +7004,8 @@ static CONST char * StripBodyPrefix(CONST char *body) { - if (strncmp(body, "::next::core::unsetUnknownArgs\n", 30) == 0) - body += 26; + if (strncmp(body, "::nx::core::unsetUnknownArgs\n", 29) == 0) + body += 29; return body; } @@ -9902,7 +9902,7 @@ static int ListMethodName(Tcl_Interp *interp, XOTclObject *object, int withPer_object, CONST char *methodName) { - Tcl_Obj *resultObj = Tcl_NewStringObj(withPer_object ? "" : "::next::core::classes", -1); + Tcl_Obj *resultObj = Tcl_NewStringObj(withPer_object ? "" : "::nx::core::classes", -1); Tcl_AppendObjToObj(resultObj, object->cmdName); Tcl_AppendStringsToObj(resultObj, "::", methodName, (char *) NULL); Tcl_SetObjResult(interp, resultObj); @@ -10418,7 +10418,7 @@ AliasIndex(dsPtr, cmdName, methodName, withPer_object), Tcl_NewStringObj(cmd,-1), TCL_GLOBAL_ONLY); - /*fprintf(stderr, "aliasAdd ::next::core::alias(%s) '%s' returned %p\n", + /*fprintf(stderr, "aliasAdd ::nx::core::alias(%s) '%s' returned %p\n", AliasIndex(dsPtr, cmdName, methodName, withPer_object), cmd, 1);*/ Tcl_DStringFree(dsPtr); return TCL_OK; @@ -10429,7 +10429,7 @@ int result = Tcl_UnsetVar2(interp, XOTclGlobalStrings[XOTE_ALIAS_ARRAY], AliasIndex(dsPtr, cmdName, methodName, withPer_object), TCL_GLOBAL_ONLY); - /*fprintf(stderr, "aliasDelete ::next::core::alias(%s) returned %d (%d)\n", + /*fprintf(stderr, "aliasDelete ::nx::core::alias(%s) returned %d (%d)\n", AliasIndex(dsPtr, cmdName, methodName, withPer_object), result);*/ Tcl_DStringFree(dsPtr); return result; @@ -10491,7 +10491,7 @@ 4. XOTclSetterMethod: an XOTcl setter - 5. arbitrary Tcl commands (e.g. set, ..., ::next::core::relation, ...) + 5. arbitrary Tcl commands (e.g. set, ..., ::nx::core::relation, ...) TODO GN: i think, we should use XOTclProcAliasMethod, whenever the clientData is not 0. These are the cases, where the clientData will be freed, @@ -10605,7 +10605,7 @@ {-argName "arg" -required 0 -type tclobj} } - Make "::next::core::assertion" a cmd rather than a method, otherwise we + Make "::nx::core::assertion" a cmd rather than a method, otherwise we cannot define e.g. a "method check options {...}" to reset the check options in case of a failed option, since assertion checking would be applied on the sketched method already. @@ -10830,7 +10830,7 @@ /* * If the specified method is a fully qualified cmd name like - * e.g. ::next::core::cmd::Class::alloc, this method is called on the + * e.g. ::nx::core::cmd::Class::alloc, this method is called on the * specified , no matter whether it was registered on * it. */ @@ -10953,7 +10953,7 @@ } */ /* - * ::next::core::finalize command + * ::nx::core::finalize command */ static int XOTclFinalizeObjCmd(Tcl_Interp *interp) { @@ -10967,7 +10967,7 @@ /* * evaluate user-defined exit handler */ - result = Tcl_Eval(interp, "::next::core::__exitHandler"); + result = Tcl_Eval(interp, "::nx::core::__exitHandler"); if (result != TCL_OK) { fprintf(stderr, "User defined exit handler contains errors!\n" @@ -11458,7 +11458,7 @@ procs = cl->opt ? AssertionFindProcs(cl->opt->assertions, name) : 0; DSTRING_INIT(dsPtr); - Tcl_DStringAppendElement(dsPtr, "::next::core::method"); + Tcl_DStringAppendElement(dsPtr, "::nx::core::method"); Tcl_DStringAppendElement(dsPtr, NSCutXOTclClasses(toNsPtr->fullName)); Tcl_DStringAppendElement(dsPtr, name); Tcl_DStringAppendElement(dsPtr, ObjStr(arglistObj)); @@ -11485,7 +11485,7 @@ } DSTRING_INIT(dsPtr); - Tcl_DStringAppendElement(dsPtr, "::next::core::method"); + Tcl_DStringAppendElement(dsPtr, "::nx::core::method"); Tcl_DStringAppendElement(dsPtr, toNsPtr->fullName); Tcl_DStringAppendElement(dsPtr, "-per-object"); Tcl_DStringAppendElement(dsPtr, name); @@ -13277,7 +13277,7 @@ Tcl_DStringAppend(dsPtr, objectName(withChildof), -1); Tcl_DStringAppend(dsPtr, "::__#", 5); } else { - Tcl_DStringAppend(dsPtr, "::next::core::__#", 17); + Tcl_DStringAppend(dsPtr, "::nx::core::__#", 15); } prefixLength = dsPtr->length; @@ -14363,7 +14363,7 @@ /* create xotcl namespace */ RUNTIME_STATE(interp)->XOTclNS = - Tcl_CreateNamespace(interp, "::next::core", (ClientData)NULL, (Tcl_NamespaceDeleteProc*)NULL); + Tcl_CreateNamespace(interp, "::nx::core", (ClientData)NULL, (Tcl_NamespaceDeleteProc*)NULL); MEM_COUNT_ALLOC("TclNamespace", RUNTIME_STATE(interp)->XOTclNS); @@ -14381,7 +14381,7 @@ /* XOTclClasses in separate Namespace / Objects */ RUNTIME_STATE(interp)->XOTclClassesNS = - Tcl_CreateNamespace(interp, "::next::core::classes", (ClientData)NULL, + Tcl_CreateNamespace(interp, "::nx::core::classes", (ClientData)NULL, (Tcl_NamespaceDeleteProc*)NULL); MEM_COUNT_ALLOC("TclNamespace", RUNTIME_STATE(interp)->XOTclClassesNS); @@ -14401,7 +14401,7 @@ } /* create namespaces for the different command types */ - Tcl_CreateNamespace(interp, "::next::core::cmd", 0, (Tcl_NamespaceDeleteProc*)NULL); + Tcl_CreateNamespace(interp, "::nx::core::cmd", 0, (Tcl_NamespaceDeleteProc*)NULL); for (i=0; i < nr_elements(method_command_namespace_names); i++) { Tcl_CreateNamespace(interp, method_command_namespace_names[i], 0, (Tcl_NamespaceDeleteProc*)NULL); } @@ -14424,13 +14424,13 @@ #ifdef XOTCL_BYTECODE instructions[INST_NEXT].cmdPtr = (Command *) #endif - Tcl_CreateObjCommand(interp, "::next::core::next", XOTclNextObjCmd, 0, 0); + Tcl_CreateObjCommand(interp, "::nx::core::next", XOTclNextObjCmd, 0, 0); #ifdef XOTCL_BYTECODE - instructions[INST_SELF].cmdPtr = (Command *)Tcl_FindCommand(interp, "::next::core::self", 0, 0); + instructions[INST_SELF].cmdPtr = (Command *)Tcl_FindCommand(interp, "::nx::core::self", 0, 0); #endif - /*Tcl_CreateObjCommand(interp, "::next::core::K", XOTclKObjCmd, 0, 0);*/ + /*Tcl_CreateObjCommand(interp, "::nx::core::K", XOTclKObjCmd, 0, 0);*/ - Tcl_CreateObjCommand(interp, "::next::core::unsetUnknownArgs", XOTclUnsetUnknownArgsCmd, 0, 0); + Tcl_CreateObjCommand(interp, "::nx::core::unsetUnknownArgs", XOTclUnsetUnknownArgsCmd, 0, 0); Tcl_Export(interp, RUNTIME_STATE(interp)->XOTclNS, "self", 0); Tcl_Export(interp, RUNTIME_STATE(interp)->XOTclNS, "next", 0); Tcl_Export(interp, RUNTIME_STATE(interp)->XOTclNS, "my", 0); @@ -14440,14 +14440,14 @@ XOTclBytecodeInit(); #endif - Tcl_SetVar(interp, "::next::core::version", XOTCLVERSION, TCL_GLOBAL_ONLY); - Tcl_SetVar(interp, "::next::core::patchlevel", XOTCLPATCHLEVEL, TCL_GLOBAL_ONLY); + Tcl_SetVar(interp, "::nx::core::version", XOTCLVERSION, TCL_GLOBAL_ONLY); + Tcl_SetVar(interp, "::nx::core::patchlevel", XOTCLPATCHLEVEL, TCL_GLOBAL_ONLY); - Tcl_AddInterpResolvers(interp,"next", + Tcl_AddInterpResolvers(interp,"nxt", (Tcl_ResolveCmdProc*)InterpColonCmdResolver, InterpColonVarResolver, (Tcl_ResolveCompiledVarProc*)InterpCompiledColonVarResolver); - RUNTIME_STATE(interp)->colonCmd = Tcl_FindCommand(interp, "::next::core::colon", 0, 0); + RUNTIME_STATE(interp)->colonCmd = Tcl_FindCommand(interp, "::nx::core::colon", 0, 0); /* * with some methods and library procs in tcl - they could go in a Index: generic/xotclInt.h =================================================================== diff -u -r81c800c8b9cb42ef6743d9b80ac2be5ca211a69a -r3f0573cc75724179f416942b974373e5a62ec05e --- generic/xotclInt.h (.../xotclInt.h) (revision 81c800c8b9cb42ef6743d9b80ac2be5ca211a69a) +++ generic/xotclInt.h (.../xotclInt.h) (revision 3f0573cc75724179f416942b974373e5a62ec05e) @@ -582,9 +582,9 @@ "configure", /* var names */ "__autonames", "__default_metaclass", "__default_superclass", - "::next::core::alias", + "::nx::core::alias", /* object/class names */ - "::next::methodParameterSlot", + "::nx::methodParameterSlot", /* constants */ "alias", "args", "cmd", "filter", "forward", "method", "object", "setter", Index: library/lib/test.xotcl =================================================================== diff -u -r81c800c8b9cb42ef6743d9b80ac2be5ca211a69a -r3f0573cc75724179f416942b974373e5a62ec05e --- library/lib/test.xotcl (.../test.xotcl) (revision 81c800c8b9cb42ef6743d9b80ac2be5ca211a69a) +++ library/lib/test.xotcl (.../test.xotcl) (revision 3f0573cc75724179f416942b974373e5a62ec05e) @@ -53,7 +53,7 @@ foreach o [Object info instances -closure] { if {[info exists pre_exist($o)]} continue #puts "must destroy $o" - if {[::next::core::objectproperty $o object]} {$o destroy} + if {[::nx::core::objectproperty $o object]} {$o destroy} } } } Index: library/lib/xotcl1.xotcl =================================================================== diff -u -r81c800c8b9cb42ef6743d9b80ac2be5ca211a69a -r3f0573cc75724179f416942b974373e5a62ec05e --- library/lib/xotcl1.xotcl (.../xotcl1.xotcl) (revision 81c800c8b9cb42ef6743d9b80ac2be5ca211a69a) +++ library/lib/xotcl1.xotcl (.../xotcl1.xotcl) (revision 3f0573cc75724179f416942b974373e5a62ec05e) @@ -10,7 +10,7 @@ # ::xotcl::Object and ::xotcl::Class and defines these as root class # of the object system and as root meta class. # - ::next::core::createobjectsystem ::xotcl::Object ::xotcl::Class { + ::nx::core::createobjectsystem ::xotcl::Object ::xotcl::Class { -class.alloc alloc -class.create create -class.dealloc dealloc @@ -31,55 +31,55 @@ # create ::next and ::next core namespaces, otherwise mk_pkgindex will fail # namespace eval ::next {} - namespace eval ::next::core {} + namespace eval ::nx::core {} # # get frequenly used primitiva into the ::xotcl namespace # - namespace import ::next::core::* - namespace import ::next::Attribute + namespace import ::nx::core::* + namespace import ::nx::Attribute # provide the standard command set for ::xotcl::Object - foreach cmd [info command ::next::core::cmd::Object::*] { + foreach cmd [info command ::nx::core::cmd::Object::*] { set cmdName [namespace tail $cmd] if {$cmdName in [list "filtersearch" "setter"]} continue - ::next::core::alias Object $cmdName $cmd + ::nx::core::alias Object $cmdName $cmd } # provide some Tcl-commands as methods for ::xotcl::Object foreach cmd {array append eval incr lappend set subst unset trace} { - ::next::core::alias Object $cmd -objscope ::$cmd + ::nx::core::alias Object $cmd -objscope ::$cmd } # provide the standard command set for ::xotcl::Class - foreach cmd [info command ::next::core::cmd::Class::*] { + foreach cmd [info command ::nx::core::cmd::Class::*] { set cmdName [namespace tail $cmd] if {$cmdName in [list "setter"]} continue - ::next::core::alias Class $cmdName $cmd + ::nx::core::alias Class $cmdName $cmd } # protect some methods against redefinition - ::next::core::methodproperty Object destroy redefine-protected true - ::next::core::methodproperty Class alloc redefine-protected true - ::next::core::methodproperty Class dealloc redefine-protected true - ::next::core::methodproperty Class create redefine-protected true + ::nx::core::methodproperty Object destroy redefine-protected true + ::nx::core::methodproperty Class alloc redefine-protected true + ::nx::core::methodproperty Class dealloc redefine-protected true + ::nx::core::methodproperty Class create redefine-protected true # define instproc and proc - ::next::core::method Class instproc { + ::nx::core::method Class instproc { name arguments body precondition:optional postcondition:optional } { set conditions [list] if {[info exists precondition]} {lappend conditions -precondition $precondition} if {[info exists postcondition]} {lappend conditions -postcondition $postcondition} - ::next::core::method [self] $name $arguments $body {*}$conditions + ::nx::core::method [self] $name $arguments $body {*}$conditions } - ::next::core::method Object proc { + ::nx::core::method Object proc { name arguments body precondition:optional postcondition:optional } { set conditions [list] if {[info exists precondition]} {lappend conditions -precondition $precondition} if {[info exists postcondition]} {lappend conditions -postcondition $postcondition} - ::next::core::method [self] -per-object $name $arguments $body {*}$conditions + ::nx::core::method [self] -per-object $name $arguments $body {*}$conditions } # define - like in XOTcl 1 - a minimal implementation of "method" @@ -95,8 +95,8 @@ } # define forward methods - ::next::core::forward Object forward ::next::core::forward %self -per-object - ::next::core::forward Class instforward ::next::core::forward %self + ::nx::core::forward Object forward ::nx::core::forward %self -per-object + ::nx::core::forward Class instforward ::nx::core::forward %self Class instproc unknown {args} { #puts stderr "use '[self] create $args', not '[self] $args'" @@ -118,7 +118,7 @@ # object-parameter definition, backwards compatible # ::xotcl::Object instproc objectparameter {} { - set parameterdefinitions [::next::core::parametersFromSlots [self]] + set parameterdefinitions [::nx::core::parametersFromSlots [self]] lappend parameterdefinitions args #puts stderr "*** parameter definition for [self]: $parameterdefinitions" return $parameterdefinitions @@ -127,7 +127,7 @@ # # use parameter definition from next # - ::next::core::alias ::xotcl::Class parameter ::next::core::classes::next::Class::parameter + ::nx::core::alias ::xotcl::Class parameter ::nx::core::classes::nx::Class::parameter # We provide a default value for superclass (when no superclass is # specified explicitely) and metaclass, in case they should differ @@ -147,20 +147,20 @@ ${os}::Object alloc ${os}::Class::slot ${os}::Object alloc ${os}::Object::slot - ::next::RelationSlot create ${os}::Class::slot::superclass - ::next::core::alias ${os}::Class::slot::superclass assign ::next::core::relation - ::next::RelationSlot create ${os}::Object::slot::class -multivalued false - ::next::core::alias ${os}::Object::slot::class assign ::next::core::relation + ::nx::RelationSlot create ${os}::Class::slot::superclass + ::nx::core::alias ${os}::Class::slot::superclass assign ::nx::core::relation + ::nx::RelationSlot create ${os}::Object::slot::class -multivalued false + ::nx::core::alias ${os}::Object::slot::class assign ::nx::core::relation - ::next::RelationSlot create ${os}::Object::slot::mixin \ + ::nx::RelationSlot create ${os}::Object::slot::mixin \ -methodname object-mixin - ::next::RelationSlot create ${os}::Object::slot::filter \ + ::nx::RelationSlot create ${os}::Object::slot::filter \ -methodname object-filter \ -elementtype "" - ::next::RelationSlot create ${os}::Class::slot::instmixin \ + ::nx::RelationSlot create ${os}::Class::slot::instmixin \ -methodname class-mixin - ::next::RelationSlot create ${os}::Class::slot::instfilter \ + ::nx::RelationSlot create ${os}::Class::slot::instfilter \ -methodname class-filter \ -elementtype "" } @@ -174,8 +174,8 @@ Object create ::xotcl::classInfo # note, we are using ::xotcl::infoError defined earlier - Object instforward info -onerror ::next::core::infoError ::xotcl::objectInfo %1 {%@2 %self} - Class instforward info -onerror ::next::core::infoError ::xotcl::classInfo %1 {%@2 %self} + Object instforward info -onerror ::nx::core::infoError ::xotcl::objectInfo %1 {%@2 %self} + Class instforward info -onerror ::nx::core::infoError ::xotcl::classInfo %1 {%@2 %self} objectInfo proc info {obj} { set methods [list] @@ -250,8 +250,8 @@ proc ::xotcl::info_args {allocation o method} { set result [list] foreach \ - argName [::next::core::cmd::${allocation}Info::method $o args $method] \ - flag [::next::core::cmd::${allocation}Info::method $o parameter $method] { + argName [::nx::core::cmd::${allocation}Info::method $o args $method] \ + flag [::nx::core::cmd::${allocation}Info::method $o parameter $method] { if {[string match -* $flag]} continue lappend result $argName } @@ -261,7 +261,7 @@ proc ::xotcl::info_nonposargs {allocation o method} { set result [list] - foreach flag [::next::core::cmd::${allocation}Info::method $o parameter $method] { + foreach flag [::nx::core::cmd::${allocation}Info::method $o parameter $method] { if {![string match -* $flag]} continue lappend result $flag } @@ -270,8 +270,8 @@ } proc ::xotcl::info_default {allocation o method arg varName} { foreach \ - argName [::next::core::cmd::${allocation}Info::method $o args $method] \ - flag [::next::core::cmd::${allocation}Info::method $o parameter $method] { + argName [::nx::core::cmd::${allocation}Info::method $o args $method] \ + flag [::nx::core::cmd::${allocation}Info::method $o parameter $method] { if {$argName eq $arg} { upvar 3 $varName default if {[llength $flag] == 2} { @@ -296,25 +296,25 @@ :proc default {o method arg var} {::xotcl::info_default Object $o $method $arg $var} # info options emulated by "info method ..." - :proc instbody {o methodName} {::next::core::cmd::ClassInfo::method $o body $methodName} - :proc instpre {o methodName} {::next::core::cmd::ClassInfo::method $o precondition $methodName} - :proc instpost {o methodName} {::next::core::cmd::ClassInfo::method $o postcondition $methodName} + :proc instbody {o methodName} {::nx::core::cmd::ClassInfo::method $o body $methodName} + :proc instpre {o methodName} {::nx::core::cmd::ClassInfo::method $o precondition $methodName} + :proc instpost {o methodName} {::nx::core::cmd::ClassInfo::method $o postcondition $methodName} # info options emulated by "info methods" :proc instcommands {o {pattern:optional ""}} { - ::next::core::cmd::ClassInfo::methods $o {*}$pattern + ::nx::core::cmd::ClassInfo::methods $o {*}$pattern } :proc instprocs {o {pattern:optional ""}} { - ::next::core::cmd::ClassInfo::methods $o -methodtype scripted {*}$pattern + ::nx::core::cmd::ClassInfo::methods $o -methodtype scripted {*}$pattern } :proc parametercmd {o {pattern:optional ""}} { - ::next::core::cmd::ClassInfo::methods $o -per-object -methodtype setter {*}$pattern + ::nx::core::cmd::ClassInfo::methods $o -per-object -methodtype setter {*}$pattern } :proc instparametercmd {o {pattern:optional ""}} { - ::next::core::cmd::ClassInfo::methods $o -methodtype setter {*}$pattern + ::nx::core::cmd::ClassInfo::methods $o -methodtype setter {*}$pattern } # assertion handling - :proc instinvar {o} {::next::core::assertion $o class-invar} + :proc instinvar {o} {::nx::core::assertion $o class-invar} } objectInfo eval { @@ -323,24 +323,24 @@ :proc default {o method arg var} {::xotcl::info_default Object $o $method $arg $var} # info options emulated by "info method ..." - :proc body {o methodName} {::next::core::cmd::ObjectInfo::method $o body $methodName} - :proc pre {o methodName} {::next::core::cmd::ObjectInfo::method $o pre $methodName} - :proc post {o methodName} {::next::core::cmd::ObjectInfo::method $o post $methodName} + :proc body {o methodName} {::nx::core::cmd::ObjectInfo::method $o body $methodName} + :proc pre {o methodName} {::nx::core::cmd::ObjectInfo::method $o pre $methodName} + :proc post {o methodName} {::nx::core::cmd::ObjectInfo::method $o post $methodName} # info options emulated by "info methods" :proc commands {o {pattern:optional ""}} { - ::next::core::cmd::ObjectInfo::methods $o {*}$pattern + ::nx::core::cmd::ObjectInfo::methods $o {*}$pattern } :proc procs {o {pattern:optional ""}} { - ::next::core::cmd::ObjectInfo::methods $o -methodtype scripted {*}$pattern + ::nx::core::cmd::ObjectInfo::methods $o -methodtype scripted {*}$pattern } :proc methods { o -nocmds:switch -noprocs:switch -incontext:switch pattern:optional } { set methodtype all if {$nocmds} {set methodtype scripted} if {$noprocs} {if {$nocmds} {return ""}; set methodtype builtin} - set cmd [list ::next::core::cmd::ObjectInfo::callable $o -methodtype $methodtype] + set cmd [list ::nx::core::cmd::ObjectInfo::callable $o -methodtype $methodtype] if {$incontext} {lappend cmd -incontext} if {[::info exists pattern]} {lappend cmd $pattern} eval $cmd @@ -350,88 +350,88 @@ set guardsFlag [expr {$guards ? "-guards" : ""}] set patternArg [expr {[info exists pattern] ? [list $pattern] : ""}] if {$order && !$guards} { - set def [::next::core::cmd::ObjectInfo::filter $o -order {*}$guardsFlag {*}$patternArg] + set def [::nx::core::cmd::ObjectInfo::filter $o -order {*}$guardsFlag {*}$patternArg] #puts stderr "TO CONVERT: $def" set def [filterorder_list_to_xotcl1 $def] } else { - set def [::next::core::cmd::ObjectInfo::filter $o {*}$guardsFlag {*}$patternArg] + set def [::nx::core::cmd::ObjectInfo::filter $o {*}$guardsFlag {*}$patternArg] } #puts stderr " => $def" return $def } # assertion handling :proc check {o} { - ::xotcl::checkoption_internal_to_xotcl1 [::next::core::assertion $o check] + ::xotcl::checkoption_internal_to_xotcl1 [::nx::core::assertion $o check] } - :proc invar {o} {::next::core::assertion $o object-invar} + :proc invar {o} {::nx::core::assertion $o object-invar} } - foreach cmd [::info command ::next::core::cmd::ObjectInfo::*] { + foreach cmd [::info command ::nx::core::cmd::ObjectInfo::*] { set cmdName [namespace tail $cmd] if {$cmdName in [list "callable" "filter" "method" "methods"]} continue - ::next::core::alias ::xotcl::objectInfo $cmdName $cmd - ::next::core::alias ::xotcl::classInfo $cmdName $cmd + ::nx::core::alias ::xotcl::objectInfo $cmdName $cmd + ::nx::core::alias ::xotcl::classInfo $cmdName $cmd } - foreach cmd [::info command ::next::core::cmd::ClassInfo::*] { + foreach cmd [::info command ::nx::core::cmd::ClassInfo::*] { set cmdName [namespace tail $cmd] if {$cmdName in [list "forward" "method" "methods" \ "mixinof" "object-mixin-of" \ "filter" "filterguard" \ "mixin" "mixinguard"]} continue - ::next::core::alias ::xotcl::classInfo $cmdName $cmd + ::nx::core::alias ::xotcl::classInfo $cmdName $cmd } - ::next::core::alias ::xotcl::objectInfo is ::next::core::objectproperty - ::next::core::alias ::xotcl::classInfo is ::next::core::objectproperty - ::next::core::alias ::xotcl::classInfo classparent ::next::core::cmd::ObjectInfo::parent - ::next::core::alias ::xotcl::classInfo classchildren ::next::core::cmd::ObjectInfo::children - ::next::core::alias ::xotcl::classInfo instmixin ::next::core::cmd::ClassInfo::mixin - ::next::core::alias ::xotcl::classInfo instmixinguard ::next::core::cmd::ClassInfo::mixinguard - #::next::core::alias ::xotcl::classInfo instmixinof ::next::core::cmd::ClassInfo::class-mixin-of - ::next::core::forward ::xotcl::classInfo instmixinof ::next::core::cmd::ClassInfo::mixinof %1 -scope class - ::next::core::alias ::xotcl::classInfo instfilter ::next::core::cmd::ClassInfo::filter - ::next::core::alias ::xotcl::classInfo instfilterguard ::next::core::cmd::ClassInfo::filterguard - ::next::core::alias ::xotcl::classInfo instforward ::next::core::cmd::ClassInfo::forward - #::next::core::alias ::xotcl::classInfo mixinof ::next::core::cmd::ClassInfo::object-mixin-of - ::next::core::forward ::xotcl::classInfo mixinof ::next::core::cmd::ClassInfo::mixinof %1 -scope object + ::nx::core::alias ::xotcl::objectInfo is ::nx::core::objectproperty + ::nx::core::alias ::xotcl::classInfo is ::nx::core::objectproperty + ::nx::core::alias ::xotcl::classInfo classparent ::nx::core::cmd::ObjectInfo::parent + ::nx::core::alias ::xotcl::classInfo classchildren ::nx::core::cmd::ObjectInfo::children + ::nx::core::alias ::xotcl::classInfo instmixin ::nx::core::cmd::ClassInfo::mixin + ::nx::core::alias ::xotcl::classInfo instmixinguard ::nx::core::cmd::ClassInfo::mixinguard + #::nx::core::alias ::xotcl::classInfo instmixinof ::nx::core::cmd::ClassInfo::class-mixin-of + ::nx::core::forward ::xotcl::classInfo instmixinof ::nx::core::cmd::ClassInfo::mixinof %1 -scope class + ::nx::core::alias ::xotcl::classInfo instfilter ::nx::core::cmd::ClassInfo::filter + ::nx::core::alias ::xotcl::classInfo instfilterguard ::nx::core::cmd::ClassInfo::filterguard + ::nx::core::alias ::xotcl::classInfo instforward ::nx::core::cmd::ClassInfo::forward + #::nx::core::alias ::xotcl::classInfo mixinof ::nx::core::cmd::ClassInfo::object-mixin-of + ::nx::core::forward ::xotcl::classInfo mixinof ::nx::core::cmd::ClassInfo::mixinof %1 -scope object # assertion handling - ::next::core::alias ::xotcl::classInfo invar objectInfo::invar - ::next::core::alias ::xotcl::classInfo check objectInfo::check + ::nx::core::alias ::xotcl::classInfo invar objectInfo::invar + ::nx::core::alias ::xotcl::classInfo check objectInfo::check # define info methods from objectInfo on classInfo as well - ::next::core::alias classInfo body objectInfo::body - ::next::core::alias classInfo commands objectInfo::commands - ::next::core::alias classInfo filter objectInfo::filter - ::next::core::alias classInfo methods objectInfo::methods - ::next::core::alias classInfo procs objectInfo::procs - ::next::core::alias classInfo pre objectInfo::pre - ::next::core::alias classInfo post objectInfo::post + ::nx::core::alias classInfo body objectInfo::body + ::nx::core::alias classInfo commands objectInfo::commands + ::nx::core::alias classInfo filter objectInfo::filter + ::nx::core::alias classInfo methods objectInfo::methods + ::nx::core::alias classInfo procs objectInfo::procs + ::nx::core::alias classInfo pre objectInfo::pre + ::nx::core::alias classInfo post objectInfo::post # emulation of isobject, isclass ... - Object instproc isobject {{object:substdefault "[self]"}} {::next::core::objectproperty $object object} - Object instproc isclass {{class:substdefault "[self]"}} {::next::core::objectproperty $class class} - Object instproc ismetaclass {{class:substdefault "[self]"}} {::next::core::objectproperty $class metaclass} - Object instproc ismixin {class} {::next::core::is [self] object -hasmixin $class} - Object instproc istype {class} {::next::core::is [self] type $class} + Object instproc isobject {{object:substdefault "[self]"}} {::nx::core::objectproperty $object object} + Object instproc isclass {{class:substdefault "[self]"}} {::nx::core::objectproperty $class class} + Object instproc ismetaclass {{class:substdefault "[self]"}} {::nx::core::objectproperty $class metaclass} + Object instproc ismixin {class} {::nx::core::is [self] object -hasmixin $class} + Object instproc istype {class} {::nx::core::is [self] type $class} - ::next::core::alias Object contains ::next::core::classes::next::Object::contains + ::nx::core::alias Object contains ::nx::core::classes::nx::Object::contains ::xotcl::Class instforward slots %self contains \ - -object {%::next::core::dispatch [::xotcl::self] -objscope ::subst [::xotcl::self]::slot} + -object {%::nx::core::dispatch [::xotcl::self] -objscope ::subst [::xotcl::self]::slot} # # define parametercmd and instparametercmd in terms of ::next method setter # define filterguard and instfilterguard in terms of filterguard # define mixinguard and instmixinguard in terms of mixinguard # - ::next::core::alias Object parametercmd ::next::core::classes::next::Object::setter - ::next::core::alias Class instparametercmd ::next::core::classes::next::Class::setter + ::nx::core::alias Object parametercmd ::nx::core::classes::nx::Object::setter + ::nx::core::alias Class instparametercmd ::nx::core::classes::nx::Class::setter - ::next::core::alias Class filterguard ::next::core::cmd::Object::filterguard - ::next::core::alias Class instfilterguard ::next::core::cmd::Class::filterguard + ::nx::core::alias Class filterguard ::nx::core::cmd::Object::filterguard + ::nx::core::alias Class instfilterguard ::nx::core::cmd::Class::filterguard - ::next::core::alias Class mixinguard ::next::core::cmd::Object::mixinguard - ::next::core::alias Class instmixinguard ::next::core::cmd::Class::mixinguard + ::nx::core::alias Class mixinguard ::nx::core::cmd::Object::mixinguard + ::nx::core::alias Class instmixinguard ::nx::core::cmd::Class::mixinguard # assertion handling proc checkoption_xotcl1_to_internal checkoptions { @@ -489,10 +489,10 @@ Object instproc check {checkoptions} { - ::next::core::assertion [self] check [::xotcl::checkoption_xotcl1_to_internal $checkoptions] + ::nx::core::assertion [self] check [::xotcl::checkoption_xotcl1_to_internal $checkoptions] } - Object instforward invar ::next::core::assertion %self object-invar - Class instforward instinvar ::next::core::assertion %self class-invar + Object instforward invar ::nx::core::assertion %self object-invar + Class instforward instinvar ::nx::core::assertion %self class-invar Object instproc abstract {methtype methname arglist} { if {$methtype ne "proc" && $methtype ne "instproc" && $methtype ne "method"} { @@ -508,20 +508,20 @@ # support for XOTcl 1.* specific convenience routines Object instproc hasclass cl { - if {[::next::core::is [self] object -hasmixin $cl]} {return 1} - ::next::core::is [self] type $cl + if {[::nx::core::is [self] object -hasmixin $cl]} {return 1} + ::nx::core::is [self] type $cl } Object instproc filtersearch {filter} { - set definition [::next::core::dispatch [self] ::next::core::cmd::Object::filtersearch $filter] + set definition [::nx::core::dispatch [self] ::nx::core::cmd::Object::filtersearch $filter] return [filterorder_to_xotcl1 $definition] } Object instproc procsearch {name} { - set definition [::next::core::cmd::ObjectInfo::callable [self] -which $name] + set definition [::nx::core::cmd::ObjectInfo::callable [self] -which $name] if {$definition ne ""} { foreach {obj modifier kind} $definition break if {$modifier ne "object"} { set kind $modifier - set perClass [::next::core::is $obj class] + set perClass [::nx::core::is $obj class] } else { set perClass 0 } @@ -542,16 +542,16 @@ } # keep old object interface for xotcl 1.* - Object proc unsetExitHandler {} {::next::core::unsetExitHandler $newbody} - Object proc setExitHandler {newbody} {::next::core::setExitHandler $newbody} - Object proc getExitHandler {} {::next::core::getExitHandler} + Object proc unsetExitHandler {} {::nx::core::unsetExitHandler $newbody} + Object proc setExitHandler {newbody} {::nx::core::setExitHandler $newbody} + Object proc getExitHandler {} {::nx::core::getExitHandler} # resue some definitions from ::next - ::next::core::alias ::xotcl::Object copy ::next::core::classes::next::Object::copy - ::next::core::alias ::xotcl::Object move ::next::core::classes::next::Object::move - ::next::core::alias ::xotcl::Object defaultmethod ::next::core::classes::next::Object::defaultmethod + ::nx::core::alias ::xotcl::Object copy ::nx::core::classes::nx::Object::copy + ::nx::core::alias ::xotcl::Object move ::nx::core::classes::nx::Object::move + ::nx::core::alias ::xotcl::Object defaultmethod ::nx::core::classes::nx::Object::defaultmethod - ::next::core::alias ::xotcl::Class -per-object __unknown ::next::Class::__unknown + ::nx::core::alias ::xotcl::Class -per-object __unknown ::nx::Class::__unknown proc myproc {args} {linsert $args 0 [::xotcl::self]} proc myvar {var} {.requireNamespace; return [::xotcl::self]::$var} @@ -675,7 +675,7 @@ puts stderr "*** using ${package}::* in [::xotcl::self]" } } - ::next::Class create ::xotcl::package -superclass ::xotcl::Class -parameter { + ::nx::Class create ::xotcl::package -superclass ::xotcl::Class -parameter { provide {version 1.0} {autoexport {}} @@ -793,19 +793,19 @@ # set xotcl version variables # # check for variable, otherwise mk_pkgindex will fail - if {[info exists ::next::core::version]} { - set ::xotcl::version $::next::core::version - set ::xotcl::patchlevel $::next::core::patchlevel + if {[info exists ::nx::core::version]} { + set ::xotcl::version $::nx::core::version + set ::xotcl::patchlevel $::nx::core::patchlevel } set ::xotcl::confdir ~/.xotcl set ::xotcl::logdir $::xotcl::confdir/log - namespace import ::next::core::tmpdir + namespace import ::nx::core::tmpdir # finally, export contents defined for xotcl 1.* namespace export Object Class Attribute myproc myvar my self next @ } -foreach ns {::next::core ::next ::xotcl} { +foreach ns {::nx::core ::next ::xotcl} { puts stderr "$ns exports [namespace eval $ns {lsort [namespace export]}]" } \ No newline at end of file Index: library/serialize/Serializer.xotcl =================================================================== diff -u -r81c800c8b9cb42ef6743d9b80ac2be5ca211a69a -r3f0573cc75724179f416942b974373e5a62ec05e --- library/serialize/Serializer.xotcl (.../Serializer.xotcl) (revision 81c800c8b9cb42ef6743d9b80ac2be5ca211a69a) +++ library/serialize/Serializer.xotcl (.../Serializer.xotcl) (revision 3f0573cc75724179f416942b974373e5a62ec05e) @@ -11,7 +11,7 @@ namespace eval ::xotcl::serializer { - namespace import ::next::* + namespace import ::nx::* @ @File { description { @@ -296,7 +296,7 @@ :object method allChildren o { # return o and all its children fully qualified - set set [::next::core::dispatch $o -objscope ::xotcl::self] + set set [::nx::core::dispatch $o -objscope ::xotcl::self] foreach c [$o info children] { lappend set {*}[:allChildren $c] } @@ -350,15 +350,15 @@ :object method all {-ignoreVarsRE -ignore} { # don't filter anything during serialization - set filterstate [::next::core::configure filter off] + set filterstate [::nx::core::configure filter off] set s [:new -childof [self] -volatile] if {[info exists ignoreVarsRE]} {$s ignoreVarsRE $ignoreVarsRE} if {[info exists ignore]} {$s ignore $ignore} set r [subst { - set ::xotcl::__filterstate \[::next::core::configure filter off\] + set ::xotcl::__filterstate \[::nx::core::configure filter off\] #::xotcl::Slot mixin add ::xotcl::Slot::Nocheck - ::next::core::configure softrecreate [::next::core::configure softrecreate] + ::nx::core::configure softrecreate [::nx::core::configure softrecreate] ::xotcl::setExitHandler [list [::xotcl::getExitHandler]] }]\n :resetPattern @@ -383,10 +383,10 @@ append r { #::xotcl::Slot mixin delete ::xotcl::Slot::Nocheck - ::next::core::configure filter $::xotcl::__filterstate + ::nx::core::configure filter $::xotcl::__filterstate unset ::xotcl::__filterstate } - ::next::core::configure filter $filterstate + ::nx::core::configure filter $filterstate return $r } @@ -438,19 +438,19 @@ set cmd "" foreach o [list ${:rootClass} ${:rootMetaClass}] { append cmd \ - [:frameWorkCmd ::next::core::relation $o object-mixin] \ - [:frameWorkCmd ::next::core::relation $o class-mixin] \ - [:frameWorkCmd ::next::core::assertion $o object-invar] \ - [:frameWorkCmd ::next::core::assertion $o class-invar] + [:frameWorkCmd ::nx::core::relation $o object-mixin] \ + [:frameWorkCmd ::nx::core::relation $o class-mixin] \ + [:frameWorkCmd ::nx::core::assertion $o object-invar] \ + [:frameWorkCmd ::nx::core::assertion $o class-invar] } return $cmd } :method registerTrace {on} { if {$on} { - ::next::core::alias ${:rootClass} __trace__ -objscope ::trace + ::nx::core::alias ${:rootClass} __trace__ -objscope ::trace } else { - ::next::core::method ${:rootClass} __trace__ {} {} + ::nx::core::method ${:rootClass} __trace__ {} {} } } @@ -512,7 +512,7 @@ if {[$o eval [list ::array exists :$v]]} { lappend setcmd [list array set :$v [$o eval [list array get :$v]]] } else { - lappend setcmd [list set :$v [::next::core::setvar $o $v]] + lappend setcmd [list set :$v [::nx::core::setvar $o $v]] } } } @@ -591,7 +591,7 @@ if {![:Object-needsNothing $x $s]} {return 0} set scs [$x info superclass] if {[$s needsOneOf $scs]} {return 0} - if {[$s needsOneOf [::next::core::relation $x class-mixin]]} {return 0} + if {[$s needsOneOf [::nx::core::relation $x class-mixin]]} {return 0} foreach sc $scs {if {[$s needsOneOf [$sc info slots]]} {return 0}} return 1 } @@ -612,13 +612,13 @@ ObjectSystemSerializer create Serializer2 { - set :rootClass ::next::Object - set :rootMetaClass ::next::Class - array set :ignorePattern [list "::next::*" 1 "::xotcl::*" 1] + set :rootClass ::nx::Object + set :rootMetaClass ::nx::Class + array set :ignorePattern [list "::nx::*" 1 "::xotcl::*" 1] :method serialize-all-start {s} { - if {[info command ::Object] ne "" && [namespace origin ::Object] eq "::next::Object"} { - set intro "package require next; namespace import -force ::next::*" + if {[info command ::Object] ne "" && [namespace origin ::Object] eq "::nx::Object"} { + set intro "package require next; namespace import -force ::nx::*" } else { set intro "" } @@ -650,24 +650,24 @@ :method Object-serialize {o s} { :collect-var-traces $o $s append cmd [list [$o info class] create \ - [::next::core::dispatch $o -objscope ::xotcl::self]] + [::nx::core::dispatch $o -objscope ::xotcl::self]] append cmd " -noinit\n" - foreach i [lsort [::next::core::cmd::ObjectInfo::methods $o]] { + foreach i [lsort [::nx::core::cmd::ObjectInfo::methods $o]] { append cmd [:method-serialize $o $i "object"] "\n" } append cmd \ [list $o eval [join [:collectVars $o] "\n "]]\n \ - [:frameWorkCmd ::next::core::relation $o object-mixin] \ - [:frameWorkCmd ::next::core::assertion $o object-invar] + [:frameWorkCmd ::nx::core::relation $o object-mixin] \ + [:frameWorkCmd ::nx::core::assertion $o object-invar] if {[::xotcl::is $o type ::xotcl::Slot]} { # Slots needs to be initialized to ensure # __invalidateobjectparameter to be called append cmd [list $o eval :init] \n } - $s addPostCmd [:frameWorkCmd ::next::core::relation $o object-filter] + $s addPostCmd [:frameWorkCmd ::nx::core::relation $o object-filter] return $cmd } @@ -678,20 +678,20 @@ :method Class-serialize {o s} { set cmd [:Object-serialize $o $s] - foreach i [lsort [::next::core::cmd::ClassInfo::methods $o]] { + foreach i [lsort [::nx::core::cmd::ClassInfo::methods $o]] { append cmd [:method-serialize $o $i ""] "\n" } append cmd \ - [:frameWorkCmd ::next::core::relation $o superclass -unless ${:rootClass}] \ - [:frameWorkCmd ::next::core::relation $o class-mixin] \ - [:frameWorkCmd ::next::core::assertion $o class-invar] + [:frameWorkCmd ::nx::core::relation $o superclass -unless ${:rootClass}] \ + [:frameWorkCmd ::nx::core::relation $o class-mixin] \ + [:frameWorkCmd ::nx::core::assertion $o class-invar] - $s addPostCmd [:frameWorkCmd ::next::core::relation $o class-filter] + $s addPostCmd [:frameWorkCmd ::nx::core::relation $o class-filter] return $cmd\n } # register serialize a global method - ::next::Object method serialize {} { + ::nx::Object method serialize {} { ::Serializer deepSerialize [self] } @@ -718,7 +718,7 @@ } :method serialize-all-end {s} { - return "[next]\n::next::core::alias ::xotcl::Object trace -objscope ::trace\n" + return "[next]\n::nx::core::alias ::xotcl::Object trace -objscope ::trace\n" } @@ -776,25 +776,25 @@ :method Object-serialize {o s} { :collect-var-traces $o $s - append cmd [list [$o info class] create [::next::core::dispatch $o -objscope ::xotcl::self]] + append cmd [list [$o info class] create [::nx::core::dispatch $o -objscope ::xotcl::self]] # slots needs to be initialized when optimized, since # parametercmds are not serialized append cmd " -noinit\n" - foreach i [::next::core::cmd::ObjectInfo::methods $o -methodtype scripted] { + foreach i [::nx::core::cmd::ObjectInfo::methods $o -methodtype scripted] { append cmd [:method-serialize $o $i ""] "\n" } - foreach i [::next::core::cmd::ObjectInfo::methods $o -methodtype forward] { + foreach i [::nx::core::cmd::ObjectInfo::methods $o -methodtype forward] { append cmd [concat [list $o] forward $i [$o info forward -definition $i]] "\n" } - foreach i [::next::core::cmd::ObjectInfo::methods $o -methodtype setter] { + foreach i [::nx::core::cmd::ObjectInfo::methods $o -methodtype setter] { append cmd [list $o parametercmd $i] "\n" } append cmd \ [list $o eval [join [:collectVars $o] "\n "]] \n \ - [:frameWorkCmd ::next::core::relation $o object-mixin] \ - [:frameWorkCmd ::next::core::assertion $o object-invar] + [:frameWorkCmd ::nx::core::relation $o object-mixin] \ + [:frameWorkCmd ::nx::core::assertion $o object-invar] - $s addPostCmd [:frameWorkCmd ::next::core::relation $o object-filter] + $s addPostCmd [:frameWorkCmd ::nx::core::relation $o object-filter] return $cmd } @@ -815,20 +815,20 @@ append cmd [list $o instparametercmd $i] "\n" } # provide limited support for exporting aliases for XOTcl objects - foreach i [::next::core::cmd::ClassInfo::methods $o -methodtype alias] { - set xotcl2Def [::next::core::cmd::ClassInfo::method $o definition $i] + foreach i [::nx::core::cmd::ClassInfo::methods $o -methodtype alias] { + set xotcl2Def [::nx::core::cmd::ClassInfo::method $o definition $i] set objscope [lindex $xotcl2Def end-2] set methodName [lindex $xotcl2Def end-1] set cmdName [lindex $xotcl2Def end] if {$objscope ne "-objscope"} {set objscope ""} - append cmd [list ::next::core::alias $o $methodName {*}$objscope $cmdName]\n + append cmd [list ::nx::core::alias $o $methodName {*}$objscope $cmdName]\n } append cmd \ - [:frameWorkCmd ::next::core::relation $o superclass -unless ${:rootClass}] \ - [:frameWorkCmd ::next::core::relation $o class-mixin] \ - [:frameWorkCmd ::next::core::assertion $o class-invar] + [:frameWorkCmd ::nx::core::relation $o superclass -unless ${:rootClass}] \ + [:frameWorkCmd ::nx::core::relation $o class-mixin] \ + [:frameWorkCmd ::nx::core::assertion $o class-invar] - $s addPostCmd [:frameWorkCmd ::next::core::relation $o class-filter] + $s addPostCmd [:frameWorkCmd ::nx::core::relation $o class-filter] return $cmd } Index: tests/aliastest.xotcl =================================================================== diff -u -r81c800c8b9cb42ef6743d9b80ac2be5ca211a69a -r3f0573cc75724179f416942b974373e5a62ec05e --- tests/aliastest.xotcl (.../aliastest.xotcl) (revision 81c800c8b9cb42ef6743d9b80ac2be5ca211a69a) +++ tests/aliastest.xotcl (.../aliastest.xotcl) (revision 3f0573cc75724179f416942b974373e5a62ec05e) @@ -5,11 +5,11 @@ Test case alias-preliminaries { # The system methods of Object are either alias or forwarders - ? {lsort [::next::ObjectParameterSlot info methods -methodtype alias]} {assign get} - ? {::next::ObjectParameterSlot info method definition get} "::next::ObjectParameterSlot alias get ::next::core::setvar" + ? {lsort [::nx::ObjectParameterSlot info methods -methodtype alias]} {assign get} + ? {::nx::ObjectParameterSlot info method definition get} "::nx::ObjectParameterSlot alias get ::nx::core::setvar" # define an alias and retrieve its definition - set cmd "::next::Object alias -objscope set ::set" + set cmd "::nx::Object alias -objscope set ::set" eval $cmd ? {Object info method definition set} $cmd @@ -22,9 +22,9 @@ } Class create Foo - ::next::core::alias ::Foo foo ::next::core::classes::Base::foo + ::nx::core::alias ::Foo foo ::nx::core::classes::Base::foo - ? {Foo info method definition foo} "::Foo alias foo ::next::core::classes::Base::foo" + ? {Foo info method definition foo} "::Foo alias foo ::nx::core::classes::Base::foo" Foo create f1 ? {f1 foo} 1 @@ -42,7 +42,7 @@ Base method foo {{-x 1}} {return $x} - ::next::core::alias ::Foo foo ::next::core::classes::Base::foo + ::nx::core::alias ::Foo foo ::nx::core::classes::Base::foo ? {Base info methods -methodtype scripted} {foo} "defined again" ? {Foo info methods -methodtype alias} {foo} "aliased again" @@ -63,7 +63,7 @@ T method foo args { return [self class]->[self proc] } - ::next::core::alias T FOO ::next::core::classes::T::foo + ::nx::core::alias T FOO ::nx::core::classes::T::foo ? {t foo} ::T->foo ? {t FOO} ::T->foo @@ -74,28 +74,28 @@ # puts stderr "double indirection" T method foo args { return [self class]->[self proc] } - ::next::core::alias T FOO ::next::core::classes::T::foo - ::next::core::alias S BAR ::next::core::classes::T::FOO + ::nx::core::alias T FOO ::nx::core::classes::T::foo + ::nx::core::alias S BAR ::nx::core::classes::T::FOO ? {T info methods -methodtype alias} "FOO" - ? {T info method definition FOO} "::T alias FOO ::next::core::classes::T::foo" + ? {T info method definition FOO} "::T alias FOO ::nx::core::classes::T::foo" ? {lsort [T info methods]} {FOO foo} ? {S info methods} {BAR} T method FOO {} {} ? {T info methods} {foo} ? {S info methods} {BAR} ? {s BAR} ::S->foo ? {t foo} ::T->foo - ? {S info method definition BAR} "::S alias BAR ::next::core::classes::T::FOO" + ? {S info method definition BAR} "::S alias BAR ::nx::core::classes::T::FOO" T method foo {} {} ? {T info methods} {} ? {S info methods} {} T method foo args { return [self class]->[self proc] } - ::next::core::alias T FOO ::next::core::classes::T::foo - ::next::core::alias S BAR ::next::core::classes::T::FOO + ::nx::core::alias T FOO ::nx::core::classes::T::foo + ::nx::core::alias S BAR ::nx::core::classes::T::FOO ? {lsort [T info methods]} {FOO foo} ? {S info methods} {BAR} @@ -105,9 +105,9 @@ T method foo args { return [self class]->[self proc] } T object method bar args { return [self class]->[self proc] } - ::next::core::alias T -per-object FOO ::next::core::classes::T::foo - ::next::core::alias T -per-object BAR ::T::FOO - ::next::core::alias T -per-object ZAP ::T::BAR + ::nx::core::alias T -per-object FOO ::nx::core::classes::T::foo + ::nx::core::alias T -per-object BAR ::T::FOO + ::nx::core::alias T -per-object ZAP ::T::BAR ? {T info methods} {foo} ? {lsort [T object info methods -methodtype alias]} {BAR FOO ZAP} ? {lsort [T object info methods]} {BAR FOO ZAP bar} @@ -149,8 +149,8 @@ # per-object methods as per-object aliases # T object method m1 args { return [self class]->[self proc] } - ::next::core::alias T -per-object M1 ::T::m1 - ::next::core::alias T -per-object M11 ::T::M1 + ::nx::core::alias T -per-object M1 ::T::m1 + ::nx::core::alias T -per-object M11 ::T::M1 ? {lsort [T object info methods]} {M1 M11 bar m1} ? {T m1} ->m1 ? {T M1} ->m1 @@ -167,12 +167,12 @@ # proc foo args { return [self class]->[self proc] } - ::next::core::alias T FOO1 ::foo - ::next::core::alias T -per-object FOO2 ::foo + ::nx::core::alias T FOO1 ::foo + ::nx::core::alias T -per-object FOO2 ::foo # # ! per-object alias referenced as per-class alias ! # - ::next::core::alias T BAR ::T::FOO2 + ::nx::core::alias T BAR ::T::FOO2 ? {lsort [T object info methods]} {FOO2 bar} ? {lsort [T info methods]} {BAR FOO1} ? {T FOO2} ->foo @@ -200,9 +200,9 @@ proc bar2 args { upvar 2 _ __; return $__} } - ::next::core::alias T FOO ::ns1::foo - ::next::core::alias T BAR ::ns1::bar - ::next::core::alias T BAR2 ::ns1::bar2 + ::nx::core::alias T FOO ::ns1::foo + ::nx::core::alias T BAR ::ns1::bar + ::nx::core::alias T BAR2 ::ns1::bar2 ? {lsort [T info methods]} {BAR BAR2 FOO} set ::_ GOTYA ? {t FOO} ::T->foo @@ -218,12 +218,12 @@ U create u ? {namespace exists ::U} 0 U object method zap args { return [self class]->[self proc] } - ::next::core::alias ::U -per-object ZAP ::U::zap + ::nx::core::alias ::U -per-object ZAP ::U::zap U requireNamespace ? {namespace exists ::U} 1 U object method bar args { return [self class]->[self proc] } - ::next::core::alias U -per-object BAR ::U::bar + ::nx::core::alias U -per-object BAR ::U::bar ? {lsort [U object info methods]} {BAR ZAP bar zap} ? {U BAR} ->bar ? {U ZAP} ->zap @@ -255,8 +255,8 @@ proc ::foo args { return [:bar ${:z}]-[set :z]-[:bar [set :z]] } - ::next::core::alias V FOO1 ::foo - ::next::core::alias V -per-object FOO2 ::foo + ::nx::core::alias V FOO1 ::foo + ::nx::core::alias V -per-object FOO2 ::foo ? {lsort [V object info methods]} {FOO2 bar} ? {lsort [V info methods]} {FOO1 bar} @@ -270,15 +270,15 @@ } # -# Tests for the ::next::core::alias store, used for introspection for +# Tests for the ::nx::core::alias store, used for introspection for # aliases. The alias store (an associative variable) is mostly # necessary for for the direct aliases (e.g. aliases to C implemented # tcl commands), for which we have no stubs at the place where the # alias was registered. # # -# structure of the ::next::core::alias store: +# structure of the ::nx::core::alias store: # ,, -> # @@ -287,95 +287,95 @@ o method bar args {;} -? {info vars ::next::core::alias} ::next::core::alias -? {array exists ::next::core::alias} 1 +? {info vars ::nx::core::alias} ::nx::core::alias +? {array exists ::nx::core::alias} 1 proc ::foo args {;} -::next::core::alias ::o FOO ::foo -::next::core::alias ::C FOO ::foo -? {info exists ::next::core::alias(::o,FOO,1)} 1 -? {info exists ::next::core::alias(::C,FOO,0)} 1 -? {array get ::next::core::alias ::o,FOO,1} "::o,FOO,1 ::foo" -? {array get ::next::core::alias ::C,FOO,0} "::C,FOO,0 ::foo" +::nx::core::alias ::o FOO ::foo +::nx::core::alias ::C FOO ::foo +? {info exists ::nx::core::alias(::o,FOO,1)} 1 +? {info exists ::nx::core::alias(::C,FOO,0)} 1 +? {array get ::nx::core::alias ::o,FOO,1} "::o,FOO,1 ::foo" +? {array get ::nx::core::alias ::C,FOO,0} "::C,FOO,0 ::foo" ? {o info method definition FOO} "::o alias FOO ::foo" ? {C info method definition FOO} "::C alias FOO ::foo" -::next::core::alias o FOO ::o::bar -? {info exists ::next::core::alias(::o,FOO,1)} 1 -? {array get ::next::core::alias ::o,FOO,1} "::o,FOO,1 ::o::bar" +::nx::core::alias o FOO ::o::bar +? {info exists ::nx::core::alias(::o,FOO,1)} 1 +? {array get ::nx::core::alias ::o,FOO,1} "::o,FOO,1 ::o::bar" ? {o info method definition FOO} "::o alias FOO ::o::bar" # AliasDelete in XOTclRemoveObjectMethod o method FOO {} {} -? {info exists ::next::core::alias(::o,FOO,1)} 0 -? {array get ::next::core::alias ::o,FOO,1} "" +? {info exists ::nx::core::alias(::o,FOO,1)} 0 +? {array get ::nx::core::alias ::o,FOO,1} "" ? {o info method definition FOO} "" # AliasDelete in XOTclRemoveClassMethod C method FOO {} {} -? {info exists ::next::core::alias(::C,FOO,0)} 0 -? {array get ::next::core::alias ::C,FOO,0} "" +? {info exists ::nx::core::alias(::C,FOO,0)} 0 +? {array get ::nx::core::alias ::C,FOO,0} "" ? {C info method definition FOO} "" -::next::core::alias ::o BAR ::foo -::next::core::alias ::C BAR ::foo +::nx::core::alias ::o BAR ::foo +::nx::core::alias ::C BAR ::foo # AliasDelete in XOTclAddObjectMethod -? {info exists ::next::core::alias(::o,BAR,1)} 1 +? {info exists ::nx::core::alias(::o,BAR,1)} 1 ::o method BAR {} {;} -? {info exists ::next::core::alias(::o,BAR,1)} 0 +? {info exists ::nx::core::alias(::o,BAR,1)} 0 # AliasDelete in XOTclAddInstanceMethod -? {info exists ::next::core::alias(::C,BAR,0)} 1 +? {info exists ::nx::core::alias(::C,BAR,0)} 1 ::C method BAR {} {;} -? {info exists ::next::core::alias(::C,BAR,0)} 0 +? {info exists ::nx::core::alias(::C,BAR,0)} 0 # AliasDelete in aliasCmdDeleteProc -::next::core::alias o FOO ::foo -? {info exists ::next::core::alias(::o,FOO,1)} 1 +::nx::core::alias o FOO ::foo +? {info exists ::nx::core::alias(::o,FOO,1)} 1 rename ::foo "" -? {info exists ::next::core::alias(::o,FOO,1)} 0 +? {info exists ::nx::core::alias(::o,FOO,1)} 0 -::next::core::alias o FOO ::o::bar -::next::core::alias o BAR ::o::FOO -? {info exists ::next::core::alias(::o,FOO,1)} 1 -? {info exists ::next::core::alias(::o,BAR,1)} 1 +::nx::core::alias o FOO ::o::bar +::nx::core::alias o BAR ::o::FOO +? {info exists ::nx::core::alias(::o,FOO,1)} 1 +? {info exists ::nx::core::alias(::o,BAR,1)} 1 o method bar {} {} -? {info exists ::next::core::alias(::o,FOO,1)} 0 -? {info exists ::next::core::alias(::o,BAR,1)} 0 +? {info exists ::nx::core::alias(::o,FOO,1)} 0 +? {info exists ::nx::core::alias(::o,BAR,1)} 0 # # pulling the rug out from the proc-alias deletion mechanism # proc ::foo args {;} -::next::core::alias C FOO ::foo -? {info exists ::next::core::alias(::C,FOO,0)} 1 -unset ::next::core::alias(::C,FOO,0) -? {info exists ::next::core::alias(::C,FOO,0)} 0 +::nx::core::alias C FOO ::foo +? {info exists ::nx::core::alias(::C,FOO,0)} 1 +unset ::nx::core::alias(::C,FOO,0) +? {info exists ::nx::core::alias(::C,FOO,0)} 0 ? {C info method definition FOO} "" ? {C info methods -methodtype alias} FOO rename ::foo "" ? {C info methods -methodtype alias} "" -? {info exists ::next::core::alias(::C,FOO,0)} 0 +? {info exists ::nx::core::alias(::C,FOO,0)} 0 ? {C info method definition FOO} "" # # test renaming of Tcl proc (actually sensed by the alias, though not # reflected by the alias definition store) # a) is this acceptable? -# b) sync ::next::core::alias upon "info method definition" calls? is this feasible, +# b) sync ::nx::core::alias upon "info method definition" calls? is this feasible, # e.g. through rename traces? # C create c proc ::foo args { return [self]->[self proc]} -? {info exists ::next::core::alias(::C,FOO,0)} 0 -::next::core::alias C FOO ::foo -? {info exists ::next::core::alias(::C,FOO,0)} 1 +? {info exists ::nx::core::alias(::C,FOO,0)} 0 +::nx::core::alias C FOO ::foo +? {info exists ::nx::core::alias(::C,FOO,0)} 1 ? {C info methods -methodtype alias} FOO rename ::foo ::foo2 -? {info exists ::next::core::alias(::C,FOO,0)} 1 +? {info exists ::nx::core::alias(::C,FOO,0)} 1 ? {C info methods -methodtype alias} FOO ? {c FOO} ::c->foo2 ? {C info method definition FOO} "::C alias FOO ::foo"; # should be ::foo2 (!) Index: tests/destroytest.xotcl =================================================================== diff -u -r81c800c8b9cb42ef6743d9b80ac2be5ca211a69a -r3f0573cc75724179f416942b974373e5a62ec05e --- tests/destroytest.xotcl (.../destroytest.xotcl) (revision 81c800c8b9cb42ef6743d9b80ac2be5ca211a69a) +++ tests/destroytest.xotcl (.../destroytest.xotcl) (revision 3f0573cc75724179f416942b974373e5a62ec05e) @@ -3,7 +3,7 @@ Test parameter count 10 -::next::core::alias ::next::Object set -objscope ::set +::nx::core::alias ::nx::Object set -objscope ::set Class create O -superclass Object { :method init {} { @@ -27,18 +27,18 @@ C method foo {} { puts stderr "==== $::case [self]" :destroy - puts stderr "AAAA [self] exists [::next::core::objectproperty [self] object]" + puts stderr "AAAA [self] exists [::nx::core::objectproperty [self] object]" :set x 1 ? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBBB" - ? {::next::core::objectproperty c1 object} 1 "$::case object still exists in proc" + ? {::nx::core::objectproperty c1 object} 1 "$::case object still exists in proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" } C create c1 c1 foo -puts stderr ======[::next::core::objectproperty c1 object] -? {::next::core::objectproperty c1 object} 0 "$::case object deleted" +puts stderr ======[::nx::core::objectproperty c1 object] +? {::nx::core::objectproperty c1 object} 0 "$::case object deleted" ? "set ::firstDestroy" 1 "firstDestroy called" @@ -52,18 +52,18 @@ C method foo {} { puts stderr "==== $::case [self]" :destroy - puts stderr "AAAA [self] exists [::next::core::objectproperty [self] object]" + puts stderr "AAAA [self] exists [::nx::core::objectproperty [self] object]" :set x 1 ? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBBB" - ? {::next::core::objectproperty c1 object} 1 "$::case object still exists in proc" + ? {::nx::core::objectproperty c1 object} 1 "$::case object still exists in proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" } C create c1 c1 foo -puts stderr ======[::next::core::objectproperty c1 object] -? {::next::core::objectproperty c1 object} 1 "$::case object deleted" +puts stderr ======[::nx::core::objectproperty c1 object] +? {::nx::core::objectproperty c1 object} 1 "$::case object deleted" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" @@ -77,18 +77,18 @@ C method foo {} { puts stderr "==== $::case [self]" [:info class] create [self] - puts stderr "AAAA [self] exists [::next::core::objectproperty [self] object]" + puts stderr "AAAA [self] exists [::nx::core::objectproperty [self] object]" :set x 1 ? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBBB" - ? {::next::core::objectproperty c1 object} 1 "$::case object still exists in proc" + ? {::nx::core::objectproperty c1 object} 1 "$::case object still exists in proc" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" } C create c1 c1 foo -puts stderr ======[::next::core::objectproperty c1 object] -? {::next::core::objectproperty c1 object} 1 "$::case object deleted" +puts stderr ======[::nx::core::objectproperty c1 object] +? {::nx::core::objectproperty c1 object} 1 "$::case object deleted" ? "set ::firstDestroy" 0 "firstDestroy called" # @@ -103,18 +103,18 @@ C method foo {} { puts stderr "==== $::case [self]" rename [self] "" - puts stderr "AAAA [self] exists [::next::core::objectproperty [self] object]" + puts stderr "AAAA [self] exists [::nx::core::objectproperty [self] object]" :set x 1 ? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBB" - ? {::next::core::objectproperty c1 object} 1 "$::case object still exists in proc" + ? {::nx::core::objectproperty c1 object} 1 "$::case object still exists in proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" } C create c1 c1 foo -puts stderr ======[::next::core::objectproperty c1 object] -? {::next::core::objectproperty c1 object} 0 "$::case object still exists after proc" +puts stderr ======[::nx::core::objectproperty c1 object] +? {::nx::core::objectproperty c1 object} 0 "$::case object still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" @@ -130,19 +130,19 @@ C method foo {} { puts stderr "==== $::case [self]" rename [self] "" - puts stderr "AAAA [self] exists [::next::core::objectproperty [self] object]" + puts stderr "AAAA [self] exists [::nx::core::objectproperty [self] object]" :set x 1 ? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBB" - ? {::next::core::objectproperty c1 object} 1 "$::case object still exists in proc" + ? {::nx::core::objectproperty c1 object} 1 "$::case object still exists in proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" } C create c1 c1 foo -puts stderr ======[::next::core::objectproperty c1 object] +puts stderr ======[::nx::core::objectproperty c1 object] puts stderr ======[c1 set x] -? {::next::core::objectproperty c1 object} 1 "$::case object still exists after proc" +? {::nx::core::objectproperty c1 object} 1 "$::case object still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" @@ -158,18 +158,18 @@ C method foo {} { puts stderr "==== $::case [self]" rename o [self] - puts stderr "AAAA [self] exists [::next::core::objectproperty [self] object]" + puts stderr "AAAA [self] exists [::nx::core::objectproperty [self] object]" :set x 1 ? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBB" - ? {::next::core::objectproperty c1 object} 1 "$::case object still exists in proc" + ? {::nx::core::objectproperty c1 object} 1 "$::case object still exists in proc" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" } C create c1 c1 foo -puts stderr ======[::next::core::objectproperty c1 object] -? {::next::core::objectproperty c1 object} 1 "$::case object still exists after proc" +puts stderr ======[::nx::core::objectproperty c1 object] +? {::nx::core::objectproperty c1 object} 1 "$::case object still exists after proc" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" @@ -189,7 +189,7 @@ } C create c1 c1 foo -? {::next::core::objectproperty c1 object} 1 "$::case object still exists after proc" +? {::nx::core::objectproperty c1 object} 1 "$::case object still exists after proc" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" @@ -209,28 +209,28 @@ C method foo {} { puts stderr "==== $::case [self]" namespace delete ::test - puts stderr "AAAA [self] exists [::next::core::objectproperty [self] object]" + puts stderr "AAAA [self] exists [::nx::core::objectproperty [self] object]" :set x 1 # # If the following line is commented in, the namespace is deleted # here. Is there a bug with nsPtr->activationCount # #? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBB" - puts stderr "???? [self] exists [::next::core::objectproperty [self] object]" - ? "::next::core::objectproperty [self] object" 0 ;# WHY? - puts stderr "???? [self] exists [::next::core::objectproperty [self] object]" + puts stderr "???? [self] exists [::nx::core::objectproperty [self] object]" + ? "::nx::core::objectproperty [self] object" 0 ;# WHY? + puts stderr "???? [self] exists [::nx::core::objectproperty [self] object]" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "$::case destroy not yet called" } } test::C create test::c1 test::c1 foo -puts stderr ======[::next::core::objectproperty test::c1 object] -? {::next::core::objectproperty test::c1 object} 0 "object still exists after proc" +puts stderr ======[::nx::core::objectproperty test::c1 object] +? {::nx::core::objectproperty test::c1 object} 0 "object still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "destroy was called when poping stack frame" -? {::next::core::objectproperty ::test::C object} 0 "class still exists after proc" +? {::nx::core::objectproperty ::test::C object} 0 "class still exists after proc" ? {namespace exists ::test::C} 0 "namespace ::test::C still exists after proc" ? {namespace exists ::test} 1 "parent ::test namespace still exists after proc" ? {namespace exists ::xotcl::classes::test::C} 0 "namespace ::xotcl::classes::test::C still exists after proc" @@ -249,25 +249,25 @@ C method foo {} { puts stderr "==== $::case [self]" namespace delete ::test - puts stderr "AAAA [self] exists [::next::core::objectproperty [self] object]" + puts stderr "AAAA [self] exists [::nx::core::objectproperty [self] object]" :set x 1 # # If the following line is commented in, the namespace is deleted # here. Is there a bug with nsPtr->activationCount # #? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBBB" - puts stderr "???? [self] exists [::next::core::objectproperty [self] object]" - ? "::next::core::objectproperty [self] object" 0 "$::case object still exists in proc";# WHY? - puts stderr "???? [self] exists [::next::core::objectproperty [self] object]" + puts stderr "???? [self] exists [::nx::core::objectproperty [self] object]" + ? "::nx::core::objectproperty [self] object" 0 "$::case object still exists in proc";# WHY? + puts stderr "???? [self] exists [::nx::core::objectproperty [self] object]" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called"; # NOT YET CALLED } } test::C create test::c1 test::c1 foo -puts stderr ======[::next::core::objectproperty test::c1 object] -? {::next::core::objectproperty test::c1 object} 0 "$::case object still exists after proc" +puts stderr ======[::nx::core::objectproperty test::c1 object] +? {::nx::core::objectproperty test::c1 object} 0 "$::case object still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" ;# toplevel destroy was blocked @@ -287,20 +287,20 @@ puts stderr "AAAA" # the following isobject call has a problem in Tcl_GetCommandFromObj(), # which tries to access invalid memory - puts stderr "AAAA [self] exists [::next::core::objectproperty [self] object]" + puts stderr "AAAA [self] exists [::nx::core::objectproperty [self] object]" :set x 1 #? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBBB" - ? {::next::core::objectproperty ::o::c1 object} 0 "$::case object still exists in proc" + ? {::nx::core::objectproperty ::o::c1 object} 0 "$::case object still exists in proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" } C create o::c1 o::c1 foo -puts stderr ======[::next::core::objectproperty ::o::c1 object] -? {::next::core::objectproperty ::o::c1 object} 0 "$::case object o::c1 still exists after proc" -? {::next::core::objectproperty o object} 0 "$::case object o still exists after proc" +puts stderr ======[::nx::core::objectproperty ::o::c1 object] +? {::nx::core::objectproperty ::o::c1 object} 0 "$::case object o::c1 still exists after proc" +? {::nx::core::objectproperty o object} 0 "$::case object o still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" @@ -317,18 +317,18 @@ C method foo {} { puts stderr "==== $::case [self]" o destroy - puts stderr "AAAA [self] exists [::next::core::objectproperty [self] object]" + puts stderr "AAAA [self] exists [::nx::core::objectproperty [self] object]" :set x 1 #? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBB" - ? {::next::core::objectproperty ::o::c1 object} 0 "$::case object still exists in proc" + ? {::nx::core::objectproperty ::o::c1 object} 0 "$::case object still exists in proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" } C create o::c1 o::c1 foo -puts stderr ======[::next::core::objectproperty ::o::c1 object] -? {::next::core::objectproperty ::o::c1 object} 0 "$::case object still exists after proc" +puts stderr ======[::nx::core::objectproperty ::o::c1 object] +? {::nx::core::objectproperty ::o::c1 object} 0 "$::case object still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" @@ -345,18 +345,18 @@ C method foo {} { puts stderr "==== $::case [self]" proc [self] {args} {puts HELLO} - puts stderr "AAAA [self] exists [::next::core::objectproperty [self] object]" + puts stderr "AAAA [self] exists [::nx::core::objectproperty [self] object]" :set x 1 #? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBB" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" - ? {::next::core::objectproperty c1 object} 0 "$::case object still exists in proc" + ? {::nx::core::objectproperty c1 object} 0 "$::case object still exists in proc" } C create c1 c1 foo -puts stderr ======[::next::core::objectproperty c1 object] -? {::next::core::objectproperty c1 object} 0 "$::case object still exists after proc" +puts stderr ======[::nx::core::objectproperty c1 object] +? {::nx::core::objectproperty c1 object} 0 "$::case object still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" @@ -372,23 +372,23 @@ C method foo {} { puts stderr "==== $::case [self]" C destroy - puts stderr "AAAA [self] exists [::next::core::objectproperty [self] object]" + puts stderr "AAAA [self] exists [::nx::core::objectproperty [self] object]" :set x 1 #? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBB" #? [:info class] ::xotcl::Object "object reclassed" ? [:info class] ::C "object reclassed?" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" - ? {::next::core::objectproperty c1 object} 1 "object still exists in proc" - #? {::next::core::objectproperty ::C class} 0 "class still exists in proc" - ? {::next::core::objectproperty ::C class} 1 "class still exists in proc" + ? {::nx::core::objectproperty c1 object} 1 "object still exists in proc" + #? {::nx::core::objectproperty ::C class} 0 "class still exists in proc" + ? {::nx::core::objectproperty ::C class} 1 "class still exists in proc" } C create c1 c1 foo -puts stderr ======[::next::core::objectproperty c1 object] -? {::next::core::objectproperty c1 object} 1 "object still exists after proc" -? [c1 info class] ::next::Object "after proc: object reclassed?" +puts stderr ======[::nx::core::objectproperty c1 object] +? {::nx::core::objectproperty c1 object} 1 "object still exists after proc" +? [c1 info class] ::nx::Object "after proc: object reclassed?" ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" @@ -402,7 +402,7 @@ C method foo {} { puts stderr "==== $::case [self]" C destroy - puts stderr "AAAA [self] exists [::next::core::objectproperty [self] object]" + puts stderr "AAAA [self] exists [::nx::core::objectproperty [self] object]" :set x 1 #? "[self] set x" 1 "$::case can still access [self]" puts stderr "BBB" @@ -412,14 +412,14 @@ ? "set ::ObjectDestroy" 1 "ObjectDestroy called" ? [:info class] ::C "object reclassed" #? [:info class] ::xotcl::Object "object reclassed" - ? {::next::core::objectproperty ::C::c1 object} 1 "object still exists in proc" - ? {::next::core::objectproperty ::C class} 1 "class still exists in proc" + ? {::nx::core::objectproperty ::C::c1 object} 1 "object still exists in proc" + ? {::nx::core::objectproperty ::C class} 1 "class still exists in proc" } C create ::C::c1 C::c1 foo -#puts stderr ======[::next::core::objectproperty ::C::c1 object] -? {::next::core::objectproperty ::C::c1 object} 0 "object still exists after proc" -? {::next::core::objectproperty ::C class} 0 "class still exists after proc" +#puts stderr ======[::nx::core::objectproperty ::C::c1 object] +? {::nx::core::objectproperty ::C::c1 object} 0 "object still exists after proc" +? {::nx::core::objectproperty ::C class} 0 "class still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" @@ -429,14 +429,14 @@ Object create x Object create x::y x destroy -? {::next::core::objectproperty x object} 0 "parent object gone" -? {::next::core::objectproperty x::y object} 0 "child object gone" +? {::nx::core::objectproperty x object} 0 "parent object gone" +? {::nx::core::objectproperty x::y object} 0 "child object gone" set case "deleting aliased object" Test case deleting-aliased-object Object create o Object create o2 -::next::core::alias o x o2 +::nx::core::alias o x o2 ? {o x} ::o2 "call object via alias" ? {o x info vars} "" "call info on aliased object" ? {o2 set x 10} 10 "set variable on object" @@ -455,27 +455,27 @@ Test case deleting-object-with-alias-to-object Object create o Object create o3 -::next::core::alias o x o3 +::nx::core::alias o x o3 o destroy -? {::next::core::objectproperty o object} 0 "parent object gone" -? {::next::core::objectproperty o3 object} 1 "aliased object still here" +? {::nx::core::objectproperty o object} 0 "parent object gone" +? {::nx::core::objectproperty o3 object} 1 "aliased object still here" o3 destroy -? {::next::core::objectproperty o3 object} 0 "aliased object destroyed" +? {::nx::core::objectproperty o3 object} 0 "aliased object destroyed" set case "create an alias, and delete cmd via aggregation" Test case create-alias-delete-via-aggregation Object create o Object create o3 -::next::core::alias o x o3 +::nx::core::alias o x o3 o::x destroy -? {::next::core::objectproperty o3 object} 0 "aliased object destroyed" +? {::nx::core::objectproperty o3 object} 0 "aliased object destroyed" o destroy set case "create an alias, and recreate obj" Test case create-alias-and-recreate-obj Object create o Object create o3 -::next::core::alias o x o3 +::nx::core::alias o x o3 Object create o3 o3 set a 13 ? {o x set a} 13 "aliased object works after recreate" @@ -486,8 +486,8 @@ Class create C Object create o Object create o3 -::next::core::alias o a o3 -::next::core::alias C b o +::nx::core::alias o a o3 +::nx::core::alias C b o C create c1 ? {c1 b set B 2} 2 "call 1st level" ? {c1 b a set A 3} 3 "call 2nd level" @@ -505,12 +505,12 @@ Class create C Object create o Object create o3 -::next::core::alias o a o3 -::next::core::alias C b o +::nx::core::alias o a o3 +::nx::core::alias C b o C create c1 C destroy -? {::next::core::objectproperty o object} 1 "object o still here" -? {::next::core::objectproperty o3 object} 1 "object o3 still here" +? {::nx::core::objectproperty o object} 1 "object o still here" +? {::nx::core::objectproperty o3 object} 1 "object o3 still here" o destroy o3 destroy c1 destroy @@ -527,12 +527,12 @@ # reuse the namespace for a class/object Class create ::module - ? {::next::core::objectproperty ::module class} 1 + ? {::nx::core::objectproperty ::module class} 1 # delete the object/class ... and namespace ::module destroy - ? {::next::core::objectproperty ::module class} 0 + ? {::nx::core::objectproperty ::module class} 0 } Test case namespace-import { @@ -546,25 +546,25 @@ Class create ::module { :create mod1 } - ? {::next::core::objectproperty ::module::Foo class} 1 - ? {::next::core::objectproperty ::module::foo class} 0 - ? {::next::core::objectproperty ::module::foo object} 1 - ? {::next::core::objectproperty ::module class} 1 + ? {::nx::core::objectproperty ::module::Foo class} 1 + ? {::nx::core::objectproperty ::module::foo class} 0 + ? {::nx::core::objectproperty ::module::foo object} 1 + ? {::nx::core::objectproperty ::module class} 1 Object create ::o { :requireNamespace } namespace eval ::o {namespace import ::module::*} - ? {::next::core::objectproperty ::o::Foo class} 1 - ? {::next::core::objectproperty ::o::foo object} 1 + ? {::nx::core::objectproperty ::o::Foo class} 1 + ? {::nx::core::objectproperty ::o::foo object} 1 # do not destroy namespace imported objects/classes ::o destroy - ? {::next::core::objectproperty ::o::Foo class} 0 - ? {::next::core::objectproperty ::o::foo object} 0 + ? {::nx::core::objectproperty ::o::Foo class} 0 + ? {::nx::core::objectproperty ::o::foo object} 0 - ? {::next::core::objectproperty ::module::Foo class} 1 - ? {::next::core::objectproperty ::module::foo object} 1 + ? {::nx::core::objectproperty ::module::Foo class} 1 + ? {::nx::core::objectproperty ::module::foo object} 1 ::module destroy } Index: tests/info-method.xotcl =================================================================== diff -u -r81c800c8b9cb42ef6743d9b80ac2be5ca211a69a -r3f0573cc75724179f416942b974373e5a62ec05e --- tests/info-method.xotcl (.../info-method.xotcl) (revision 81c800c8b9cb42ef6743d9b80ac2be5ca211a69a) +++ tests/info-method.xotcl (.../info-method.xotcl) (revision 3f0573cc75724179f416942b974373e5a62ec05e) @@ -38,7 +38,7 @@ ? {c1 info method definition foo} "::c1 method foo {} {puts foo}" ? {c1 info callable -which foo} "::c1 method foo {} {puts foo}" -? {C info method name m} "::next::core::classes::C::m" +? {C info method name m} "::nx::core::classes::C::m" ? {C object info method name mpo} "::C::mpo" ? {C info method definition m} {::C method m x {return proc-[self proc]}} @@ -65,7 +65,7 @@ ? {C object info method definition apo} "::C object alias apo ::puts" -? {::next::Object info callable -application} "" -? {::next::Class info callable -application} "" +? {::nx::Object info callable -application} "" +? {::nx::Class info callable -application} "" ? {lsort [C info callable -application]} "add1 apo fpo mpo spo" ? {lsort [c1 info callable -application]} "a addOne foo m m-with-assertions s" \ No newline at end of file Index: tests/interceptor-slot.xotcl =================================================================== diff -u -r81c800c8b9cb42ef6743d9b80ac2be5ca211a69a -r3f0573cc75724179f416942b974373e5a62ec05e --- tests/interceptor-slot.xotcl (.../interceptor-slot.xotcl) (revision 81c800c8b9cb42ef6743d9b80ac2be5ca211a69a) +++ tests/interceptor-slot.xotcl (.../interceptor-slot.xotcl) (revision 3f0573cc75724179f416942b974373e5a62ec05e) @@ -1,99 +1,99 @@ package require next package require xotcl::test -namespace import ::next::* +namespace import ::nx::* Class create M { :method mfoo {} {puts [self proc]} } Class create M2 Class create C -? {C info callable -which mixin} "::next::Class forward mixin ::next::Class::slot::mixin {%1 {get assign}} %self class-mixin" +? {C info callable -which mixin} "::nx::Class forward mixin ::nx::Class::slot::mixin {%1 {get assign}} %self class-mixin" C mixin M -? {C info precedence} "::next::Class ::next::Object" +? {C info precedence} "::nx::Class ::nx::Object" ? {C mixin} "::M" ? {C info mixin} "::M" C create c1 -? {c1 info precedence} "::M ::C ::next::Object" +? {c1 info precedence} "::M ::C ::nx::Object" C mixin add M2 -? {c1 info precedence} "::M2 ::M ::C ::next::Object" +? {c1 info precedence} "::M2 ::M ::C ::nx::Object" C mixin delete M2 -? {c1 info precedence} "::M ::C ::next::Object" +? {c1 info precedence} "::M ::C ::nx::Object" C mixin delete M # per-object mixins -? {c1 info precedence} "::C ::next::Object" +? {c1 info precedence} "::C ::nx::Object" c1 mixin add M -? {::next::core::relation c1 object-mixin} ::M +? {::nx::core::relation c1 object-mixin} ::M ? {catch {c1 mixin UNKNOWN}} 1 -? {::next::core::relation c1 object-mixin} "::M" +? {::nx::core::relation c1 object-mixin} "::M" # add again the same mixin c1 mixin add M -? {c1 info precedence} "::M ::C ::next::Object" +? {c1 info precedence} "::M ::C ::nx::Object" c1 mixin add M2 -? {c1 info precedence} "::M2 ::M ::C ::next::Object" +? {c1 info precedence} "::M2 ::M ::C ::nx::Object" c1 mixin delete M -? {c1 info precedence} "::M2 ::C ::next::Object" +? {c1 info precedence} "::M2 ::C ::nx::Object" c1 mixin delete M2 -? {c1 info precedence} "::C ::next::Object" +? {c1 info precedence} "::C ::nx::Object" # # adding, removing per-object mixins for classes through relation # "object-mixin" # -::next::core::relation C object-mixin M -? {C info precedence} "::M ::next::Class ::next::Object" +::nx::core::relation C object-mixin M +? {C info precedence} "::M ::nx::Class ::nx::Object" ? {C object info mixin} "::M" -::next::core::relation C object-mixin "" -? {C info precedence} "::next::Class ::next::Object" +::nx::core::relation C object-mixin "" +? {C info precedence} "::nx::Class ::nx::Object" # # adding, removing per-object mixins for classes through slot # "object-mixin" # C object-mixin M -? {C info precedence} "::M ::next::Class ::next::Object" +? {C info precedence} "::M ::nx::Class ::nx::Object" ? {C object info mixin} "::M" C object-mixin "" -? {C info precedence} "::next::Class ::next::Object" +? {C info precedence} "::nx::Class ::nx::Object" # # add and remove object mixin for classes via modifier "object" and # "mixin" # C object mixin M -? {C info precedence} "::M ::next::Class ::next::Object" +? {C info precedence} "::M ::nx::Class ::nx::Object" ? {C object info mixin} "::M" C object mixin "" -? {C info precedence} "::next::Class ::next::Object" +? {C info precedence} "::nx::Class ::nx::Object" # # add and remove object mixin for classes via object mixin add # C object mixin add M -? {C info precedence} "::M ::next::Class ::next::Object" +? {C info precedence} "::M ::nx::Class ::nx::Object" ? {C object info mixin} "::M" C object mixin "" -? {C info precedence} "::next::Class ::next::Object" +? {C info precedence} "::nx::Class ::nx::Object" # # adding per-object mixins for classes via "object mixin add M" # C object mixin add M -? {C info precedence} "::M ::next::Class ::next::Object" -? {::next::core::relation C object-mixin} ::M +? {C info precedence} "::M ::nx::Class ::nx::Object" +? {::nx::core::relation C object-mixin} ::M ? {catch {C object mixin add UNKNOWN}} 1 -? {::next::core::relation C object-mixin} "::M" +? {::nx::core::relation C object-mixin} "::M" C object mixin "" -? {C info precedence} "::next::Class ::next::Object" +? {C info precedence} "::nx::Class ::nx::Object" # # adding per-object mixins for classes via "object mixin M" # C object mixin M -? {C info precedence} "::M ::next::Class ::next::Object" +? {C info precedence} "::M ::nx::Class ::nx::Object" # forwarder with 0 arguments + flag ? {C object-mixin} "::M" Index: tests/method-modifiers.xotcl =================================================================== diff -u -r81c800c8b9cb42ef6743d9b80ac2be5ca211a69a -r3f0573cc75724179f416942b974373e5a62ec05e --- tests/method-modifiers.xotcl (.../method-modifiers.xotcl) (revision 81c800c8b9cb42ef6743d9b80ac2be5ca211a69a) +++ tests/method-modifiers.xotcl (.../method-modifiers.xotcl) (revision 3f0573cc75724179f416942b974373e5a62ec05e) @@ -64,7 +64,7 @@ C public setter s0 C protected setter s1 ? {c1 s0 0} 0 -? {::next::core::dispatch c1 s1 1} 1 +? {::nx::core::dispatch c1 s1 1} 1 C object setter s3 ? {C s3 3} 3 @@ -75,31 +75,31 @@ ? {c2 plain_method} "plain_method" ? {c2 public_method} "public_method" ? {catch {c2 protected_method}} 1 - ? {::next::core::dispatch c2 protected_method} "protected_method" + ? {::nx::core::dispatch c2 protected_method} "protected_method" } # class level forwards Test case class-level-forwards { ? {c2 plain_forward} "plain_method" ? {c2 public_forward} "public_method" ? {catch {c2 protected_forward}} 1 - ? {::next::core::dispatch c2 protected_forward} "protected_method" + ? {::nx::core::dispatch c2 protected_forward} "protected_method" } # class level setter Test case class-level-setter { ? {c2 plain_setter 1} "1" ? {c2 public_setter 2} "2" ? {catch {c2 protected_setter 3}} 1 - ? {::next::core::dispatch c2 protected_setter 4} "4" + ? {::nx::core::dispatch c2 protected_setter 4} "4" } # class level alias ....TODO: wanted behavior of [self proc]? not "plain_alias"? Test case class-level-alias { ? {c2 plain_alias} "plain_method" ? {c2 public_alias} "public_method" ? {catch {c2 protected_alias}} 1 - ? {::next::core::dispatch c2 protected_alias} "protected_method" + ? {::nx::core::dispatch c2 protected_alias} "protected_method" } ########### @@ -109,31 +109,31 @@ ? {C plain_object_method} "plain_object_method" ? {C public_object_method} "public_object_method" ? {catch {C protected_object_method}} 1 - ? {::next::core::dispatch C protected_object_method} "protected_object_method" + ? {::nx::core::dispatch C protected_object_method} "protected_object_method" } # class-object level forwards Test case class-object-level-forwards { ? {C plain_object_forward} "plain_object_method" ? {C public_object_forward} "public_object_method" ? {catch {C protected_object_forward}} 1 - ? {::next::core::dispatch C protected_object_forward} "protected_object_method" + ? {::nx::core::dispatch C protected_object_forward} "protected_object_method" } # class-object level setter Test case class-object-level-setter { ? {C plain_object_setter 1} "1" ? {C public_object_setter 2} "2" ? {catch {C protected_object_setter 3}} 1 - ? {::next::core::dispatch C protected_object_setter 4} "4" + ? {::nx::core::dispatch C protected_object_setter 4} "4" } # class-object level alias ....TODO: wanted behavior of [self proc]? not "plain_alias"? Test case class-object-level-alias { ? {C plain_object_alias} "plain_object_method" ? {C public_object_alias} "public_object_method" ? {catch {C protected_object_alias}} 1 - ? {::next::core::dispatch C protected_object_alias} "protected_object_method" + ? {::nx::core::dispatch C protected_object_alias} "protected_object_method" } ########### @@ -143,30 +143,30 @@ ? {c1 plain_object_method} "plain_object_method" ? {c1 public_object_method} "public_object_method" ? {catch {c1 protected_object_method}} 1 - ? {::next::core::dispatch c1 protected_object_method} "protected_object_method" + ? {::nx::core::dispatch c1 protected_object_method} "protected_object_method" } # object level forwards Test case object-level-forwards { ? {c1 plain_object_forward} "plain_object_method" ? {c1 public_object_forward} "public_object_method" ? {catch {c1 protected_object_forward}} 1 - ? {::next::core::dispatch c1 protected_object_forward} "protected_object_method" + ? {::nx::core::dispatch c1 protected_object_forward} "protected_object_method" } # object level setter Test case object-level-setter ? {c1 plain_object_setter 1} "1" ? {c1 public_object_setter 2} "2" ? {catch {c1 protected_object_setter 3}} 1 -? {::next::core::dispatch c1 protected_object_setter 4} "4" +? {::nx::core::dispatch c1 protected_object_setter 4} "4" # object level alias ....TODO: wanted behavior of [self proc]? not "plain_alias"? Test case object-level-alias { ? {c1 plain_object_alias} "plain_object_method" ? {c1 public_object_alias} "public_object_method" ? {catch {c1 protected_object_alias}} 1 - ? {::next::core::dispatch c1 protected_object_alias} "protected_object_method" + ? {::nx::core::dispatch c1 protected_object_alias} "protected_object_method" ? {lsort [c1 info methods]} \ "plain_object_alias plain_object_forward plain_object_method plain_object_setter public_object_alias public_object_forward public_object_method public_object_setter" @@ -238,7 +238,7 @@ Class create C { set x [:attribute a] - ? [list set _ $x] "::next::core::classes::C::a" + ? [list set _ $x] "::nx::core::classes::C::a" # attribute with default :attribute {b b1} Index: tests/mixinoftest.xotcl =================================================================== diff -u -r81c800c8b9cb42ef6743d9b80ac2be5ca211a69a -r3f0573cc75724179f416942b974373e5a62ec05e --- tests/mixinoftest.xotcl (.../mixinoftest.xotcl) (revision 81c800c8b9cb42ef6743d9b80ac2be5ca211a69a) +++ tests/mixinoftest.xotcl (.../mixinoftest.xotcl) (revision 3f0573cc75724179f416942b974373e5a62ec05e) @@ -315,7 +315,7 @@ # redefinition and softrecreate ########################################### Test case pcm-redefine-soft -::next::core::configure softrecreate true +::nx::core::configure softrecreate true Class A Class B -instmixin A Class C -superclass B @@ -349,7 +349,7 @@ # with softrecreate off ########################################### Test case precedence -::next::core::configure softrecreate false +::nx::core::configure softrecreate false Class O Class A -superclass O Class B -superclass A @@ -381,7 +381,7 @@ # with softrecreate on ########################################### Test case alternate-precedence -::next::core::configure softrecreate false +::nx::core::configure softrecreate false Class O Class A -superclass O Class B -superclass A @@ -414,7 +414,7 @@ # with softrecreate on ########################################### Test case recreate-precedence -::next::core::configure softrecreate true +::nx::core::configure softrecreate true Class O Class A -superclass O Class B -superclass A @@ -446,7 +446,7 @@ # with softrecreate on ########################################### Test case recreate-alternate-precedence -::next::core::configure softrecreate true +::nx::core::configure softrecreate true Class O Class A -superclass O Class B -superclass A Index: tests/object-system.xotcl =================================================================== diff -u -r81c800c8b9cb42ef6743d9b80ac2be5ca211a69a -r3f0573cc75724179f416942b974373e5a62ec05e --- tests/object-system.xotcl (.../object-system.xotcl) (revision 81c800c8b9cb42ef6743d9b80ac2be5ca211a69a) +++ tests/object-system.xotcl (.../object-system.xotcl) (revision 3f0573cc75724179f416942b974373e5a62ec05e) @@ -81,16 +81,16 @@ # basic parameter tests Class C -parameter {{x 1} {y 2}} -? {::next::core::objectproperty C object} 1 -? {::next::core::objectproperty C::slot object} 1 +? {::nx::core::objectproperty C object} 1 +? {::nx::core::objectproperty C::slot object} 1 ? {C info children} ::C::slot C copy X -? {::next::core::objectproperty X object} 1 +? {::nx::core::objectproperty X object} 1 ? {X info vars} "" ? {C info vars} "" -? {::next::core::objectproperty X::slot object} 1 +? {::nx::core::objectproperty X::slot object} 1 #? {C::slot info vars} __parameter ? {C info parameter} {{x 1} {y 2}} @@ -106,68 +106,68 @@ o proc bar {x} {return goo-$x} # dispatch without colon names -::next::core::dispatch o set x 1 +::nx::core::dispatch o set x 1 ? {o info vars} x "simple dispatch has set variable x" ? {o set x} 1 "simple dispatch has set variable x to 1" -? {::next::core::dispatch o foo} "goo" "simple dispatch with one arg works" -? {::next::core::dispatch o bar 1} "goo-1" "simple dispatch with two args works" +? {::nx::core::dispatch o foo} "goo" "simple dispatch with one arg works" +? {::nx::core::dispatch o bar 1} "goo-1" "simple dispatch with two args works" o destroy # dispatch without colon names Object o -set x 1 -::next::core::dispatch ::o ::incr x +::nx::core::dispatch ::o ::incr x ? {o set x} 1 "cmd dispatch without -objscope did not modify the instance variable" -::next::core::dispatch ::o -objscope ::incr x +::nx::core::dispatch ::o -objscope ::incr x ? {o set x} 2 "cmd dispatch -objscope modifies the instance variable" -? {catch {::next::core::dispatch ::o -objscope ::xxx x}} 1 "cmd dispatch with unknown command" +? {catch {::nx::core::dispatch ::o -objscope ::xxx x}} 1 "cmd dispatch with unknown command" o destroy puts stderr ===MINI-OBJECTSYSTEM # test object system # create a minimal object system without internally dipatched methods -::next::core::createobjectsystem ::object ::class +::nx::core::createobjectsystem ::object ::class -? {::next::core::objectproperty ::object object} 1 -? {::next::core::objectproperty ::object class} 1 -? {::next::core::objectproperty ::object metaclass} 0 -? {::next::core::relation ::object class} ::class -? {::next::core::relation ::object superclass} "" +? {::nx::core::objectproperty ::object object} 1 +? {::nx::core::objectproperty ::object class} 1 +? {::nx::core::objectproperty ::object metaclass} 0 +? {::nx::core::relation ::object class} ::class +? {::nx::core::relation ::object superclass} "" -? {::next::core::objectproperty ::class object} 1 -? {::next::core::objectproperty ::class class} 1 -? {::next::core::objectproperty ::class metaclass} 1 -? {::next::core::relation ::class class} ::class -? {::next::core::relation ::class superclass} ::object +? {::nx::core::objectproperty ::class object} 1 +? {::nx::core::objectproperty ::class class} 1 +? {::nx::core::objectproperty ::class metaclass} 1 +? {::nx::core::relation ::class class} ::class +? {::nx::core::relation ::class superclass} ::object # define non-standard methos to create/destroy objects and classes -::next::core::alias ::class + ::next::core::cmd::Class::create -::next::core::alias ::object - ::next::core::cmd::Object::destroy +::nx::core::alias ::class + ::nx::core::cmd::Class::create +::nx::core::alias ::object - ::nx::core::cmd::Object::destroy # create a class named C ::class + C -? {::next::core::objectproperty ::C object} 1 -? {::next::core::objectproperty ::C class} 1 -? {::next::core::objectproperty ::C metaclass} 0 -? {::next::core::relation ::C class} ::class -? {::next::core::relation ::C superclass} ::object +? {::nx::core::objectproperty ::C object} 1 +? {::nx::core::objectproperty ::C class} 1 +? {::nx::core::objectproperty ::C metaclass} 0 +? {::nx::core::relation ::C class} ::class +? {::nx::core::relation ::C superclass} ::object # create an instance of C C + c1 -? {::next::core::objectproperty ::c1 object} 1 -? {::next::core::objectproperty ::c1 class} 0 -? {::next::core::objectproperty ::c1 metaclass} 0 -? {::next::core::relation ::c1 class} ::C +? {::nx::core::objectproperty ::c1 object} 1 +? {::nx::core::objectproperty ::c1 class} 0 +? {::nx::core::objectproperty ::c1 metaclass} 0 +? {::nx::core::relation ::c1 class} ::C # destroy instance and class c1 - -? {::next::core::objectproperty ::c1 object} 0 -? {::next::core::objectproperty ::C class} 1 +? {::nx::core::objectproperty ::c1 object} 0 +? {::nx::core::objectproperty ::C class} 1 C - -? {::next::core::objectproperty ::C class} 0 +? {::nx::core::objectproperty ::C class} 0 puts stderr ===EXIT Index: tests/parameters.xotcl =================================================================== diff -u -r81c800c8b9cb42ef6743d9b80ac2be5ca211a69a -r3f0573cc75724179f416942b974373e5a62ec05e --- tests/parameters.xotcl (.../parameters.xotcl) (revision 81c800c8b9cb42ef6743d9b80ac2be5ca211a69a) +++ tests/parameters.xotcl (.../parameters.xotcl) (revision 3f0573cc75724179f416942b974373e5a62ec05e) @@ -7,9 +7,9 @@ set o [Object create o] puts o=$o - ? {::next::core::objectproperty ::o object} 1 + ? {::nx::core::objectproperty ::o object} 1 } -? {::next::core::objectproperty ::o object} 0 +? {::nx::core::objectproperty ::o object} 0 #exit ####################################################### @@ -24,49 +24,49 @@ Class create M c1 mixin M - ? {::next::core::parametercheck object o1} 1 - ? {::next::core::parametercheck integer 1} 1 + ? {::nx::core::parametercheck object o1} 1 + ? {::nx::core::parametercheck integer 1} 1 - ? {::next::core::objectproperty o1 object} 1 - ? {::next::core::objectproperty c1 type C} 1 + ? {::nx::core::objectproperty o1 object} 1 + ? {::nx::core::objectproperty c1 type C} 1 - ? {::next::core::is c1 object -type C} 1 - ? {::next::core::is c1 object -hasmixin M -type C} 1 - ? {::next::core::is c1 object -hasmixin M1 -type C} 0 - ? {::next::core::is c1 object -hasmixin M -type C0} 0 - ? {::next::core::is o1 object} 1 - ? {::next::core::is 1 integer} 1 - ? {::next::core::is c1 type C} 1 - ? {::next::core::is o type C} 0 - ? {::next::core::is o object -type C} 0 - ? {::next::core::is o object -hasmixin C} 0 + ? {::nx::core::is c1 object -type C} 1 + ? {::nx::core::is c1 object -hasmixin M -type C} 1 + ? {::nx::core::is c1 object -hasmixin M1 -type C} 0 + ? {::nx::core::is c1 object -hasmixin M -type C0} 0 + ? {::nx::core::is o1 object} 1 + ? {::nx::core::is 1 integer} 1 + ? {::nx::core::is c1 type C} 1 + ? {::nx::core::is o type C} 0 + ? {::nx::core::is o object -type C} 0 + ? {::nx::core::is o object -hasmixin C} 0 #exit - ? {::next::core::parametercheck class o1} {expected class but got "o1" for parameter value} - ? {::next::core::parametercheck -nocomplain class o1} 0 - ? {::next::core::parametercheck class Test} 1 - ? {::next::core::parametercheck object,multivalued [list o1 Test]} 1 + ? {::nx::core::parametercheck class o1} {expected class but got "o1" for parameter value} + ? {::nx::core::parametercheck -nocomplain class o1} 0 + ? {::nx::core::parametercheck class Test} 1 + ? {::nx::core::parametercheck object,multivalued [list o1 Test]} 1 - ? {::next::core::parametercheck integer,multivalued [list 1 2 3]} 1 - ? {::next::core::parametercheck integer,multivalued [list 1 2 3 a]} \ + ? {::nx::core::parametercheck integer,multivalued [list 1 2 3]} 1 + ? {::nx::core::parametercheck integer,multivalued [list 1 2 3 a]} \ {invalid value in "1 2 3 a": expected integer but got "a" for parameter value} - ? {::next::core::parametercheck object,type=::C c1} 1 - ? {::next::core::parametercheck object,type=::C o} \ + ? {::nx::core::parametercheck object,type=::C c1} 1 + ? {::nx::core::parametercheck object,type=::C o} \ {expected object but got "o" for parameter value} \ "object, but different type" - ? {::next::core::parametercheck object,type=::C c} \ + ? {::nx::core::parametercheck object,type=::C c} \ {expected object but got "c" for parameter value} \ "no object" - ? {::next::core::parametercheck object,type=::next::Object c1} 1 "general type" + ? {::nx::core::parametercheck object,type=::nx::Object c1} 1 "general type" # do not allow "currently unknown" user defined types in parametercheck - ? {::next::core::parametercheck in1 aaa} {invalid value constraints "in1"} + ? {::nx::core::parametercheck in1 aaa} {invalid value constraints "in1"} - ? {::next::core::parametercheck lower c} 1 "lower case char" - ? {::next::core::parametercheck lower abc} 1 "lower case chars" - ? {::next::core::parametercheck lower Abc} {expected lower but got "Abc" for parameter value} + ? {::nx::core::parametercheck lower c} 1 "lower case char" + ? {::nx::core::parametercheck lower abc} 1 "lower case chars" + ? {::nx::core::parametercheck lower Abc} {expected lower but got "Abc" for parameter value} ? {string is lower abc} 1 "tcl command 'string is lower'" - ? {::next::core::parametercheck {i:integer 1} 2} {invalid value constraints "i:integer 1"} + ? {::nx::core::parametercheck {i:integer 1} 2} {invalid value constraints "i:integer 1"} } ####################################################### @@ -81,7 +81,7 @@ } } - ? {::next::core::parametercheck sex,slot=::paramManager female} "1" + ? {::nx::core::parametercheck sex,slot=::paramManager female} "1" } ####################################################### # cononical feature table @@ -140,10 +140,10 @@ # ::xotcl::RelationSlot -superclass ::xotcl::Slot { # {multivalued true} # {type relation} -# {elementtype ::next::Class} +# {elementtype ::nx::Class} # } -- sample instances: class superclass, mixin filter # -# ::next::Attribute -superclass ::xotcl::Slot { +# ::nx::Attribute -superclass ::xotcl::Slot { # {value_check once} # initcmd # valuecmd @@ -165,13 +165,13 @@ C create c1 ? {C eval {:objectparameter}} \ - "-object-mixin:relation,slot=::next::Class::slot::object-mixin -mixin:relation,arg=class-mixin,slot=::next::Class::slot::mixin -superclass:relation,slot=::next::Class::slot::superclass -object-filter:relation,slot=::next::Class::slot::object-filter -filter:relation,arg=class-filter,slot=::next::Class::slot::filter -class:relation,slot=::next::Object::slot::class -parameter:method,optional -noinit:method,optional,noarg -volatile:method,optional,noarg __initcmd:initcmd,optional" + "-object-mixin:relation,slot=::nx::Class::slot::object-mixin -mixin:relation,arg=class-mixin,slot=::nx::Class::slot::mixin -superclass:relation,slot=::nx::Class::slot::superclass -object-filter:relation,slot=::nx::Class::slot::object-filter -filter:relation,arg=class-filter,slot=::nx::Class::slot::filter -class:relation,slot=::nx::Object::slot::class -parameter:method,optional -noinit:method,optional,noarg -volatile:method,optional,noarg __initcmd:initcmd,optional" ? {c1 eval {:objectparameter}} \ - "-a:slot=::C::slot::a -b:boolean,slot=::C::slot::b {-c:slot=::C::slot::c 1} -mixin:relation,arg=object-mixin,slot=::next::Object::slot::mixin -filter:relation,slot=::next::Object::slot::filter -class:relation,slot=::next::Object::slot::class -noinit:method,optional,noarg -volatile:method,optional,noarg __initcmd:initcmd,optional" + "-a:slot=::C::slot::a -b:boolean,slot=::C::slot::b {-c:slot=::C::slot::c 1} -mixin:relation,arg=object-mixin,slot=::nx::Object::slot::mixin -filter:relation,slot=::nx::Object::slot::filter -class:relation,slot=::nx::Object::slot::class -noinit:method,optional,noarg -volatile:method,optional,noarg __initcmd:initcmd,optional" } ####################################################### @@ -184,13 +184,13 @@ c1 class Object ? {c1 eval :objectparameter} \ - "-mixin:relation,arg=object-mixin,slot=::next::Object::slot::mixin -filter:relation,slot=::next::Object::slot::filter -class:relation,slot=::next::Object::slot::class -noinit:method,optional,noarg -volatile:method,optional,noarg __initcmd:initcmd,optional" + "-mixin:relation,arg=object-mixin,slot=::nx::Object::slot::mixin -filter:relation,slot=::nx::Object::slot::filter -class:relation,slot=::nx::Object::slot::class -noinit:method,optional,noarg -volatile:method,optional,noarg __initcmd:initcmd,optional" Class create D -superclass C -parameter {d:required} D create d1 -d 100 ? {d1 eval :objectparameter} \ - "-d:required,slot=::D::slot::d -a:slot=::C::slot::a -b:boolean,slot=::C::slot::b {-c:slot=::C::slot::c 1} -mixin:relation,arg=object-mixin,slot=::next::Object::slot::mixin -filter:relation,slot=::next::Object::slot::filter -class:relation,slot=::next::Object::slot::class -noinit:method,optional,noarg -volatile:method,optional,noarg __initcmd:initcmd,optional" + "-d:required,slot=::D::slot::d -a:slot=::C::slot::a -b:boolean,slot=::C::slot::b {-c:slot=::C::slot::c 1} -mixin:relation,arg=object-mixin,slot=::nx::Object::slot::mixin -filter:relation,slot=::nx::Object::slot::filter -class:relation,slot=::nx::Object::slot::class -noinit:method,optional,noarg -volatile:method,optional,noarg __initcmd:initcmd,optional" } ####################################################### @@ -206,28 +206,28 @@ Class create M2 -parameter {b2} D mixin M ? {d1 eval :objectparameter} \ - "-b:slot=::M::slot::b -m1:slot=::M::slot::m1 -m2:slot=::M::slot::m2 -d:required,slot=::D::slot::d -a:slot=::C::slot::a {-c:slot=::C::slot::c 1} -mixin:relation,arg=object-mixin,slot=::next::Object::slot::mixin -filter:relation,slot=::next::Object::slot::filter -class:relation,slot=::next::Object::slot::class -noinit:method,optional,noarg -volatile:method,optional,noarg __initcmd:initcmd,optional" \ + "-b:slot=::M::slot::b -m1:slot=::M::slot::m1 -m2:slot=::M::slot::m2 -d:required,slot=::D::slot::d -a:slot=::C::slot::a {-c:slot=::C::slot::c 1} -mixin:relation,arg=object-mixin,slot=::nx::Object::slot::mixin -filter:relation,slot=::nx::Object::slot::filter -class:relation,slot=::nx::Object::slot::class -noinit:method,optional,noarg -volatile:method,optional,noarg __initcmd:initcmd,optional" \ "mixin added" M mixin M2 ? {d1 eval :objectparameter} \ - "-b2:slot=::M2::slot::b2 -b:slot=::M::slot::b -m1:slot=::M::slot::m1 -m2:slot=::M::slot::m2 -d:required,slot=::D::slot::d -a:slot=::C::slot::a {-c:slot=::C::slot::c 1} -mixin:relation,arg=object-mixin,slot=::next::Object::slot::mixin -filter:relation,slot=::next::Object::slot::filter -class:relation,slot=::next::Object::slot::class -noinit:method,optional,noarg -volatile:method,optional,noarg __initcmd:initcmd,optional" \ + "-b2:slot=::M2::slot::b2 -b:slot=::M::slot::b -m1:slot=::M::slot::m1 -m2:slot=::M::slot::m2 -d:required,slot=::D::slot::d -a:slot=::C::slot::a {-c:slot=::C::slot::c 1} -mixin:relation,arg=object-mixin,slot=::nx::Object::slot::mixin -filter:relation,slot=::nx::Object::slot::filter -class:relation,slot=::nx::Object::slot::class -noinit:method,optional,noarg -volatile:method,optional,noarg __initcmd:initcmd,optional" \ "transitive mixin added" D mixin "" #we should have again the old interface ? {d1 eval :objectparameter} \ - "-d:required,slot=::D::slot::d -a:slot=::C::slot::a -b:boolean,slot=::C::slot::b {-c:slot=::C::slot::c 1} -mixin:relation,arg=object-mixin,slot=::next::Object::slot::mixin -filter:relation,slot=::next::Object::slot::filter -class:relation,slot=::next::Object::slot::class -noinit:method,optional,noarg -volatile:method,optional,noarg __initcmd:initcmd,optional" + "-d:required,slot=::D::slot::d -a:slot=::C::slot::a -b:boolean,slot=::C::slot::b {-c:slot=::C::slot::c 1} -mixin:relation,arg=object-mixin,slot=::nx::Object::slot::mixin -filter:relation,slot=::nx::Object::slot::filter -class:relation,slot=::nx::Object::slot::class -noinit:method,optional,noarg -volatile:method,optional,noarg __initcmd:initcmd,optional" C mixin M ? {d1 eval :objectparameter} \ - "-b2:slot=::M2::slot::b2 -b:slot=::M::slot::b -m1:slot=::M::slot::m1 -m2:slot=::M::slot::m2 -d:required,slot=::D::slot::d -a:slot=::C::slot::a {-c:slot=::C::slot::c 1} -mixin:relation,arg=object-mixin,slot=::next::Object::slot::mixin -filter:relation,slot=::next::Object::slot::filter -class:relation,slot=::next::Object::slot::class -noinit:method,optional,noarg -volatile:method,optional,noarg __initcmd:initcmd,optional" \ + "-b2:slot=::M2::slot::b2 -b:slot=::M::slot::b -m1:slot=::M::slot::m1 -m2:slot=::M::slot::m2 -d:required,slot=::D::slot::d -a:slot=::C::slot::a {-c:slot=::C::slot::c 1} -mixin:relation,arg=object-mixin,slot=::nx::Object::slot::mixin -filter:relation,slot=::nx::Object::slot::filter -class:relation,slot=::nx::Object::slot::class -noinit:method,optional,noarg -volatile:method,optional,noarg __initcmd:initcmd,optional" \ "mixin added" C mixin "" #we should have again the old interface ? {d1 eval :objectparameter} \ - "-d:required,slot=::D::slot::d -a:slot=::C::slot::a -b:boolean,slot=::C::slot::b {-c:slot=::C::slot::c 1} -mixin:relation,arg=object-mixin,slot=::next::Object::slot::mixin -filter:relation,slot=::next::Object::slot::filter -class:relation,slot=::next::Object::slot::class -noinit:method,optional,noarg -volatile:method,optional,noarg __initcmd:initcmd,optional" + "-d:required,slot=::D::slot::d -a:slot=::C::slot::a -b:boolean,slot=::C::slot::b {-c:slot=::C::slot::c 1} -mixin:relation,arg=object-mixin,slot=::nx::Object::slot::mixin -filter:relation,slot=::nx::Object::slot::filter -class:relation,slot=::nx::Object::slot::class -noinit:method,optional,noarg -volatile:method,optional,noarg __initcmd:initcmd,optional" } ####################################################### @@ -291,7 +291,7 @@ "don't allow relation option as method parameter" ? {D method foo {a:double} {return $a}} \ - {::next::core::classes::D::foo} \ + {::nx::core::classes::D::foo} \ "allow 'string is XXXX' for argument checking" ? {d1 foo 1} 1 "check int as double" ? {d1 foo 1.1} 1.1 "check double as double" @@ -498,7 +498,7 @@ D create d1 # create a userdefined type - ::next::methodParameterSlot method type=mytype {name value args} { + ::nx::methodParameterSlot method type=mytype {name value args} { if {$value < 1 || $value > 3} { error "Value '$value' of parameter $name is not between 1 and 3" } @@ -519,11 +519,11 @@ } ? {d1 foo 10} \ - "::next::methodParameterSlot: unable to dispatch method 'type=unknowntype'" \ + "::nx::methodParameterSlot: unable to dispatch method 'type=unknowntype'" \ "missing type checker" # create a userdefined type with a simple argument - ::next::methodParameterSlot method type=in {name value arg} { + ::nx::methodParameterSlot method type=in {name value arg} { if {$value ni [split $arg |]} { error "Value '$value' of parameter $name not in permissible values $arg" } @@ -549,7 +549,7 @@ "Value 'very good' of parameter b not in permissible values good|bad" \ "invalid value (not included)" - ::next::methodParameterSlot method type=range {name value arg} { + ::nx::methodParameterSlot method type=range {name value arg} { foreach {min max} [split $arg -] break if {$value < $min || $value > $max} { error "Value '$value' of parameter $name not between $min and $max" @@ -575,7 +575,7 @@ # # handling of arg with spaces/arg as list # - ::next::methodParameterSlot method type=list {name value arg} { + ::nx::methodParameterSlot method type=list {name value arg} { #puts $value/$arg return $value } @@ -611,7 +611,7 @@ ? {D info method parameter foo-hasmixin} "x:hasmixin,arg=::M" ? {D info method parameter foo-type} "x:object,type=::C" - ? {d1 foo-base ::next::Object} "::next::Object" + ? {d1 foo-base ::nx::Object} "::nx::Object" ? {d1 foo-base C} \ {expected baseclass but got "C" for parameter x} \ "not a base class" @@ -624,9 +624,9 @@ {expected class but got "o" for parameter x} \ "not a class" - ? {d1 foo-meta ::next::Class} "::next::Class" - ? {d1 foo-meta ::next::Object} \ - {expected metaclass but got "::next::Object" for parameter x} \ + ? {d1 foo-meta ::nx::Class} "::nx::Class" + ? {d1 foo-meta ::nx::Object} \ + {expected metaclass but got "::nx::Object" for parameter x} \ "not a base class" ? {d1 foo-hasmixin c1} "c1" @@ -792,7 +792,7 @@ "value is not an object" ParamTest slots { - ::next::Attribute create os -type object -multivalued true + ::nx::Attribute create os -type object -multivalued true } ? {p os o} \ @@ -812,7 +812,7 @@ ####################################################### Test case multivalued-app-converter { - ::next::methodParameterSlot method type=sex {name value args} { + ::nx::methodParameterSlot method type=sex {name value args} { #puts stderr "[self] slot specific converter" switch -glob $value { m* {return m} @@ -836,11 +836,11 @@ # values into emtpy strings. } - ? {::next::core::parametercheck mType,slot=::tmpObj,multivalued {1 0}} \ + ? {::nx::core::parametercheck mType,slot=::tmpObj,multivalued {1 0}} \ {invalid value in "1 0": expected false but got 1} \ "fail on first value" - ? {::next::core::parametercheck mType,slot=::tmpObj,multivalued {0 0 0}} 1 "all pass" - ? {::next::core::parametercheck mType,slot=::tmpObj,multivalued {0 1}} \ + ? {::nx::core::parametercheck mType,slot=::tmpObj,multivalued {0 0 0}} 1 "all pass" + ? {::nx::core::parametercheck mType,slot=::tmpObj,multivalued {0 1}} \ {invalid value in "0 1": expected false but got 1} \ "fail o last value" } @@ -860,7 +860,7 @@ } } - ? {::next::core::parametercheck integer,slot=::mySlot 1} 1 + ? {::nx::core::parametercheck integer,slot=::mySlot 1} 1 ? {o foo 3} 4 } @@ -895,17 +895,17 @@ Object create o Class create C - ? {::next::core::setter o a} "::o::a" - ? {::next::core::setter C c} "::next::core::classes::C::c" + ? {::nx::core::setter o a} "::o::a" + ? {::nx::core::setter C c} "::nx::core::classes::C::c" ? {o info method definition a} "::o setter a" ? {o info method parameter a} "a" ? {o info method args a} "a" ? {C info method definition c} "::C setter c" ? {o a 1} "1" - ? {::next::core::setter o a:integer} "::o::a" - ? {::next::core::setter o ints:integer,multivalued} "::o::ints" - ? {::next::core::setter o o:object} "::o::o" + ? {::nx::core::setter o a:integer} "::o::a" + ? {::nx::core::setter o ints:integer,multivalued} "::o::ints" + ? {::nx::core::setter o o:object} "::o::o" ? {o info method name ints} "::o::ints" ? {o info method definition ints} "::o setter ints:integer,multivalued" @@ -923,8 +923,8 @@ ? {o ints {10 100 1000}} {10 100 1000} ? {o ints hugo} {invalid value in "hugo": expected integer but got "hugo" for parameter ints} ? {o o o} o - ? {::next::core::setter o {d default}} {parameter "d" is not allowed to have default "default"} - ? {::next::core::setter o -x} {method name "-x" must not start with a dash} + ? {::nx::core::setter o {d default}} {parameter "d" is not allowed to have default "default"} + ? {::nx::core::setter o -x} {method name "-x" must not start with a dash} } ####################################################### Index: tests/protected.xotcl =================================================================== diff -u -r81c800c8b9cb42ef6743d9b80ac2be5ca211a69a -r3f0573cc75724179f416942b974373e5a62ec05e --- tests/protected.xotcl (.../protected.xotcl) (revision 81c800c8b9cb42ef6743d9b80ac2be5ca211a69a) +++ tests/protected.xotcl (.../protected.xotcl) (revision 3f0573cc75724179f416942b974373e5a62ec05e) @@ -24,19 +24,19 @@ ? {c1 bar-SET} {1} ? {c1 bar-foo} {foo} -::next::core::methodproperty C SET protected true +::nx::core::methodproperty C SET protected true ? {catch {c1 SET x 1} errorMsg; set errorMsg} {::c1: unable to dispatch method 'SET'} -? {::next::core::dispatch c1 SET x 2} {2} "dispatch of protected methods works" +? {::nx::core::dispatch c1 SET x 2} {2} "dispatch of protected methods works" ? {c1 foo} {foo} ? {c1 bar} {bar} ? {c1 bar-SET} {1} ? {c1 bar-foo} {foo} ? {catch {c2 bar-SET} errorMsg; set errorMsg} {::c1: unable to dispatch method 'SET'} ? {c2 bar-foo} {foo} -::next::core::methodproperty C foo protected true +::nx::core::methodproperty C foo protected true ? {catch {c1 SET x 1} errorMsg; set errorMsg} {::c1: unable to dispatch method 'SET'} -? {::next::core::dispatch c1 SET x 2} {2} "dispatch of protected methods works" +? {::nx::core::dispatch c1 SET x 2} {2} "dispatch of protected methods works" ? {c1 bar} {bar} "other method work" ? {catch {c1 foo} errorMsg; set errorMsg} {::c1: unable to dispatch method 'foo'} ? {c1 bar-SET} {1} "internal call of protected C implementend method" @@ -45,15 +45,15 @@ ? {catch {c2 bar-foo} errorMsg; set errorMsg} {::c1: unable to dispatch method 'foo'} # unset protected -? {::next::core::methodproperty C SET protected} 1 -::next::core::methodproperty C SET protected false -? {::next::core::methodproperty C SET protected} 0 -? {::next::core::methodproperty C foo protected} 1 -::next::core::methodproperty C foo protected false -? {::next::core::methodproperty C foo protected} 0 +? {::nx::core::methodproperty C SET protected} 1 +::nx::core::methodproperty C SET protected false +? {::nx::core::methodproperty C SET protected} 0 +? {::nx::core::methodproperty C foo protected} 1 +::nx::core::methodproperty C foo protected false +? {::nx::core::methodproperty C foo protected} 0 ? {c1 SET x 3} 3 -? {::next::core::dispatch c1 SET x 2} {2} +? {::nx::core::dispatch c1 SET x 2} {2} ? {c1 foo} {foo} ? {c1 bar} {bar} ? {c1 bar-SET} {1} @@ -63,28 +63,28 @@ # define a protected method C protected method foo {} {return [self proc]} -? {::next::core::methodproperty C SET protected} 0 +? {::nx::core::methodproperty C SET protected} 0 ? {c1 SET x 3} 3 -? {::next::core::dispatch c1 SET x 4} {4} +? {::nx::core::dispatch c1 SET x 4} {4} ? {catch {c1 foo} errorMsg; set errorMsg} {::c1: unable to dispatch method 'foo'} ? {c1 bar} {bar} ? {c1 bar-SET} {1} ? {c1 bar-foo} foo ? {c2 bar-SET} 1 ? {catch {c2 bar-foo} errorMsg; set errorMsg} {::c1: unable to dispatch method 'foo'} -? {::next::core::methodproperty C SET redefine-protected true} 1 +? {::nx::core::methodproperty C SET redefine-protected true} 1 ? {catch {C method SET {a b c} {...}} errorMsg; set errorMsg} \ {Method 'SET' of ::C can not be overwritten. Derive e.g. a sub-class!} -? {::next::core::methodproperty C foo redefine-protected true} 1 +? {::nx::core::methodproperty C foo redefine-protected true} 1 ? {catch {C method foo {a b c} {...}} errorMsg; set errorMsg} \ {Method 'foo' of ::C can not be overwritten. Derive e.g. a sub-class!} # check a predefined protection -? {catch {::next::Class method dealloc {a b c} {...}} errorMsg; set errorMsg} \ - {Method 'dealloc' of ::next::Class can not be overwritten. Derive e.g. a sub-class!} +? {catch {::nx::Class method dealloc {a b c} {...}} errorMsg; set errorMsg} \ + {Method 'dealloc' of ::nx::Class can not be overwritten. Derive e.g. a sub-class!} # try to redefined via alias -? {catch {::next::core::alias Class dealloc ::set} errorMsg; set errorMsg} \ - {Method 'dealloc' of ::next::Class can not be overwritten. Derive e.g. a sub-class!} +? {catch {::nx::core::alias Class dealloc ::set} errorMsg; set errorMsg} \ + {Method 'dealloc' of ::nx::Class can not be overwritten. Derive e.g. a sub-class!} # try to redefine via forward ? {catch {C forward SET ::set} errorMsg; set errorMsg} \ {Method 'SET' of ::C can not be overwritten. Derive e.g. a sub-class!} @@ -95,7 +95,7 @@ # overwrite-protect object specific method Object create o o method foo {} {return 13} -::next::core::methodproperty o foo redefine-protected true +::nx::core::methodproperty o foo redefine-protected true ? {catch {o method foo {} {return 14}} errorMsg; set errorMsg} \ {Method 'foo' of ::o can not be overwritten. Derive e.g. a sub-class!} Index: tests/slottest.xotcl =================================================================== diff -u -r81c800c8b9cb42ef6743d9b80ac2be5ca211a69a -r3f0573cc75724179f416942b974373e5a62ec05e --- tests/slottest.xotcl (.../slottest.xotcl) (revision 81c800c8b9cb42ef6743d9b80ac2be5ca211a69a) +++ tests/slottest.xotcl (.../slottest.xotcl) (revision 3f0573cc75724179f416942b974373e5a62ec05e) @@ -97,7 +97,7 @@ # "class" is not multivalued, therefore we should not add (or remove) add/delete # from the set of subcommands... -? {::next::RelationSlot class} "::next::MetaSlot" +? {::nx::RelationSlot class} "::nx::MetaSlot" O o1 ? {o1 class} "::O" o1 class Object @@ -111,7 +111,7 @@ #? {O2 superclass O} "superclass 1" ? {O superclass} "::xotcl::Object" -::next::ObjectParameterSlot method slot {object name property} { +::nx::ObjectParameterSlot method slot {object name property} { switch $property { self {return [self]} domain {return [my domain]} @@ -169,18 +169,18 @@ Object o1 o1 set i 0 -::next::core::alias o1 Incr -objscope ::incr +::nx::core::alias o1 Incr -objscope ::incr ? {o1 incr i} 1 "method incr" ? {o1 Incr i} 1002 "aliased tcl incr" ? {o1 incr i} 2003 "method incr" ? {o1 Incr i} 3004 "aliased tcl incr" -::next::core::alias ::xotcl::Object Set -objscope ::set +::nx::core::alias ::xotcl::Object Set -objscope ::set ? {o1 set i 1} 1 "method set" ? {o1 set i} 1 "method set" ? {o1 Set i 1} 1 "aliased tcl set" ? {o1 Set i} 1 "aliased tcl set" -::next::core::alias o1 Set -objscope ::set +::nx::core::alias o1 Set -objscope ::set ? {o1 Set i 1} 1 "aliased object tcl set" ? {o1 Set i} 1 "aliased object tcl set" ::xotcl::Object instforward SSet -earlybinding -objscope ::set @@ -191,15 +191,15 @@ o1 set z 100 #o1 forward z o1 [list %argclindex [list set set]] %proc #o1 proc get name {my set $name} -o1 forward get -earlybinding ::next::core::setvar %self %1 +o1 forward get -earlybinding ::nx::core::setvar %self %1 ? {o1 get z 101} 101 ? {o1 get z} "101" ? {o1 get z} 101 "get value via new parametercmd get" ? {o1 get z 124} 124 "set value via new parametercmd get" -o1 forward zz -earlybinding ::next::core::setvar %self %proc +o1 forward zz -earlybinding ::nx::core::setvar %self %proc ? {o1 zz 123} 123 ? {o1 zz} 123 @@ -251,7 +251,7 @@ # } # } -::xotcl::Attribute mixin delete ::next::Attribute::Optimizer +::xotcl::Attribute mixin delete ::nx::Attribute::Optimizer Class C1 -parameter {a {b 10} {c "Hello World"}} C1 c1 -a 1 @@ -277,7 +277,7 @@ ? {c2 a} 1 "new indirect parametercmd" ? {c2 a 1} 1 "new indirect parametercmd" -::xotcl::Attribute mixin add ::next::Attribute::Optimizer +::xotcl::Attribute mixin add ::nx::Attribute::Optimizer Class C3 -slots { Attribute create a @@ -319,7 +319,7 @@ ? {a0 procsearch f3} "::a0 proc f3" ? {a0 procsearch f4} "::a0 forward f4" ? {a0 procsearch set} "::xotcl::Object instcmd set" -? {A slot foo info callable -which assign} "::next::ObjectParameterSlot alias assign ::next::core::setvar" +? {A slot foo info callable -which assign} "::nx::ObjectParameterSlot alias assign ::nx::core::setvar" # redefine setter for foo of class A A slot foo method assign {domain var val} { @@ -362,7 +362,7 @@ #p1 projects add some-other-value #? {p1 projects} "some-other-value ::project1" -::next::ObjectParameterSlot method check { +::nx::ObjectParameterSlot method check { {-keep_old_value:boolean true} value predicate type obj var } { @@ -378,7 +378,7 @@ if {$keep_old_value} {$obj set __oldvalue($var) $value} } -::next::ObjectParameterSlot method checkall {values predicate type obj var} { +::nx::ObjectParameterSlot method checkall {values predicate type obj var} { foreach value $values { my check -keep_old_value false $value $predicate $type $obj $var } @@ -536,7 +536,7 @@ ? {o1 myf 100} 200 o1 set x 42 -o1 forward x -earlybinding ::next::core::setvar %self %proc +o1 forward x -earlybinding ::nx::core::setvar %self %proc ? [list o1 x] 42 ? [list o1 x 41] 41 ? {o1 x} "get parametercmd via forward (earlybinding)" @@ -559,7 +559,7 @@ ? {o1 myfdset y} "get instvar value via forward -earlybinding" ? {o1 myfdset y 123} "set instvar value via forward -earlybinding" -::next::core::alias o1 myset -objscope ::set +::nx::core::alias o1 myset -objscope ::set o1 myset x 101 ? {o1 myset x} 101 @@ -575,7 +575,7 @@ P create p2 -age 345 -s 567 ? {p2 age} "parametercmd read" -? {::next::core::setvar p2 age} "via setinstvar" +? {::nx::core::setvar p2 age} "via setinstvar" ? {p2 s} "parameter read with setter" Index: tests/speedtest.xotcl =================================================================== diff -u -r81c800c8b9cb42ef6743d9b80ac2be5ca211a69a -r3f0573cc75724179f416942b974373e5a62ec05e --- tests/speedtest.xotcl (.../speedtest.xotcl) (revision 81c800c8b9cb42ef6743d9b80ac2be5ca211a69a) +++ tests/speedtest.xotcl (.../speedtest.xotcl) (revision 3f0573cc75724179f416942b974373e5a62ec05e) @@ -253,14 +253,14 @@ # should be still the same number as above Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount -Test new -cmd {Object new -volatile} -expected ::next::core::__\#F9 -count 2000 \ - -post {foreach o [Object info instances ::next::core::__*] {$o destroy}} +Test new -cmd {Object new -volatile} -expected ::nx::core::__\#F9 -count 2000 \ + -post {foreach o [Object info instances ::nx::core::__*] {$o destroy}} # should be still the same number as above Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount -Test new -cmd {Object new} -expected ::next::core::__\#lQ -count 2000 \ - -post {foreach o [Object info instances ::next::core::__*] {$o destroy}} +Test new -cmd {Object new} -expected ::nx::core::__\#lQ -count 2000 \ + -post {foreach o [Object info instances ::nx::core::__*] {$o destroy}} # should be still the same number as above Test new -count 1 -cmd {llength [Object info instances]} -expected $ocount Index: tests/testx.xotcl =================================================================== diff -u -r81c800c8b9cb42ef6743d9b80ac2be5ca211a69a -r3f0573cc75724179f416942b974373e5a62ec05e --- tests/testx.xotcl (.../testx.xotcl) (revision 81c800c8b9cb42ef6743d9b80ac2be5ca211a69a) +++ tests/testx.xotcl (.../testx.xotcl) (revision 3f0573cc75724179f416942b974373e5a62ec05e) @@ -517,12 +517,12 @@ o m ::errorCheck [o set count] 2 "filter count" o filter "" - set filterstate [::next::core::configure filter off] + set filterstate [::nx::core::configure filter off] o set count 0 o m ::errorCheck [o set count]-$filterstate 0-1 "filter off + old state" o filter "" - ::next::core::configure filter on + ::nx::core::configure filter on set ::r "" Object instproc f args { Index: tests/varresolutiontest.xotcl =================================================================== diff -u -r81c800c8b9cb42ef6743d9b80ac2be5ca211a69a -r3f0573cc75724179f416942b974373e5a62ec05e --- tests/varresolutiontest.xotcl (.../varresolutiontest.xotcl) (revision 81c800c8b9cb42ef6743d9b80ac2be5ca211a69a) +++ tests/varresolutiontest.xotcl (.../varresolutiontest.xotcl) (revision 3f0573cc75724179f416942b974373e5a62ec05e) @@ -5,12 +5,12 @@ Test parameter count 1 -::next::core::alias ::next::Object objeval -objscope ::eval -::next::core::alias ::next::Object array -objscope ::array -::next::core::alias ::next::Object lappend -objscope ::lappend -::next::core::alias ::next::Object incr -objscope ::incr -::next::core::alias ::next::Object set -objscope ::set -::next::core::alias ::next::Object unset -objscope ::unset +::nx::core::alias ::nx::Object objeval -objscope ::eval +::nx::core::alias ::nx::Object array -objscope ::array +::nx::core::alias ::nx::Object lappend -objscope ::lappend +::nx::core::alias ::nx::Object incr -objscope ::incr +::nx::core::alias ::nx::Object set -objscope ::set +::nx::core::alias ::nx::Object unset -objscope ::unset ########################################### @@ -48,7 +48,7 @@ # vartables on the stack :requireNamespace global g - ::next::core::importvar o2 i + ::nx::core::importvar o2 i set x 1 set :y 2 set ::z 3 @@ -80,7 +80,7 @@ Object create o { :requireNamespace global g - ::next::core::importvar o2 i + ::nx::core::importvar o2 i set x 1 set :y 2 set ::z 3 @@ -121,7 +121,7 @@ ? {::o set x} 3 ? {namespace eval ::o {info exists x}} 1 ? {::o unset x} "" -? {::next::core::existsvar o x} 0 +? {::nx::core::existsvar o x} 0 ? {o exists x} 0 ? {info vars ::x} "" ? {namespace eval ::o {info exists x}} 0 @@ -352,13 +352,13 @@ array set ::tmpArray {key value} Class create ::C -::next::core::alias ::C Set -objscope ::set -::next::core::alias ::C Unset -objscope ::unset +::nx::core::alias ::C Set -objscope ::set +::nx::core::alias ::C Unset -objscope ::unset ::C create ::c namespace eval ::c {} ? {namespace exists ::c} 1 -? {::next::core::objectproperty ::c object} 1 +? {::nx::core::objectproperty ::c object} 1 ? {::c info hasnamespace} 0 ? {::c Set w 2; expr {[::c Set w] == $::w}} 0 @@ -380,9 +380,9 @@ # with a required namespace and without ################################################## Test case eval-variants -::next::core::alias ::next::Object objeval -objscope ::eval -::next::core::alias ::next::Object softeval -nonleaf ::eval -::next::core::alias ::next::Object softeval2 ::eval +::nx::core::alias ::nx::Object objeval -objscope ::eval +::nx::core::alias ::nx::Object softeval -nonleaf ::eval +::nx::core::alias ::nx::Object softeval2 ::eval set G 1 @@ -544,9 +544,9 @@ # Test with proc scopes ################################################## Test case proc-scopes -::next::core::alias ::next::Object objscoped-eval -objscope ::eval -::next::core::alias ::next::Object nonleaf-eval -nonleaf ::eval -::next::core::alias ::next::Object plain-eval ::eval +::nx::core::alias ::nx::Object objscoped-eval -objscope ::eval +::nx::core::alias ::nx::Object nonleaf-eval -nonleaf ::eval +::nx::core::alias ::nx::Object plain-eval ::eval proc foo-via-initcmd {} { foreach v {x xxx} {unset -nocomplain ::$v} @@ -642,10 +642,10 @@ Class create M2 C mixin M1 - ? {::next::core::relation C class-mixin} "::module::M1" + ? {::nx::core::relation C class-mixin} "::module::M1" C mixin add M2 - ? {::next::core::relation C class-mixin} "::module::M2 ::module::M1" + ? {::nx::core::relation C class-mixin} "::module::M2 ::module::M1" }