Index: TODO =================================================================== diff -u -re8715774bf274fbeadabf08a5a0777a968f71148 -r6166d76909482a0a4c1296cb959462d71c688922 --- TODO (.../TODO) (revision e8715774bf274fbeadabf08a5a0777a968f71148) +++ TODO (.../TODO) (revision 6166d76909482a0a4c1296cb959462d71c688922) @@ -110,7 +110,7 @@ - removed dependency on proc/instproc in copy/move. code is now independet of class system -- changed resultss of "filtersearch" and "self next" to new naming +- changed results of "filtersearch" and "self next" to new naming Caveat: for xotcl1, there is no mapping for the names to the old style in "self next" and "self filterreg" - backwards compatible mapping of filterseach in xotcl1 @@ -986,7 +986,10 @@ Generate xotcl documentation in this directory. - moved more (hopefully all) xotcl doc components into library/xotcl/doc +- added interp alias "nx::self" to "nx::core::current method" +- changed "current proc" into "current method" in scripts and tests + TODO: - nameing * self/current: @@ -995,7 +998,7 @@ are always next objects - replace "self proc" by "current method", etc. - we have "%self" as well, which is better than "%current" - - maybe provide alias "self" for "current object" + - maybe provide alias "self" for "current object" - DONE for now * .c-code: . rename source files from xotcl{Int}.{ch}->next*.* | next-scripting*.* ? @@ -1115,6 +1118,14 @@ - copy decls for objectMethod and classMethod as comments to xotcl.c, fix and check order +- don't namespace export nx::Attribute (since it is not user-visible + in most cases) but define instead + + interp alias {} ::xotcl::Attribute {} ::nx::Attribute + + However, if we do this, "::xotcl::Class create Role -superclass Attribute" will fail + => check symmetry between "interp alias" and "namespace import" for Objects + - should we extract parameter decls from pseudo-comments from the c source each time we change .decls, we have to change the c-code as well. /* *TCL* Index: doc/next-migration.html =================================================================== diff -u -r30173337f3b4d0d9c224713b2c86c622b26f3046 -r6166d76909482a0a4c1296cb959462d71c688922 --- doc/next-migration.html (.../next-migration.html) (revision 30173337f3b4d0d9c224713b2c86c622b26f3046) +++ doc/next-migration.html (.../next-migration.html) (revision 6166d76909482a0a4c1296cb959462d71c688922) @@ -1131,7 +1131,7 @@

Method Protection

-

Incompatibilities between Next Scripting/XOTcl 2.0 and XOTcl 1.*

+

Incompatibilities between XOTcl 2.0 and XOTcl 1.*

Resolvers

The resolvers of the Next Scripting Framework are used as well @@ -1161,7 +1161,6 @@ -

Exit Handlers

The exit hander interface changed from a method of @@ -1176,6 +1175,6 @@


