Index: TODO =================================================================== diff -u -r03741ddf53d294724a4ed47b6e1a27964bbd6db4 -re979a7fbb725c874f4900258e7537aaf29c0fbae --- TODO (.../TODO) (revision 03741ddf53d294724a4ed47b6e1a27964bbd6db4) +++ TODO (.../TODO) (revision e979a7fbb725c874f4900258e7537aaf29c0fbae) @@ -2188,6 +2188,10 @@ - nx::pp: added flag "-linenumbers on|off" to render method - added first version of next-tutorial.[txt|html] +- xotcl2.tcl: defined ::xotcl::MetaSlot +- make sure, that classes of the intrinsic class hierarchy are + of the same object system + TODO: - doc: NextScriptingLanguage/index.html: @@ -2216,6 +2220,7 @@ * __unknown unknown is a hook for Object but a method for Class + - do we need contains in nx? - do we need vwait in nx? Plain Tcl "vwait :varName" should do it. - are the oneline hook definitions like Index: generic/nsf.c =================================================================== diff -u -red4062dcf28f3ea391fa629ad79a55ec8fc10a04 -re979a7fbb725c874f4900258e7537aaf29c0fbae --- generic/nsf.c (.../nsf.c) (revision ed4062dcf28f3ea391fa629ad79a55ec8fc10a04) +++ generic/nsf.c (.../nsf.c) (revision e979a7fbb725c874f4900258e7537aaf29c0fbae) @@ -2199,19 +2199,24 @@ static int CallDirectly(Tcl_Interp *interp, NsfObject *object, int methodIdx, Tcl_Obj **methodObjPtr) { /* - We can/must call a C-implemented method directly, when - a) the object system has no such appropriate method defined - - b) the script does not contain a method with the appropriate - name, and - - c) filters are not active on the object - */ + * We can/must call a C-implemented method directly, when + * + * a) the object system has no such appropriate method defined + * + * b) the script does not contain a method with the appropriate + * name, and + * + * c) filters are not active on the object + */ NsfObjectSystem *osPtr = GetObjectSystem(object); int callDirectly = 1; Tcl_Obj *methodObj; methodObj = osPtr->methods[methodIdx]; + /*fprintf(stderr, "OS of %s is %s, method %s methodObj %p\n", + ObjectName(object), ObjectName((&osPtr->rootClass->object)), + Nsf_SytemMethodOpts[methodIdx]+1, methodObj);*/ + if (methodObj) { int flag = 1 << methodIdx; if ((osPtr->overloadedMethods & flag) != 0) { @@ -2233,7 +2238,7 @@ );*/ if ((object->flags & NSF_FILTER_ORDER_DEFINED_AND_VALID) == NSF_FILTER_ORDER_DEFINED_AND_VALID) { /*fprintf(stderr, "CallDirectly object %s idx %s has filter \n", - ObjectName(object), sytemMethodOpts[methodIdx]+1);*/ + ObjectName(object), Nsf_SytemMethodOpts[methodIdx]+1);*/ callDirectly = 0; } } @@ -6511,6 +6516,7 @@ static int SuperclassAdd(Tcl_Interp *interp, NsfClass *cl, int oc, Tcl_Obj **ov, Tcl_Obj *arg, NsfClass *baseClass) { NsfClasses *filterCheck, *osl = NULL; + NsfObjectSystem *osPtr; NsfClass **scl; int reversed = 0; int i, j; @@ -6564,6 +6570,19 @@ return NsfObjErrType(interp, "superclass", arg, "classes in dependence order", NULL); } + /* + * Ensure that the current class and new superclasses are from the + * same object system. + */ + osPtr = GetObjectSystem(&cl->object); + for (i = 0; i < oc; i++) { + if (osPtr != GetObjectSystem(&scl[i]->object)) { + return NsfPrintError(interp, "class \"%s\" has different object system as class \"%s\"", + ClassName(cl), ClassName(scl[i])); + } + } + + while (cl->super) { /* * build up an old superclass list in case we need to revert @@ -17430,8 +17449,12 @@ * dispatch "cleanup" method */ if (CallDirectly(interp, object, NSF_o_cleanup_idx, &methodObj)) { + /*fprintf(stderr, "RECREATE calls cleanup directly for object %s\n", ObjectName(object));*/ result = NsfOCleanupMethod(interp, object); } else { + /*NsfObjectSystem *osPtr = GetObjectSystem(object); + fprintf(stderr, "RECREATE calls method cleanup for object %p %s OS %s\n", + object, ObjectName(object), ObjectName((&osPtr->rootClass->object)));*/ result = CallMethod((ClientData) object, interp, methodObj, 2, 0, NSF_CM_NO_PROTECT|NSF_CSC_IMMEDIATE); }