Index: generic/nsf.c =================================================================== diff -u -N -rb55e632513d041baec1da37ce4d46b7fdf539bb5 -rb2ab5886fc3278e549bb2772dfce921fbd06a9e9 --- generic/nsf.c (.../nsf.c) (revision b55e632513d041baec1da37ce4d46b7fdf539bb5) +++ generic/nsf.c (.../nsf.c) (revision b2ab5886fc3278e549bb2772dfce921fbd06a9e9) @@ -12904,7 +12904,7 @@ *---------------------------------------------------------------------- * FindSelfNext -- * - * This function is called via [current next] to set the result of the + * This function is called via [current nextmethod] to set the result of the * interp to the method which would be called by [next]. If there are more * shadowed methods along the precedence path, it sets the result of the * next method in form of a method handle. If there are no more shadowed @@ -19252,7 +19252,7 @@ break; } - case CurrentoptionNextIdx: + case CurrentoptionNextmethodIdx: result = FindSelfNext(interp); break; } Index: generic/nsfAPI.decls =================================================================== diff -u -N -r3e18b80be2883ba647c2110a2e8e2b1980940c30 -rb2ab5886fc3278e549bb2772dfce921fbd06a9e9 --- generic/nsfAPI.decls (.../nsfAPI.decls) (revision 3e18b80be2883ba647c2110a2e8e2b1980940c30) +++ generic/nsfAPI.decls (.../nsfAPI.decls) (revision b2ab5886fc3278e549bb2772dfce921fbd06a9e9) @@ -170,7 +170,7 @@ } cmd current NsfCurrentCmd { - {-argName "currentoption" -required 0 -type "proc|method|methodpath|object|class|activelevel|args|activemixin|calledproc|calledmethod|calledclass|callingproc|callingmethod|callingclass|callinglevel|callingobject|filterreg|isnextcall|next"} + {-argName "currentoption" -required 0 -type "proc|method|methodpath|object|class|activelevel|args|activemixin|calledproc|calledmethod|calledclass|callingproc|callingmethod|callingclass|callinglevel|callingobject|filterreg|isnextcall|nextmethod"} } cmd self NsfSelfCmd { } Index: generic/nsfAPI.h =================================================================== diff -u -N -r3e18b80be2883ba647c2110a2e8e2b1980940c30 -rb2ab5886fc3278e549bb2772dfce921fbd06a9e9 --- generic/nsfAPI.h (.../nsfAPI.h) (revision 3e18b80be2883ba647c2110a2e8e2b1980940c30) +++ generic/nsfAPI.h (.../nsfAPI.h) (revision b2ab5886fc3278e549bb2772dfce921fbd06a9e9) @@ -90,12 +90,12 @@ return result; } -enum CurrentoptionIdx {CurrentoptionNULL, CurrentoptionProcIdx, CurrentoptionMethodIdx, CurrentoptionMethodpathIdx, CurrentoptionObjectIdx, CurrentoptionClassIdx, CurrentoptionActivelevelIdx, CurrentoptionArgsIdx, CurrentoptionActivemixinIdx, CurrentoptionCalledprocIdx, CurrentoptionCalledmethodIdx, CurrentoptionCalledclassIdx, CurrentoptionCallingprocIdx, CurrentoptionCallingmethodIdx, CurrentoptionCallingclassIdx, CurrentoptionCallinglevelIdx, CurrentoptionCallingobjectIdx, CurrentoptionFilterregIdx, CurrentoptionIsnextcallIdx, CurrentoptionNextIdx}; +enum CurrentoptionIdx {CurrentoptionNULL, CurrentoptionProcIdx, CurrentoptionMethodIdx, CurrentoptionMethodpathIdx, CurrentoptionObjectIdx, CurrentoptionClassIdx, CurrentoptionActivelevelIdx, CurrentoptionArgsIdx, CurrentoptionActivemixinIdx, CurrentoptionCalledprocIdx, CurrentoptionCalledmethodIdx, CurrentoptionCalledclassIdx, CurrentoptionCallingprocIdx, CurrentoptionCallingmethodIdx, CurrentoptionCallingclassIdx, CurrentoptionCallinglevelIdx, CurrentoptionCallingobjectIdx, CurrentoptionFilterregIdx, CurrentoptionIsnextcallIdx, CurrentoptionNextmethodIdx}; static int ConvertToCurrentoption(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param CONST *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; - static CONST char *opts[] = {"proc", "method", "methodpath", "object", "class", "activelevel", "args", "activemixin", "calledproc", "calledmethod", "calledclass", "callingproc", "callingmethod", "callingclass", "callinglevel", "callingobject", "filterreg", "isnextcall", "next", NULL}; + static CONST char *opts[] = {"proc", "method", "methodpath", "object", "class", "activelevel", "args", "activemixin", "calledproc", "calledmethod", "calledclass", "callingproc", "callingmethod", "callingclass", "callinglevel", "callingobject", "filterreg", "isnextcall", "nextmethod", NULL}; (void)pPtr; result = Tcl_GetIndexFromObj(interp, objPtr, opts, "currentoption", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); @@ -189,7 +189,7 @@ {ConvertToCallprotection, "all|protected|public"}, {ConvertToMethodtype, "all|scripted|builtin|alias|forwarder|object|setter|nsfproc"}, {ConvertToFrame, "method|object|default"}, - {ConvertToCurrentoption, "proc|method|methodpath|object|class|activelevel|args|activemixin|calledproc|calledmethod|calledclass|callingproc|callingmethod|callingclass|callinglevel|callingobject|filterreg|isnextcall|next"}, + {ConvertToCurrentoption, "proc|method|methodpath|object|class|activelevel|args|activemixin|calledproc|calledmethod|calledclass|callingproc|callingmethod|callingclass|callinglevel|callingobject|filterreg|isnextcall|nextmethod"}, {ConvertToObjectkind, "class|baseclass|metaclass"}, {ConvertToMethodproperty, "class-only|call-private|call-protected|redefine-protected|returns|slotcontainer|slotobj"}, {ConvertToRelationtype, "object-mixin|class-mixin|object-filter|class-filter|class|superclass|rootclass"}, Index: library/xotcl/library/xotcl2.tcl =================================================================== diff -u -N -ra467cf37f204cc977b7af7519a0994c65f9ed10f -rb2ab5886fc3278e549bb2772dfce921fbd06a9e9 --- library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision a467cf37f204cc977b7af7519a0994c65f9ed10f) +++ library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision b2ab5886fc3278e549bb2772dfce921fbd06a9e9) @@ -72,7 +72,7 @@ switch $arg { "" {uplevel ::nsf::self} next { - set handle [uplevel ::nsf::current $arg] + set handle [uplevel ::nsf::current nextmethod] method_handle_to_xotcl $handle } default {uplevel ::nsf::current $arg} Index: tests/disposition.test =================================================================== diff -u -N -rf67408d8e6f8ba9bdd6e4ec3c54dfa3a23576161 -rb2ab5886fc3278e549bb2772dfce921fbd06a9e9 --- tests/disposition.test (.../disposition.test) (revision f67408d8e6f8ba9bdd6e4ec3c54dfa3a23576161) +++ tests/disposition.test (.../disposition.test) (revision b2ab5886fc3278e549bb2772dfce921fbd06a9e9) @@ -1077,7 +1077,7 @@ Class create M2 { :public method "FOO foo" args { - append :msg "(1)--[current next]" + append :msg "(1)--[current nextmethod]" next #puts stderr ++++++++++++++++++ append :msg "--(3)--[current class]--[current methodpath]--[current]" Index: tests/introspection.test =================================================================== diff -u -N -r16494e7f90f6b80bea8eacb3d018f1383651904b -rb2ab5886fc3278e549bb2772dfce921fbd06a9e9 --- tests/introspection.test (.../introspection.test) (revision 16494e7f90f6b80bea8eacb3d018f1383651904b) +++ tests/introspection.test (.../introspection.test) (revision b2ab5886fc3278e549bb2772dfce921fbd06a9e9) @@ -46,4 +46,24 @@ C mixin add M ? {[C new] baz} {::C ::C} +} + +# +# [::nsf::current calledclass] +# +nx::Test case current-calledmethod { + set body { + return [list [current nextmethod] {*}[next]] + } + Object create o + set mh [o public method foo {} $body] + + ? {o foo} {{}} + + Class create M + set mh2 [M public method foo {} $body] + M filter add foo + o mixin M + + ? {o foo} [list $mh2 $mh {}] } \ No newline at end of file Index: tests/methods.test =================================================================== diff -u -N -ra695cb72c6594bae8b7abb49b76c0ee7b5367b7f -rb2ab5886fc3278e549bb2772dfce921fbd06a9e9 --- tests/methods.test (.../methods.test) (revision a695cb72c6594bae8b7abb49b76c0ee7b5367b7f) +++ tests/methods.test (.../methods.test) (revision b2ab5886fc3278e549bb2772dfce921fbd06a9e9) @@ -231,13 +231,13 @@ Object create o { :method bar {-y:required -x:required} { - #puts stderr "+++ o x=$x, y=$y [current args] ... next [current next]" + #puts stderr "+++ o x=$x, y=$y [current args] ... next [current nextmethod]" return [list x $x y $y [current args]] } } Class create M { :method bar {-x:required -y:required} { - #puts stderr "+++ M x=$x, y=$y [current args] ... next [current next]" + #puts stderr "+++ M x=$x, y=$y [current args] ... next [current nextmethod]" return [list x $x y $y [current args] -- {*}[next]] } } Index: tests/submethods.test =================================================================== diff -u -N -r1d1a1be1636a5b6f9ad6e3b5df2a6aa7170b62f0 -rb2ab5886fc3278e549bb2772dfce921fbd06a9e9 --- tests/submethods.test (.../submethods.test) (revision 1d1a1be1636a5b6f9ad6e3b5df2a6aa7170b62f0) +++ tests/submethods.test (.../submethods.test) (revision b2ab5886fc3278e549bb2772dfce921fbd06a9e9) @@ -497,7 +497,7 @@ [current class] eval [list set :msg [list [current methodpath] \ [current calledmethod] \ [current calledclass] \ - [current next]]] + [current nextmethod]]] next } Index: tests/tcloo.test =================================================================== diff -u -N -r444d4e11acbb7c83427d35d1f69833d0ec8da8fe -rb2ab5886fc3278e549bb2772dfce921fbd06a9e9 --- tests/tcloo.test (.../tcloo.test) (revision 444d4e11acbb7c83427d35d1f69833d0ec8da8fe) +++ tests/tcloo.test (.../tcloo.test) (revision b2ab5886fc3278e549bb2772dfce921fbd06a9e9) @@ -47,7 +47,7 @@ ::nsf::methods::${scope}::info::method handle $m] if {$methodHandle eq ""} { set methodHandle [::nsf::method::create $current {*}[expr {$perObject?"-per-object":""}] $m args { - if {[::nsf::current next] eq ""} { + if {[::nsf::current nextmethod] eq ""} { return -code error "[::nsf::current]: unable to dispatch method '[::nsf::current method]'" } ::nsf::next