- Last modified: Tue Aug 10 20:35:08 CEST 2010 + Last modified: Wed Aug 11 12:19:50 CEST 2010 Index: generic/predefined.h =================================================================== diff -u -r89b5047e54e47a88a7de75d8523a07ffa5743407 -r6166d76909482a0a4c1296cb959462d71c688922 --- generic/predefined.h (.../predefined.h) (revision 89b5047e54e47a88a7de75d8523a07ffa5743407) +++ generic/predefined.h (.../predefined.h) (revision 6166d76909482a0a4c1296cb959462d71c688922) @@ -80,7 +80,6 @@ ":protected method defaultmethod {} {::nx::core::current object}\n" ":protected method objectparameter {} {;}}\n" "::nx::core::forward Object forward ::nx::core::forward %self -per-object\n" -"set ::nx::core::signature(::nx::Object-method-forward) {(methodName) obj forward name ?-default default? ?-earlybinding? ?-methodprefix name? ?-objscope? ?-onerror proc? ?-verbose? target ?args?}\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" @@ -144,8 +143,7 @@ "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" +"::nx::core::unsetExitHandler}\n" "namespace eval ::nx {\n" "::nx::Class create ::nx::MetaSlot\n" "::nx::core::relation ::nx::MetaSlot superclass ::nx::Class\n" @@ -587,7 +585,8 @@ "Object create ::nx::var {\n" ":alias exists ::nx::core::existsvar\n" ":alias import ::nx::core::importvar\n" -":alias set ::nx::core::setvar}}\n" +":alias set ::nx::core::setvar}\n" +"interp alias {} ::nx::self {} ::nx::core::current object}\n" "namespace eval ::nx::core {\n" "proc tmpdir {} {\n" "foreach e [list TMPDIR TEMP TMP] {\n" @@ -602,7 +601,8 @@ "return /tmp}\n" "namespace export tmpdir}\n" "namespace eval ::nx {\n" -"namespace export Attribute current\n" +"namespace export Object Class next self current\n" +"namespace export Attribute\n" "if {![info exists ::env(HOME)]} {set ::env(HOME) /root}\n" "set ::nx::confdir ~/.xotcl\n" "set ::nx::logdir $::nx::confdir/log\n" Index: generic/predefined.tcl =================================================================== diff -u -r89b5047e54e47a88a7de75d8523a07ffa5743407 -r6166d76909482a0a4c1296cb959462d71c688922 --- generic/predefined.tcl (.../predefined.tcl) (revision 89b5047e54e47a88a7de75d8523a07ffa5743407) +++ generic/predefined.tcl (.../predefined.tcl) (revision 6166d76909482a0a4c1296cb959462d71c688922) @@ -247,7 +247,7 @@ # @param callee # @param args ::nx::core::forward Object forward ::nx::core::forward %self -per-object - set ::nx::core::signature(::nx::Object-method-forward) {(methodName) obj forward name ?-default default? ?-earlybinding? ?-methodprefix name? ?-objscope? ?-onerror proc? ?-verbose? target ?args?} + #set ::nx::core::signature(::nx::Object-method-forward) {(methodName) obj forward name ?-default default? ?-earlybinding? ?-methodprefix name? ?-objscope? ?-onerror proc? ?-verbose? target ?args?} # @method ::nx::Class#forward # @@ -421,7 +421,6 @@ # initialize exit handler ::nx::core::unsetExitHandler - namespace export Object Class next self } @@ -1399,6 +1398,8 @@ :alias import ::nx::core::importvar :alias set ::nx::core::setvar } + + interp alias {} ::nx::self {} ::nx::core::current object } @@ -1432,8 +1433,11 @@ namespace eval ::nx { # export the contents for all xotcl versions - namespace export Attribute current + namespace export Object Class next self current + # TODO should not be necessary in the future + namespace export Attribute + # if HOME is not set, and ~ is resolved, Tcl chokes on that if {![info exists ::env(HOME)]} {set ::env(HOME) /root} Index: library/lib/doc-tools.tcl =================================================================== diff -u -r89b5047e54e47a88a7de75d8523a07ffa5743407 -r6166d76909482a0a4c1296cb959462d71c688922 --- library/lib/doc-tools.tcl (.../doc-tools.tcl) (revision 89b5047e54e47a88a7de75d8523a07ffa5743407) +++ library/lib/doc-tools.tcl (.../doc-tools.tcl) (revision 6166d76909482a0a4c1296cb959462d71c688922) @@ -798,7 +798,7 @@ return $rendered } :method ?var {varname args} { - uplevel 1 [list :? -ops [list [::nx::core::current proc] -] \ + uplevel 1 [list :? -ops [list [::nx::core::current method] -] \ "\[info exists $varname\]" {*}$args] } :method ? { @@ -1051,7 +1051,7 @@ ::nx::Object create doc { :method log {msg} { - puts stderr "[current]->[uplevel 1 [list ::nx::core::current proc]]: $msg" + puts stderr "[current]->[uplevel 1 [list ::nx::core::current method]]: $msg" } # @method process Index: library/xotcl/library/xotcl2.tcl =================================================================== diff -u -r89b5047e54e47a88a7de75d8523a07ffa5743407 -r6166d76909482a0a4c1296cb959462d71c688922 --- library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision 89b5047e54e47a88a7de75d8523a07ffa5743407) +++ library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision 6166d76909482a0a4c1296cb959462d71c688922) @@ -819,6 +819,9 @@ set ::xotcl::logdir $::xotcl::confdir/log namespace import ::nx::core::tmpdir + # if we do this, "::xotcl::Class create Role -superclass Attribute" will fail. + #interp alias {} ::xotcl::Attribute {} ::nx::Attribute + # finally, export contents defined for XOTcl namespace export Object Class Attribute myproc myvar my self next @ } Index: tests/aliastest.tcl =================================================================== diff -u -r89b5047e54e47a88a7de75d8523a07ffa5743407 -r6166d76909482a0a4c1296cb959462d71c688922 --- tests/aliastest.tcl (.../aliastest.tcl) (revision 89b5047e54e47a88a7de75d8523a07ffa5743407) +++ tests/aliastest.tcl (.../aliastest.tcl) (revision 6166d76909482a0a4c1296cb959462d71c688922) @@ -62,7 +62,7 @@ S create s - T method foo args { return [current class]->[current proc] } + T method foo args { return [current class]->[current method] } ::nx::core::alias T FOO ::nx::core::classes::T::foo ? {t foo} ::T->foo @@ -73,7 +73,7 @@ ? {lsort [T info methods]} {} "alias is deleted" # puts stderr "double indirection" - T method foo args { return [current class]->[current proc] } + T method foo args { return [current class]->[current method] } ::nx::core::alias T FOO ::nx::core::classes::T::foo ::nx::core::alias S BAR ::nx::core::classes::T::FOO @@ -93,7 +93,7 @@ ? {T info methods} {} ? {S info methods} {} - T method foo args { return [current class]->[current proc] } + T method foo args { return [current class]->[current method] } ::nx::core::alias T FOO ::nx::core::classes::T::foo ::nx::core::alias S BAR ::nx::core::classes::T::FOO @@ -103,8 +103,8 @@ ? {S info methods} {} ? {T info methods} {} - T method foo args { return [current class]->[current proc] } - T object method bar args { return [current class]->[current proc] } + T method foo args { return [current class]->[current method] } + T object method bar args { return [current class]->[current method] } ::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 @@ -140,15 +140,15 @@ Test case alias-per-object { Class create T { - :object method bar args { return [current class]->[current proc] } + :object method bar args { return [current class]->[current method] } :create t } - proc ::foo args { return [current class]->[current proc] } + proc ::foo args { return [current class]->[current method] } # # per-object methods as per-object aliases # - T object method m1 args { return [current class]->[current proc] } + T object method m1 args { return [current class]->[current method] } ::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} @@ -166,7 +166,7 @@ # a proc as alias # - proc foo args { return [current class]->[current proc] } + proc foo args { return [current class]->[current method] } ::nx::core::alias T FOO1 ::foo ::nx::core::alias T -per-object FOO2 ::foo # @@ -190,12 +190,12 @@ # namespaced procs + namespace deletion Test case alias-namespaced { Class create T { - :object method bar args { return [current class]->[current proc] } + :object method bar args { return [current class]->[current method] } :create t } namespace eval ::ns1 { - proc foo args { return [current class]->[current proc] } + proc foo args { return [current class]->[current method] } proc bar args { return [uplevel 2 {set _}] } proc bar2 args { upvar 2 _ __; return $__} } @@ -217,12 +217,12 @@ Class create U U create u ? {namespace exists ::U} 0 - U object method zap args { return [current class]->[current proc] } + U object method zap args { return [current class]->[current method] } ::nx::core::alias ::U -per-object ZAP ::U::zap U requireNamespace ? {namespace exists ::U} 1 - U object method bar args { return [current class]->[current proc] } + U object method bar args { return [current class]->[current method] } ::nx::core::alias U -per-object BAR ::U::bar ? {lsort [U object info methods]} {BAR ZAP bar zap} ? {U BAR} ->bar @@ -369,7 +369,7 @@ # C create c -proc ::foo args { return [current]->[current proc]} +proc ::foo args { return [current]->[current method]} ? {info exists ::nx::core::alias(::C,FOO,0)} 0 ::nx::core::alias C FOO ::foo ? {info exists ::nx::core::alias(::C,FOO,0)} 1 Index: tests/forwardtest.tcl =================================================================== diff -u -r89b5047e54e47a88a7de75d8523a07ffa5743407 -r6166d76909482a0a4c1296cb959462d71c688922 --- tests/forwardtest.tcl (.../forwardtest.tcl) (revision 89b5047e54e47a88a7de75d8523a07ffa5743407) +++ tests/forwardtest.tcl (.../forwardtest.tcl) (revision 6166d76909482a0a4c1296cb959462d71c688922) @@ -162,7 +162,7 @@ package require nx::serializer Test case serializer { Object create obj { - :method test {} {puts "i am [current proc]"} + :method test {} {puts "i am [current method]"} } set ::a [Serializer deepSerialize obj] #puts <<$::a>> @@ -261,9 +261,9 @@ Test case num-args { Object create obj { :forward f %self [list %argclindex [list a b c]] - :method a args {return [list [current proc] $args]} - :method b args {return [list [current proc] $args]} - :method c args {return [list [current proc] $args]} + :method a args {return [list [current method] $args]} + :method b args {return [list [current method] $args]} + :method c args {return [list [current method] $args]} } ? {obj f} [list a {}] ? {obj f 1 } [list b 1] Index: tests/method-modifiers.tcl =================================================================== diff -u -r89b5047e54e47a88a7de75d8523a07ffa5743407 -r6166d76909482a0a4c1296cb959462d71c688922 --- tests/method-modifiers.tcl (.../method-modifiers.tcl) (revision 89b5047e54e47a88a7de75d8523a07ffa5743407) +++ tests/method-modifiers.tcl (.../method-modifiers.tcl) (revision 6166d76909482a0a4c1296cb959462d71c688922) @@ -5,9 +5,9 @@ Class create C { # methods - :method plain_method {} {return [current proc]} - :public method public_method {} {return [current proc]} - :protected method protected_method {} {return [current proc]} + :method plain_method {} {return [current method]} + :public method public_method {} {return [current method]} + :protected method protected_method {} {return [current method]} # forwards :forward plain_forward %self plain_method @@ -25,9 +25,9 @@ :protected alias protected_alias [C info method name protected_method] # object - :object method plain_object_method {} {return [current proc]} - :public object method public_object_method {} {return [current proc]} - :protected object method protected_object_method {} {return [current proc]} + :object method plain_object_method {} {return [current method]} + :public object method public_object_method {} {return [current method]} + :protected object method protected_object_method {} {return [current method]} :object forward plain_object_forward %self plain_object_method :public object forward public_object_forward %self public_object_method :protected object forward protected_object_forward %self protected_object_method @@ -40,9 +40,9 @@ } C create c1 { # methods - :method plain_object_method {} {return [current proc]} - :public method public_object_method {} {return [current proc]} - :protected method protected_object_method {} {return [current proc]} + :method plain_object_method {} {return [current method]} + :public method public_object_method {} {return [current method]} + :protected method protected_object_method {} {return [current method]} # forwards :forward plain_object_forward %self plain_object_method @@ -92,7 +92,7 @@ ? {::nx::core::dispatch c2 protected_setter 4} "4" } -# class level alias ....TODO: wanted behavior of [current proc]? not "plain_alias"? +# class level alias ....TODO: wanted behavior of [current method]? not "plain_alias"? Test case class-level-alias { ? {c2 plain_alias} "plain_method" ? {c2 public_alias} "public_method" @@ -126,7 +126,7 @@ ? {::nx::core::dispatch C protected_object_setter 4} "4" } -# class-object level alias ....TODO: wanted behavior of [current proc]? not "plain_alias"? +# class-object level alias ....TODO: wanted behavior of [current method]? not "plain_alias"? Test case class-object-level-alias { ? {C plain_object_alias} "plain_object_method" ? {C public_object_alias} "public_object_method" @@ -159,7 +159,7 @@ ? {catch {c1 protected_object_setter 3}} 1 ? {::nx::core::dispatch c1 protected_object_setter 4} "4" -# object level alias ....TODO: wanted behavior of [current proc]? not "plain_alias"? +# object level alias ....TODO: wanted behavior of [current method]? not "plain_alias"? Test case object-level-alias { ? {c1 plain_object_alias} "plain_object_method" ? {c1 public_object_alias} "public_object_method" Index: tests/parameters.tcl =================================================================== diff -u -r89b5047e54e47a88a7de75d8523a07ffa5743407 -r6166d76909482a0a4c1296cb959462d71c688922 --- tests/parameters.tcl (.../parameters.tcl) (revision 89b5047e54e47a88a7de75d8523a07ffa5743407) +++ tests/parameters.tcl (.../parameters.tcl) (revision 6166d76909482a0a4c1296cb959462d71c688922) @@ -443,7 +443,7 @@ D method foo {a b {-c 1} {-d} x {-end 100}} { set result [list] - foreach v [[current class] info method args [current proc]] { + foreach v [[current class] info method args [current method]] { lappend result $v [info exists $v] } return $result @@ -454,7 +454,7 @@ D method foo {a b c {end 100}} { set result [list] - foreach v [[current class] info method args [current proc]] { + foreach v [[current class] info method args [current method]] { lappend result $v [info exists $v] } return $result @@ -901,7 +901,7 @@ Test case slot-specfic-converter { Class create Person Person slots { - Attribute create sex -type "sex" { + ::nx::Attribute create sex -type "sex" { :method type=sex {name value} { #puts stderr "[current] slot specific converter" switch -glob $value { Index: tests/protected.tcl =================================================================== diff -u -r89b5047e54e47a88a7de75d8523a07ffa5743407 -r6166d76909482a0a4c1296cb959462d71c688922 --- tests/protected.tcl (.../protected.tcl) (revision 89b5047e54e47a88a7de75d8523a07ffa5743407) +++ tests/protected.tcl (.../protected.tcl) (revision 6166d76909482a0a4c1296cb959462d71c688922) @@ -6,8 +6,8 @@ Class create C { :alias SET ::set - :method foo {} {return [current proc]} - :method bar {} {return [current proc]} + :method foo {} {return [current method]} + :method bar {} {return [current method]} :method bar-foo {} { c1 foo } @@ -62,7 +62,7 @@ ? {c2 bar-foo} {foo} # define a protected method -C protected method foo {} {return [current proc]} +C protected method foo {} {return [current method]} ? {::nx::core::methodproperty C SET protected} 0 ? {c1 SET x 3} 3 ? {::nx::core::dispatch c1 SET x 4} {4}