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]}]" #}