Index: TODO =================================================================== diff -u -r42921ea037c4334cb6ecc565978330f9d8e902ec -re2f11549ef70518cca8c9c49b1d78f4383b00a87 --- TODO (.../TODO) (revision 42921ea037c4334cb6ecc565978330f9d8e902ec) +++ TODO (.../TODO) (revision e2f11549ef70518cca8c9c49b1d78f4383b00a87) @@ -1517,6 +1517,9 @@ - renamed ::nsf::cmd::ObjectInfo into ::nsf::methods::object::info - renamed ::nsf::cmd::ClassInfo into ::nsf::methods::class::info +- renamed ::nsf::cmd::Object into ::nsf::methods::object +- renamed ::nsf::cmd::Class into ::nsf::methods::class + TODO: - extend coro regression test - remove traces of xowish. remove tclAppInt? Index: doc/next-migration.html =================================================================== diff -u -r8ee718fe7e27c3df71bc659f3261710a4aaf5805 -re2f11549ef70518cca8c9c49b1d78f4383b00a87 --- doc/next-migration.html (.../next-migration.html) (revision 8ee718fe7e27c3df71bc659f3261710a4aaf5805) +++ doc/next-migration.html (.../next-migration.html) (revision e2f11549ef70518cca8c9c49b1d78f4383b00a87) @@ -1438,17 +1438,14 @@

Exit Handlers

The exit hander interface changed from a method of -::xotcl::Object into three Tcl procs in the ::nsf -namespace. Next provides now: +::xotcl::Object into the tcl command ::nsf::exithandler:

-   ::nsf::setExitHandler script
-   ::nsf::getExitHandler
-   ::nsf::unsetExitHandler
+   ::nsf::exithandler set|get|unset ?arg?
 

