Index: TODO =================================================================== diff -u -r138d0f863712bcafd8732a3a40cef60cc80e8737 -re70316835cf50554ec304bc7ddadea6743be5c81 --- TODO (.../TODO) (revision 138d0f863712bcafd8732a3a40cef60cc80e8737) +++ TODO (.../TODO) (revision e70316835cf50554ec304bc7ddadea6743be5c81) @@ -1643,7 +1643,12 @@ make implementation more simple. - simplified EnsembleObject.defaultcmd and EnsembleObject.unknown significantly, scripted support methods are removed. +- extended regression test for "current methodpath" +- allow %method in forwarder. +- defined unknown methods as call-protected +- make __default_method_protection protected + TODO: - cleanup of xotcl-aol Index: generic/nsf.c =================================================================== diff -u -r138d0f863712bcafd8732a3a40cef60cc80e8737 -re70316835cf50554ec304bc7ddadea6743be5c81 --- generic/nsf.c (.../nsf.c) (revision 138d0f863712bcafd8732a3a40cef60cc80e8737) +++ generic/nsf.c (.../nsf.c) (revision e70316835cf50554ec304bc7ddadea6743be5c81) @@ -10180,7 +10180,9 @@ if (c == 's' && !strcmp(ForwardArgString, "self")) { *out = tcd->object->cmdName; - } else if (c == 'p' && !strcmp(ForwardArgString, "proc")) { + } else if ((c == 'p' && !strcmp(ForwardArgString, "proc")) + || (c == 'm' && !strcmp(ForwardArgString, "method")) + ) { CONST char *methodName = ObjStr(objv[0]); /* if we dispatch a method via ".", we do not want to see the "." in the %proc, e.g. for the interceptor slots (such as Index: library/nx/nx.tcl =================================================================== diff -u -r138d0f863712bcafd8732a3a40cef60cc80e8737 -re70316835cf50554ec304bc7ddadea6743be5c81 --- library/nx/nx.tcl (.../nx.tcl) (revision 138d0f863712bcafd8732a3a40cef60cc80e8737) +++ library/nx/nx.tcl (.../nx.tcl) (revision e70316835cf50554ec304bc7ddadea6743be5c81) @@ -382,7 +382,7 @@ # in nsf when calling e.g. "unknwown" (such that a subcmd # "unknown" does not interfere with the method "unknown"). # - :method unknown {obj m args} { + :protected method unknown {obj m args} { set path [current methodpath] #puts stderr "+++ UNKNOWN obj $obj '$m' $args // path '[current methodpath]'" if {[catch {set valid [$obj ::nsf::methods::object::info::lookupmethods -expand "$path *"]} errorMsg]} { @@ -393,7 +393,7 @@ error "Unable to dispatch sub-method $ref; valid are: [join [lsort $valid] {, }]" } - :method defaultmethod {} { + :protected method defaultmethod {} { set obj [uplevel {current object}] set path [current methodpath] set l [string length $path] @@ -490,7 +490,7 @@ return "valid options are: [join [lsort $methods] {, }]" } - Object method "info unknown" {method obj args} { + Object protected method "info unknown" {method obj args} { error "[::nsf::current object] unknown info option \"$method\"; [$obj info info]" } @@ -1229,7 +1229,7 @@ Object public method contains { {-withnew:boolean true} -object - {-class ::nx::Object} + {-class:class ::nx::Object} cmds } { if {![info exists object]} {set object [::nsf::current object]} @@ -1441,6 +1441,7 @@ :method defaultMethodProtection {value:boolean,optional} { if {[info exists value]} { ::nsf::method Object __default_method_protection args [list return $value] + ::nsf::methodproperty Object __default_method_protection protected true } return [::nsf::dispatch [::nx::current object] __default_method_protection] } Index: tests/info-method.tcl =================================================================== diff -u -rb69a9b8de677b30774419057953a91c96df00e56 -re70316835cf50554ec304bc7ddadea6743be5c81 --- tests/info-method.tcl (.../info-method.tcl) (revision b69a9b8de677b30774419057953a91c96df00e56) +++ tests/info-method.tcl (.../info-method.tcl) (revision e70316835cf50554ec304bc7ddadea6743be5c81) @@ -67,8 +67,8 @@ ? {::nx::Object info lookup methods -source application} "" ? {::nx::Class info lookup methods -source application} "" - set object_methods "__default_method_protection alias attribute class configure contains copy destroy eval filter forward info method mixin move protected public require setter volatile vwait" - set class_methods "__default_method_protection alias alloc attribute attributes class class-object configure contains copy create dealloc destroy eval filter forward info method mixin move new protected public require setter superclass volatile vwait" + set object_methods "alias attribute class configure contains copy destroy eval filter forward info method mixin move protected public require setter volatile vwait" + set class_methods "alias alloc attribute attributes class class-object configure contains copy create dealloc destroy eval filter forward info method mixin move new protected public require setter superclass volatile vwait" ? {lsort [::nx::Object info lookup methods -source baseclasses]} $class_methods ? {lsort [::nx::Class info lookup methods -source baseclasses]} $class_methods Index: tests/submethods.tcl =================================================================== diff -u -ref7640ec7eaa0ccb45085f0337c05992a1cec907 -re70316835cf50554ec304bc7ddadea6743be5c81 --- tests/submethods.tcl (.../submethods.tcl) (revision ef7640ec7eaa0ccb45085f0337c05992a1cec907) +++ tests/submethods.tcl (.../submethods.tcl) (revision e70316835cf50554ec304bc7ddadea6743be5c81) @@ -225,7 +225,7 @@ # defaultcmd has to return also subcmds of other shadowed ensembles ? {lsort [o1 info has]} "Valid submethods of ::o1 info has: mixin namespace something type" - ? {lsort [o1 info]} "Valid submethods of ::o1 info: children class filter forward has info is lookup method methods mixin parent precedence slots unknown vars" + ? {lsort [o1 info]} "Valid submethods of ::o1 info: children class filter forward has info is lookup method methods mixin parent precedence slots vars" # returning methodpath in ensemble ? {o1 info has something path} "info has something path"