Index: TODO =================================================================== diff -u -rc2baf6c2b4e9a88c3580bdadf5e735dfe96d7f10 -r2b8b3b10404d6e67ce420e8e2a2fda57991d7c5f --- TODO (.../TODO) (revision c2baf6c2b4e9a88c3580bdadf5e735dfe96d7f10) +++ TODO (.../TODO) (revision 2b8b3b10404d6e67ce420e8e2a2fda57991d7c5f) @@ -2545,6 +2545,9 @@ * deactivate coro regression test, since it is apparently broken for tcl-head in fossil (stack frame seems to be lost after a yield) +* make sure to create the cmds for objects with Tcl_NRCreateCommand() + to choose trampoline-path in the trunk version of Tcl + TODO: - maybe the destructor of a slot should remove the setter/forwarder - how to delete attributes? Index: generic/nsf.c =================================================================== diff -u -rc2baf6c2b4e9a88c3580bdadf5e735dfe96d7f10 -r2b8b3b10404d6e67ce420e8e2a2fda57991d7c5f --- generic/nsf.c (.../nsf.c) (revision c2baf6c2b4e9a88c3580bdadf5e735dfe96d7f10) +++ generic/nsf.c (.../nsf.c) (revision 2b8b3b10404d6e67ce420e8e2a2fda57991d7c5f) @@ -11163,8 +11163,13 @@ if (nsPtr) { NSNamespacePreserve(nsPtr); } +#if defined(NRE) + object->id = Tcl_NRCreateCommand(interp, nameString, NsfObjDispatch, NsfObjDispatch, + (ClientData)object, TclDeletesObject); +#else object->id = Tcl_CreateObjCommand(interp, nameString, NsfObjDispatch, (ClientData)object, TclDeletesObject); +#endif /*fprintf(stderr, "cmd alloc %p %d (%s)\n", object->id, Tcl_Command_refCount(object->id), nameString);*/ @@ -11583,8 +11588,14 @@ if (nsPtr) { NSNamespacePreserve(nsPtr); } +#if defined(NRE) + object->id = Tcl_NRCreateCommand(interp, nameString, NsfObjDispatch, NsfObjDispatch, + (ClientData)cl, TclDeletesObject); +#else object->id = Tcl_CreateObjCommand(interp, nameString, NsfObjDispatch, (ClientData)cl, TclDeletesObject); +#endif + PrimitiveOInit(object, interp, nameString, nsPtr, class); if (nsPtr) { NSNamespaceRelease(nsPtr); Index: tests/tcl86.test =================================================================== diff -u -rc2baf6c2b4e9a88c3580bdadf5e735dfe96d7f10 -r2b8b3b10404d6e67ce420e8e2a2fda57991d7c5f --- tests/tcl86.test (.../tcl86.test) (revision c2baf6c2b4e9a88c3580bdadf5e735dfe96d7f10) +++ tests/tcl86.test (.../tcl86.test) (revision 2b8b3b10404d6e67ce420e8e2a2fda57991d7c5f) @@ -5,22 +5,16 @@ # just 8.6 or newer if {[info command yield] eq ""} return -# The test with the head version is currently broken (leads to a crash -# between ==5 and ==5a); so deactivate for now -return # # Test coroutine / yield # Test case number-generator { nx::Object create ::numbers { # set instance variable used in coroutine set :delta 2 - :public method ++ {} { + :public method ++ {} { yield - ::nsf::__db_show_stack - puts stderr ====5 set i 0 - puts stderr ====5a while 1 { yield $i incr i ${:delta} @@ -32,7 +26,6 @@ set ::j 0 # use coroutine for {set i 0} {$i < 10} {incr i} { - puts stderr ====10 incr ::j [nextNumber] }