Index: generic/nsf.c =================================================================== diff -u -rc6057c18970d5bc19fe0f1f760ef0d29898ecfdd -rdcee5f2f7bac79f3fb2b966d68360cdfcef8002a --- generic/nsf.c (.../nsf.c) (revision c6057c18970d5bc19fe0f1f760ef0d29898ecfdd) +++ generic/nsf.c (.../nsf.c) (revision dcee5f2f7bac79f3fb2b966d68360cdfcef8002a) @@ -3086,7 +3086,7 @@ * tclProc.c:InitResolvedLocals()). It registers two handlers for a * given, colon-prefixed variable found in the script: the actual * variable fetcher and a variable cleanup handler. The variable - * fetcher is executed whenever a Tcl call frame is intialised and + * fetcher is executed whenever a Tcl call frame is intialized and * the array of compiled locals is constructed (see also * InitResolvedLocals()). * @@ -17256,15 +17256,25 @@ } /* -cmd "object::initialized" NsfObjectInitializedCmd { +cmd "object::property" NsfObjectPropertyCmd { {-argName "objectName" -required 1 -type object} + {-argName "objectproperty" -type "initialized|class|rootmetaclass|rootclass|slotcontainer" -required 1} } */ static int -NsfObjectInitializedCmd(Tcl_Interp *interp, NsfObject *object) { +NsfObjectPropertyCmd(Tcl_Interp *interp, NsfObject *object, int objectproperty) { + int flags = 0;; + + switch (objectproperty) { + case ObjectpropertyInitializedIdx: flags = NSF_INIT_CALLED; break; + case ObjectpropertyClassIdx: flags = NSF_IS_CLASS; break; + case ObjectpropertyRootmetaclassIdx: flags = NSF_IS_ROOT_META_CLASS; break; + case ObjectpropertyRootclassIdx: flags = NSF_IS_ROOT_CLASS; break; + case ObjectpropertySlotcontainerIdx: flags = NSF_IS_SLOT_CONTAINER; break; + } - Tcl_SetObjResult(interp, - NsfGlobalObjs[(object->flags & NSF_INIT_CALLED) ? + Tcl_SetObjResult(interp, + NsfGlobalObjs[(object->flags & flags) ? NSF_ONE : NSF_ZERO]); return TCL_OK; }