- Last modified: Fri Sep 24 17:34:10 CEST 2010 + Last modified: Sun Sep 26 14:16:38 CEST 2010 Index: generic/gentclAPI.decls =================================================================== diff -u -r42921ea037c4334cb6ecc565978330f9d8e902ec -re2f11549ef70518cca8c9c49b1d78f4383b00a87 --- generic/gentclAPI.decls (.../gentclAPI.decls) (revision 42921ea037c4334cb6ecc565978330f9d8e902ec) +++ generic/gentclAPI.decls (.../gentclAPI.decls) (revision e2f11549ef70518cca8c9c49b1d78f4383b00a87) @@ -7,9 +7,9 @@ # namespaces for types of methods array set ns { nsfCmd "::nsf" - objectMethod "::nsf::cmd::Object" + objectMethod "::nsf::methods::object" objectInfoMethod "::nsf::methods::object::info" - classMethod "::nsf::cmd::Class" + classMethod "::nsf::methods::class" classInfoMethod "::nsf::methods::class::info" checkMethod "::nsf::cmd::ParameterType" } Index: generic/predefined.h =================================================================== diff -u -r6a0e62b53f8b405d11f009e3c0acb2098702d921 -re2f11549ef70518cca8c9c49b1d78f4383b00a87 --- generic/predefined.h (.../predefined.h) (revision 6a0e62b53f8b405d11f009e3c0acb2098702d921) +++ generic/predefined.h (.../predefined.h) (revision e2f11549ef70518cca8c9c49b1d78f4383b00a87) @@ -22,18 +22,21 @@ "set rel \"mixin\"}\n" "set oldSetting [::nsf::relation $object $rel]\n" "uplevel [list ::nsf::relation $object $rel [linsert $oldSetting end $args]]}\n" -"::nsf::provide_method autoname {::nsf::alias autoname ::nsf::cmd::Object::autoname}\n" -"::nsf::provide_method exists {::nsf::alias exists ::nsf::cmd::Object::exists}\n" +"::nsf::provide_method autoname {::nsf::alias autoname ::nsf::methods::object::autoname}\n" +"::nsf::provide_method exists {::nsf::alias exists ::nsf::methods::object::exists}\n" "proc ::nsf::infoError msg {\n" "regsub -all \" \" $msg \"\" msg\n" "regsub -all \" \" $msg \"\" msg\n" "regsub {\\\"} $msg \"\\\"info \" msg\n" "error $msg \"\"}\n" -"proc ::nsf::unsetExitHandler {} {\n" -"proc ::nsf::__exitHandler {} {}}\n" -"proc ::nsf::setExitHandler {newbody} {::proc ::nsf::__exitHandler {} $newbody}\n" -"proc ::nsf::getExitHandler {} {::info body ::nsf::__exitHandler}\n" -"::nsf::unsetExitHandler\n" +"proc ::nsf::exithandler {args} {\n" +"lassign $args up value\n" +"switch {$op} {\n" +"set {::proc ::nsf::__exithandler {} $value}\n" +"get {::info body ::nsf::__exithandler}\n" +"unset {::proc ::nsf::__exithandler {} {;}}\n" +"default {puts \"syntax: ::nsf::exithandler set|get|unset ?arg?\"}}}\n" +"::nsf::exithandler unset\n" "proc tmpdir {} {\n" "foreach e [list TMPDIR TEMP TMP] {\n" "if {[info exists ::env($e)] \\\n" Index: generic/predefined.tcl =================================================================== diff -u -r25f4f3c883ff0021b8564377f6658afb69c346c8 -re2f11549ef70518cca8c9c49b1d78f4383b00a87 --- generic/predefined.tcl (.../predefined.tcl) (revision 25f4f3c883ff0021b8564377f6658afb69c346c8) +++ generic/predefined.tcl (.../predefined.tcl) (revision e2f11549ef70518cca8c9c49b1d78f4383b00a87) @@ -58,8 +58,8 @@ # # provide some popular methods for "method require" # - ::nsf::provide_method autoname {::nsf::alias autoname ::nsf::cmd::Object::autoname} - ::nsf::provide_method exists {::nsf::alias exists ::nsf::cmd::Object::exists} + ::nsf::provide_method autoname {::nsf::alias autoname ::nsf::methods::object::autoname} + ::nsf::provide_method exists {::nsf::alias exists ::nsf::methods::object::exists} # # error handler for info @@ -75,15 +75,17 @@ # # exit handlers # - proc ::nsf::unsetExitHandler {} { - proc ::nsf::__exitHandler {} { - # clients should append exit handlers to this proc body + proc ::nsf::exithandler {args} { + lassign $args up value + switch {$op} { + set {::proc ::nsf::__exithandler {} $value} + get {::info body ::nsf::__exithandler} + unset {::proc ::nsf::__exithandler {} {;}} + default {puts "syntax: ::nsf::exithandler set|get|unset ?arg?"} } } - proc ::nsf::setExitHandler {newbody} {::proc ::nsf::__exitHandler {} $newbody} - proc ::nsf::getExitHandler {} {::info body ::nsf::__exitHandler} # initialize exit handler - ::nsf::unsetExitHandler + ::nsf::exithandler unset # # determine platform aware temp directory Index: generic/tclAPI.h =================================================================== diff -u -r42921ea037c4334cb6ecc565978330f9d8e902ec -re2f11549ef70518cca8c9c49b1d78f4383b00a87 --- generic/tclAPI.h (.../tclAPI.h) (revision 42921ea037c4334cb6ecc565978330f9d8e902ec) +++ generic/tclAPI.h (.../tclAPI.h) (revision e2f11549ef70518cca8c9c49b1d78f4383b00a87) @@ -141,10 +141,10 @@ static CONST char *method_command_namespace_names[] = { "::nsf::methods::object::info", - "::nsf::cmd::Object", + "::nsf::methods::object", "::nsf::cmd::ParameterType", "::nsf::methods::class::info", - "::nsf::cmd::Class" + "::nsf::methods::class" }; static int NsfCAllocMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfCCreateMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); @@ -2029,29 +2029,29 @@ } static methodDefinition method_definitions[] = { -{"::nsf::cmd::Class::alloc", NsfCAllocMethodStub, 1, { +{"::nsf::methods::class::alloc", NsfCAllocMethodStub, 1, { {"name", 1, 0, ConvertToTclobj}} }, -{"::nsf::cmd::Class::create", NsfCCreateMethodStub, 2, { +{"::nsf::methods::class::create", NsfCCreateMethodStub, 2, { {"name", 1, 0, ConvertToString}, {"args", 0, 0, ConvertToNothing}} }, -{"::nsf::cmd::Class::dealloc", NsfCDeallocMethodStub, 1, { +{"::nsf::methods::class::dealloc", NsfCDeallocMethodStub, 1, { {"object", 1, 0, ConvertToTclobj}} }, -{"::nsf::cmd::Class::filterguard", NsfCFilterGuardMethodStub, 2, { +{"::nsf::methods::class::filterguard", NsfCFilterGuardMethodStub, 2, { {"filter", 1, 0, ConvertToString}, {"guard", 1, 0, ConvertToTclobj}} }, -{"::nsf::cmd::Class::mixinguard", NsfCMixinGuardMethodStub, 2, { +{"::nsf::methods::class::mixinguard", NsfCMixinGuardMethodStub, 2, { {"mixin", 1, 0, ConvertToString}, {"guard", 1, 0, ConvertToTclobj}} }, -{"::nsf::cmd::Class::new", NsfCNewMethodStub, 2, { +{"::nsf::methods::class::new", NsfCNewMethodStub, 2, { {"-childof", 0, 1, ConvertToObject}, {"args", 0, 0, ConvertToNothing}} }, -{"::nsf::cmd::Class::recreate", NsfCRecreateMethodStub, 2, { +{"::nsf::methods::class::recreate", NsfCRecreateMethodStub, 2, { {"name", 1, 0, ConvertToTclobj}, {"args", 0, 0, ConvertToNothing}} }, @@ -2241,53 +2241,53 @@ {"::nsf::__db_show_stack", NsfShowStackCmdStub, 0, { } }, -{"::nsf::cmd::Object::autoname", NsfOAutonameMethodStub, 3, { +{"::nsf::methods::object::autoname", NsfOAutonameMethodStub, 3, { {"-instance", 0, 0, ConvertToString}, {"-reset", 0, 0, ConvertToString}, {"name", 1, 0, ConvertToTclobj}} }, -{"::nsf::cmd::Object::cleanup", NsfOCleanupMethodStub, 0, { +{"::nsf::methods::object::cleanup", NsfOCleanupMethodStub, 0, { } }, -{"::nsf::cmd::Object::configure", NsfOConfigureMethodStub, 1, { +{"::nsf::methods::object::configure", NsfOConfigureMethodStub, 1, { {"args", 0, 0, ConvertToNothing}} }, -{"::nsf::cmd::Object::destroy", NsfODestroyMethodStub, 0, { +{"::nsf::methods::object::destroy", NsfODestroyMethodStub, 0, { } }, -{"::nsf::cmd::Object::exists", NsfOExistsMethodStub, 1, { +{"::nsf::methods::object::exists", NsfOExistsMethodStub, 1, { {"var", 1, 0, ConvertToString}} }, -{"::nsf::cmd::Object::filterguard", NsfOFilterGuardMethodStub, 2, { +{"::nsf::methods::object::filterguard", NsfOFilterGuardMethodStub, 2, { {"filter", 1, 0, ConvertToString}, {"guard", 1, 0, ConvertToTclobj}} }, -{"::nsf::cmd::Object::instvar", NsfOInstVarMethodStub, 1, { +{"::nsf::methods::object::instvar", NsfOInstVarMethodStub, 1, { {"args", 0, 0, ConvertToNothing}} }, -{"::nsf::cmd::Object::mixinguard", NsfOMixinGuardMethodStub, 2, { +{"::nsf::methods::object::mixinguard", NsfOMixinGuardMethodStub, 2, { {"mixin", 1, 0, ConvertToString}, {"guard", 1, 0, ConvertToTclobj}} }, -{"::nsf::cmd::Object::noinit", NsfONoinitMethodStub, 0, { +{"::nsf::methods::object::noinit", NsfONoinitMethodStub, 0, { } }, -{"::nsf::cmd::Object::require_namespace", NsfORequireNamespaceMethodStub, 0, { +{"::nsf::methods::object::require_namespace", NsfORequireNamespaceMethodStub, 0, { } }, -{"::nsf::cmd::Object::residualargs", NsfOResidualargsMethodStub, 1, { +{"::nsf::methods::object::residualargs", NsfOResidualargsMethodStub, 1, { {"args", 0, 0, ConvertToNothing}} }, -{"::nsf::cmd::Object::uplevel", NsfOUplevelMethodStub, 1, { +{"::nsf::methods::object::uplevel", NsfOUplevelMethodStub, 1, { {"args", 0, 0, ConvertToNothing}} }, -{"::nsf::cmd::Object::upvar", NsfOUpvarMethodStub, 1, { +{"::nsf::methods::object::upvar", NsfOUpvarMethodStub, 1, { {"args", 0, 0, ConvertToNothing}} }, -{"::nsf::cmd::Object::volatile", NsfOVolatileMethodStub, 0, { +{"::nsf::methods::object::volatile", NsfOVolatileMethodStub, 0, { } }, -{"::nsf::cmd::Object::vwait", NsfOVwaitMethodStub, 1, { +{"::nsf::methods::object::vwait", NsfOVwaitMethodStub, 1, { {"varname", 1, 0, ConvertToString}} }, {"::nsf::methods::object::info::children", NsfObjInfoChildrenMethodStub, 2, { Index: library/nx/nx.tcl =================================================================== diff -u -r42921ea037c4334cb6ecc565978330f9d8e902ec -re2f11549ef70518cca8c9c49b1d78f4383b00a87 --- library/nx/nx.tcl (.../nx.tcl) (revision 42921ea037c4334cb6ecc565978330f9d8e902ec) +++ library/nx/nx.tcl (.../nx.tcl) (revision e2f11549ef70518cca8c9c49b1d78f4383b00a87) @@ -37,7 +37,7 @@ # # provide the standard command set for ::nx::Object # - foreach cmd [info command ::nsf::cmd::Object::*] { + foreach cmd [info command ::nsf::methods::object::*] { set cmdName [namespace tail $cmd] if {$cmdName in [list "autoname" "exists" "filterguard" "instvar" "mixinguard" "require_namespace"]} continue ::nsf::alias Object $cmdName $cmd @@ -51,7 +51,7 @@ # # provide the standard command set for Class - foreach cmd [info command ::nsf::cmd::Class::*] { + foreach cmd [info command ::nsf::methods::class::*] { set cmdName [namespace tail $cmd] if {$cmdName in [list "filterguard" "mixinguard"]} continue ::nsf::alias Class $cmdName $cmd @@ -205,7 +205,7 @@ } } if {$what in [list "filterguard" "mixinguard"]} { - return [::nsf::dispatch [::nsf::current object] ::nsf::cmd::Object::$what {*}$args] + return [::nsf::dispatch [::nsf::current object] ::nsf::methods::object::$what {*}$args] } } # define unknown handler for class @@ -324,7 +324,7 @@ ::nsf::require_method [::nsf::current object] [lindex $args 0] 0 } namespace { - ::nsf::dispatch [::nsf::current object] ::nsf::cmd::Object::require_namespace + ::nsf::dispatch [::nsf::current object] ::nsf::methods::object::require_namespace } } } @@ -1015,28 +1015,28 @@ # ${os}::Object::slot::filter method guard {obj prop filter guard:optional} { if {[info exists guard]} { - ::nsf::dispatch $obj ::nsf::cmd::Object::filterguard $filter $guard + ::nsf::dispatch $obj ::nsf::methods::object::filterguard $filter $guard } else { $obj info filter guard $filter } } ${os}::Class::slot::filter method guard {obj prop filter guard:optional} { if {[info exists guard]} { - ::nsf::dispatch $obj ::nsf::cmd::Class::filterguard $filter $guard + ::nsf::dispatch $obj ::nsf::methods::class::filterguard $filter $guard } else { $obj info filter guard $filter } } ${os}::Object::slot::mixin method guard {obj prop filter guard:optional} { if {[info exists guard]} { - ::nsf::dispatch $obj ::nsf::cmd::Object::mixinguard $filter $guard + ::nsf::dispatch $obj ::nsf::methods::object::mixinguard $filter $guard } else { $obj info mixin guard $filter } } ${os}::Class::slot::mixin method guard {obj prop filter guard:optional} { if {[info exists guard]} { - ::nsf::dispatch $obj ::nsf::cmd::Class::mixinguard $filter $guard + ::nsf::dispatch $obj ::nsf::methods::class::mixinguard $filter $guard } else { $obj info mixin guard $filter } @@ -1280,7 +1280,7 @@ if {![info exists object]} {set object [::nsf::current object]} if {![::nsf::isobject $object]} {$class create $object} # reused in XOTcl, no "require" there, so use nsf primitiva - ::nsf::dispatch $object ::nsf::cmd::Object::require_namespace + ::nsf::dispatch $object ::nsf::methods::object::require_namespace if {$withnew} { set m [ScopedNew new -volatile \ -container $object -withclass $class] @@ -1376,7 +1376,7 @@ ::nsf::relation $obj object-mixin [::nsf::relation $origin object-mixin] # reused in XOTcl, no "require" there, so use nsf primitiva if {[::nsf::dispatch $origin ::nsf::methods::object::info::hasnamespace]} { - ::nsf::dispatch $obj ::nsf::cmd::Object::require_namespace + ::nsf::dispatch $obj ::nsf::methods::object::require_namespace } } else { namespace eval $dest {} Index: library/tcl-cool/tcl-cool.tcl =================================================================== diff -u -r42921ea037c4334cb6ecc565978330f9d8e902ec -re2f11549ef70518cca8c9c49b1d78f4383b00a87 --- library/tcl-cool/tcl-cool.tcl (.../tcl-cool.tcl) (revision 42921ea037c4334cb6ecc565978330f9d8e902ec) +++ library/tcl-cool/tcl-cool.tcl (.../tcl-cool.tcl) (revision e2f11549ef70518cca8c9c49b1d78f4383b00a87) @@ -104,7 +104,7 @@ # - "forward" is a method for delegating calls to different objects # - "methods" is an introspection method for showing the methods of an object # - ::nsf::alias object variable ::nsf::cmd::Object::instvar + ::nsf::alias object variable ::nsf::methods::object::instvar ::nsf::forward object forward ::nsf::forward %self -per-object ::nsf::alias object methods ::nsf::methods::object::info::lookupmethods @@ -113,7 +113,7 @@ # is created. First the object is allocated, then the constructor is called. # class method create {name args} { - set obj [::nsf::dispatch [self] ::nsf::cmd::Class::alloc $name] + set obj [::nsf::dispatch [self] ::nsf::methods::class::alloc $name] $obj init {*}$args return $obj } Index: library/xotcl/library/xotcl2.tcl =================================================================== diff -u -r42921ea037c4334cb6ecc565978330f9d8e902ec -re2f11549ef70518cca8c9c49b1d78f4383b00a87 --- library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision 42921ea037c4334cb6ecc565978330f9d8e902ec) +++ library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision e2f11549ef70518cca8c9c49b1d78f4383b00a87) @@ -69,7 +69,7 @@ # objects. It is the root object-class in the XOTcl 2 object system. # provide the standard command set for ::xotcl::Object - foreach cmd [info command ::nsf::cmd::Object::*] { + foreach cmd [info command ::nsf::methods::object::*] { set cmdName [namespace tail $cmd] if {$cmdName in [list "setter" "require_namespace"]} continue ::nsf::alias Object $cmdName $cmd @@ -208,7 +208,7 @@ } # provide the standard command set for ::xotcl::Class - foreach cmd [info command ::nsf::cmd::Class::*] { + foreach cmd [info command ::nsf::methods::class::*] { set cmdName [namespace tail $cmd] if {$cmdName in [list "setter"]} continue ::nsf::alias Class $cmdName $cmd @@ -228,13 +228,13 @@ ::nsf::alias Object parametercmd ::nsf::classes::nx::Object::setter ::nsf::alias Class instparametercmd ::nsf::classes::nx::Class::setter - ::nsf::alias Object filterguard ::nsf::cmd::Object::filterguard - ::nsf::alias Class instfilterguard ::nsf::cmd::Class::filterguard + ::nsf::alias Object filterguard ::nsf::methods::object::filterguard + ::nsf::alias Class instfilterguard ::nsf::methods::class::filterguard - ::nsf::alias Object mixinguard ::nsf::cmd::Object::mixinguard - ::nsf::alias Class instmixinguard ::nsf::cmd::Class::mixinguard + ::nsf::alias Object mixinguard ::nsf::methods::object::mixinguard + ::nsf::alias Class instmixinguard ::nsf::methods::class::mixinguard - ::nsf::alias Object requireNamespace ::nsf::cmd::Object::require_namespace + ::nsf::alias Object requireNamespace ::nsf::methods::object::require_namespace # define instproc and proc ::nsf::method Class instproc { Index: tests/method-require.tcl =================================================================== diff -u -r29ea21bd3f28ea7effaca6039e59a8a3499f8fd8 -re2f11549ef70518cca8c9c49b1d78f4383b00a87 --- tests/method-require.tcl (.../method-require.tcl) (revision 29ea21bd3f28ea7effaca6039e59a8a3499f8fd8) +++ tests/method-require.tcl (.../method-require.tcl) (revision e2f11549ef70518cca8c9c49b1d78f4383b00a87) @@ -16,7 +16,7 @@ nsf::provide_method lappend {::nsf::alias lappend -objscope ::lappend} nsf::provide_method set {::nsf::alias set -objscope ::set} nsf::provide_method tcl::set {::nsf::alias set -objscope ::set} - nsf::provide_method exists {::nsf::alias exists ::nsf::cmd::Object::exists} + nsf::provide_method exists {::nsf::alias exists ::nsf::methods::object::exists} nsf::provide_method foo {::nsf::method foo {x y} {return x=$x,y=$y}} nsf::provide_method x {::nsf::mixin ::MIX} { # here could be as well a package require, etc. Index: tests/object-system.tcl =================================================================== diff -u -rbedb248602f8940383c0f4a10bb4f99b3a5f2c4f -re2f11549ef70518cca8c9c49b1d78f4383b00a87 --- tests/object-system.tcl (.../object-system.tcl) (revision bedb248602f8940383c0f4a10bb4f99b3a5f2c4f) +++ tests/object-system.tcl (.../object-system.tcl) (revision e2f11549ef70518cca8c9c49b1d78f4383b00a87) @@ -159,8 +159,8 @@ ? {::nsf::relation ::class superclass} ::object # define non-standard methos to create/destroy objects and classes -::nsf::alias ::class + ::nsf::cmd::Class::create -::nsf::alias ::object - ::nsf::cmd::Object::destroy +::nsf::alias ::class + ::nsf::methods::class::create +::nsf::alias ::object - ::nsf::methods::object::destroy # create a class named C ::class + C