Index: TODO =================================================================== diff -u -r3754364287df2dfdf79b81dfa69224eae19cf691 -rd9b42d77f43db84a9983cc3bbc4124cf0b52df29 --- TODO (.../TODO) (revision 3754364287df2dfdf79b81dfa69224eae19cf691) +++ TODO (.../TODO) (revision d9b42d77f43db84a9983cc3bbc4124cf0b52df29) @@ -1230,9 +1230,13 @@ - replaced ::nsf::cmd::ClassInfo2 by ::nsf::cmd::ClassInfo - replaced ::nsf::cmd::ObjectInfo2 by ::nsf::cmd::ObjectInfo -- replaced argument order on objectproperty to make it conformant with Tcl conventions +- changed argument order on objectproperty to make it conformant with Tcl conventions - updated migration guide +- changed argument order on nsf::is to make it conformant with Tcl conventions +- removed objectproperty, replaced it by ::nsf::is +- move functionalizy of objectproperty to make "obj info is ..." more efficient + TODO: - reflect changes in /is/objectproperty/info has/info is/ in migration guide - check equivalence of the following two commands Index: generic/gentclAPI.decls =================================================================== diff -u -r3754364287df2dfdf79b81dfa69224eae19cf691 -rd9b42d77f43db84a9983cc3bbc4124cf0b52df29 --- generic/gentclAPI.decls (.../gentclAPI.decls) (revision 3754364287df2dfdf79b81dfa69224eae19cf691) +++ generic/gentclAPI.decls (.../gentclAPI.decls) (revision d9b42d77f43db84a9983cc3bbc4124cf0b52df29) @@ -86,8 +86,8 @@ {-argName "class" -type class} } xotclCmd is XOTclIsCmd { - {-argName "value" -required 1 -type tclobj} {-argName "constraint" -required 1 -type tclobj} + {-argName "value" -required 1 -type tclobj} } xotclCmd isobject XOTclIsObjectCmd { {-argName "object" -required 1 -type tclobj} @@ -124,10 +124,6 @@ {-argName "fromNs" -required 1 -type tclobj} {-argName "toNs" -required 1 -type tclobj} } -xotclCmd objectproperty XOTclObjectpropertyCmd { - {-argName "objectkind" -type "object|class|baseclass|metaclass"} - {-argName "object" -required 1 -type tclobj} -} xotclCmd parametercheck XOTclParametercheckCmd { {-argName "-nocomplain"} {-argName "param" -type tclobj} @@ -256,6 +252,9 @@ objectInfoMethod hastype XOTclObjInfoHasTypeMethod { {-argName "class" -type class} } +objectInfoMethod istype XOTclObjInfoIsTypeMethod { + {-argName "objectkind" -type "object|class|baseclass|metaclass"} +} objectInfoMethod method XOTclObjInfoMethodMethod { {-argName "infomethodsubcmd" -type "args|body|definition|handle|parameter|parametersyntax|type|precondition|postcondition"} {-argName "name"} Index: generic/tclAPI.h =================================================================== diff -u -r3754364287df2dfdf79b81dfa69224eae19cf691 -rd9b42d77f43db84a9983cc3bbc4124cf0b52df29 --- generic/tclAPI.h (.../tclAPI.h) (revision 3754364287df2dfdf79b81dfa69224eae19cf691) +++ generic/tclAPI.h (.../tclAPI.h) (revision d9b42d77f43db84a9983cc3bbc4124cf0b52df29) @@ -54,6 +54,17 @@ } enum InfocallablesubcmdIdx {InfocallablesubcmdNULL, InfocallablesubcmdFilterIdx, InfocallablesubcmdMethodIdx, InfocallablesubcmdMethodsIdx}; +static int convertToObjectkind(Tcl_Interp *interp, Tcl_Obj *objPtr, XOTclParam CONST *pPtr, + ClientData *clientData, Tcl_Obj **outObjPtr) { + int index, result; + static CONST char *opts[] = {"object", "class", "baseclass", "metaclass", NULL}; + result = Tcl_GetIndexFromObj(interp, objPtr, opts, "objectkind", 0, &index); + *clientData = (ClientData) INT2PTR(index + 1); + *outObjPtr = objPtr; + return result; +} +enum ObjectkindIdx {ObjectkindNULL, ObjectkindObjectIdx, ObjectkindClassIdx, ObjectkindBaseclassIdx, ObjectkindMetaclassIdx}; + static int convertToAssertionsubcmd(Tcl_Interp *interp, Tcl_Obj *objPtr, XOTclParam CONST *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; @@ -98,17 +109,6 @@ } enum MethodpropertyIdx {MethodpropertyNULL, MethodpropertyClass_onlyIdx, MethodpropertyProtectedIdx, MethodpropertyRedefine_protectedIdx, MethodpropertyReturnsIdx, MethodpropertySlotobjIdx}; -static int convertToObjectkind(Tcl_Interp *interp, Tcl_Obj *objPtr, XOTclParam CONST *pPtr, - ClientData *clientData, Tcl_Obj **outObjPtr) { - int index, result; - static CONST char *opts[] = {"object", "class", "baseclass", "metaclass", NULL}; - result = Tcl_GetIndexFromObj(interp, objPtr, opts, "objectkind", 0, &index); - *clientData = (ClientData) INT2PTR(index + 1); - *outObjPtr = objPtr; - return result; -} -enum ObjectkindIdx {ObjectkindNULL, ObjectkindObjectIdx, ObjectkindClassIdx, ObjectkindBaseclassIdx, ObjectkindMetaclassIdx}; - static int convertToRelationtype(Tcl_Interp *interp, Tcl_Obj *objPtr, XOTclParam CONST *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; @@ -189,6 +189,7 @@ static int XOTclObjInfoHasMixinMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclObjInfoHasTypeMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclObjInfoHasnamespaceMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); +static int XOTclObjInfoIsTypeMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclObjInfoMethodMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclObjInfoMethodsMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclObjInfoMixinclassesMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); @@ -218,7 +219,6 @@ static int XOTclMyCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclNSCopyCmdsStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclNSCopyVarsStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); -static int XOTclObjectpropertyCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclParametercheckCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclQualifyObjCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclRelationCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); @@ -269,6 +269,7 @@ static int XOTclObjInfoHasMixinMethod(Tcl_Interp *interp, XOTclObject *obj, XOTclClass *class); static int XOTclObjInfoHasTypeMethod(Tcl_Interp *interp, XOTclObject *obj, XOTclClass *class); static int XOTclObjInfoHasnamespaceMethod(Tcl_Interp *interp, XOTclObject *obj); +static int XOTclObjInfoIsTypeMethod(Tcl_Interp *interp, XOTclObject *obj, int objectkind); static int XOTclObjInfoMethodMethod(Tcl_Interp *interp, XOTclObject *obj, int infomethodsubcmd, CONST char *name); static int XOTclObjInfoMethodsMethod(Tcl_Interp *interp, XOTclObject *obj, int withMethodtype, int withCallprotection, int withNomixins, int withIncontext, CONST char *pattern); static int XOTclObjInfoMixinclassesMethod(Tcl_Interp *interp, XOTclObject *obj, int withGuards, int withOrder, CONST char *patternString, XOTclObject *patternObj); @@ -291,14 +292,13 @@ static int XOTclImportvarCmd(Tcl_Interp *interp, XOTclObject *object, int nobjc, Tcl_Obj *CONST nobjv[]); static int XOTclInterpObjCmd(Tcl_Interp *interp, CONST char *name, int objc, Tcl_Obj *CONST objv[]); static int XOTclInvalidateObjectParameterCmd(Tcl_Interp *interp, XOTclClass *class); -static int XOTclIsCmd(Tcl_Interp *interp, Tcl_Obj *value, Tcl_Obj *constraint); +static int XOTclIsCmd(Tcl_Interp *interp, Tcl_Obj *constraint, Tcl_Obj *value); static int XOTclIsObjectCmd(Tcl_Interp *interp, Tcl_Obj *object); static int XOTclMethodCmd(Tcl_Interp *interp, XOTclObject *object, int withInner_namespace, int withPer_object, int withPublic, Tcl_Obj *name, Tcl_Obj *args, Tcl_Obj *body, Tcl_Obj *withPrecondition, Tcl_Obj *withPostcondition); static int XOTclMethodPropertyCmd(Tcl_Interp *interp, XOTclObject *object, int withPer_object, Tcl_Obj *methodName, int methodproperty, Tcl_Obj *value); static int XOTclMyCmd(Tcl_Interp *interp, int withLocal, Tcl_Obj *method, int nobjc, Tcl_Obj *CONST nobjv[]); static int XOTclNSCopyCmds(Tcl_Interp *interp, Tcl_Obj *fromNs, Tcl_Obj *toNs); static int XOTclNSCopyVars(Tcl_Interp *interp, Tcl_Obj *fromNs, Tcl_Obj *toNs); -static int XOTclObjectpropertyCmd(Tcl_Interp *interp, int objectkind, Tcl_Obj *object); static int XOTclParametercheckCmd(Tcl_Interp *interp, int withNocomplain, Tcl_Obj *param, Tcl_Obj *value); static int XOTclQualifyObjCmd(Tcl_Interp *interp, Tcl_Obj *name); static int XOTclRelationCmd(Tcl_Interp *interp, XOTclObject *object, int relationtype, Tcl_Obj *value); @@ -350,6 +350,7 @@ XOTclObjInfoHasMixinMethodIdx, XOTclObjInfoHasTypeMethodIdx, XOTclObjInfoHasnamespaceMethodIdx, + XOTclObjInfoIsTypeMethodIdx, XOTclObjInfoMethodMethodIdx, XOTclObjInfoMethodsMethodIdx, XOTclObjInfoMixinclassesMethodIdx, @@ -379,7 +380,6 @@ XOTclMyCmdIdx, XOTclNSCopyCmdsIdx, XOTclNSCopyVarsIdx, - XOTclObjectpropertyCmdIdx, XOTclParametercheckCmdIdx, XOTclQualifyObjCmdIdx, XOTclRelationCmdIdx, @@ -1265,6 +1265,25 @@ } static int +XOTclObjInfoIsTypeMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + parseContext pc; + XOTclObject *obj = (XOTclObject *)clientData; + if (!obj) return XOTclObjErrType(interp, objv[0], "Object", ""); + if (ArgumentParse(interp, objc, objv, obj, objv[0], + method_definitions[XOTclObjInfoIsTypeMethodIdx].paramDefs, + method_definitions[XOTclObjInfoIsTypeMethodIdx].nrParameters, + &pc) != TCL_OK) { + return TCL_ERROR; + } else { + int objectkind = (int )PTR2INT(pc.clientData[0]); + + parseContextRelease(&pc); + return XOTclObjInfoIsTypeMethod(interp, obj, objectkind); + + } +} + +static int XOTclObjInfoMethodMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { parseContext pc; XOTclObject *obj = (XOTclObject *)clientData; @@ -1715,11 +1734,11 @@ &pc) != TCL_OK) { return TCL_ERROR; } else { - Tcl_Obj *value = (Tcl_Obj *)pc.clientData[0]; - Tcl_Obj *constraint = (Tcl_Obj *)pc.clientData[1]; + Tcl_Obj *constraint = (Tcl_Obj *)pc.clientData[0]; + Tcl_Obj *value = (Tcl_Obj *)pc.clientData[1]; parseContextRelease(&pc); - return XOTclIsCmd(interp, value, constraint); + return XOTclIsCmd(interp, constraint, value); } } @@ -1848,25 +1867,6 @@ } static int -XOTclObjectpropertyCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { - parseContext pc; - - if (ArgumentParse(interp, objc, objv, NULL, objv[0], - method_definitions[XOTclObjectpropertyCmdIdx].paramDefs, - method_definitions[XOTclObjectpropertyCmdIdx].nrParameters, - &pc) != TCL_OK) { - return TCL_ERROR; - } else { - int objectkind = (int )PTR2INT(pc.clientData[0]); - Tcl_Obj *object = (Tcl_Obj *)pc.clientData[1]; - - parseContextRelease(&pc); - return XOTclObjectpropertyCmd(interp, objectkind, object); - - } -} - -static int XOTclParametercheckCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { parseContext pc; @@ -2129,6 +2129,9 @@ {"::nsf::cmd::ObjectInfo::hasnamespace", XOTclObjInfoHasnamespaceMethodStub, 0, { } }, +{"::nsf::cmd::ObjectInfo::istype", XOTclObjInfoIsTypeMethodStub, 1, { + {"objectkind", 0, 0, convertToObjectkind}} +}, {"::nsf::cmd::ObjectInfo::method", XOTclObjInfoMethodMethodStub, 2, { {"infomethodsubcmd", 0, 0, convertToInfomethodsubcmd}, {"name", 0, 0, convertToString}} @@ -2232,8 +2235,8 @@ {"class", 0, 0, convertToClass}} }, {"::nsf::is", XOTclIsCmdStub, 2, { - {"value", 1, 0, convertToTclobj}, - {"constraint", 1, 0, convertToTclobj}} + {"constraint", 1, 0, convertToTclobj}, + {"value", 1, 0, convertToTclobj}} }, {"::nsf::isobject", XOTclIsObjectCmdStub, 1, { {"object", 1, 0, convertToTclobj}} @@ -2269,10 +2272,6 @@ {"fromNs", 1, 0, convertToTclobj}, {"toNs", 1, 0, convertToTclobj}} }, -{"::nsf::objectproperty", XOTclObjectpropertyCmdStub, 2, { - {"objectkind", 0, 0, convertToObjectkind}, - {"object", 1, 0, convertToTclobj}} -}, {"::nsf::parametercheck", XOTclParametercheckCmdStub, 3, { {"-nocomplain", 0, 0, convertToString}, {"param", 0, 0, convertToTclobj}, Index: generic/xotcl.c =================================================================== diff -u -rd9c5a4b5c33bfa0bdb33ef52bd703390d933eb98 -rd9b42d77f43db84a9983cc3bbc4124cf0b52df29 --- generic/xotcl.c (.../xotcl.c) (revision d9c5a4b5c33bfa0bdb33ef52bd703390d933eb98) +++ generic/xotcl.c (.../xotcl.c) (revision d9b42d77f43db84a9983cc3bbc4124cf0b52df29) @@ -11532,11 +11532,11 @@ /* xotclCmd is XOTclIsCmd { - {-argName "value" -required 1 -type tclobj} {-argName "constraint" -required 1 -type tclobj} + {-argName "value" -required 1 -type tclobj} } */ -static int XOTclIsCmd(Tcl_Interp *interp, Tcl_Obj *valueObj, Tcl_Obj *constraintObj) { +static int XOTclIsCmd(Tcl_Interp *interp, Tcl_Obj *constraintObj, Tcl_Obj *valueObj) { return XOTclParametercheckCmd(interp, 1, constraintObj, valueObj); } @@ -12052,44 +12052,6 @@ } /* -xotclCmd objectproperty XOTclObjectpropertyCmd { - {-argName "objectkind" -type "object|class|baseclass|metaclass"} - {-argName "object" -required 1 -type tclobj} -} -*/ -static int XOTclObjectpropertyCmd(Tcl_Interp *interp, int objectkind, Tcl_Obj *obj) { - int success = TCL_ERROR; - /*Tcl_Obj *obj = object->cmdName;*/ - XOTclObject *object; - - /* fprintf(stderr, "XOTclObjectpropertyCmd\n");*/ - - switch (objectkind) { - case ObjectkindObjectIdx: - success = (GetObjectFromObj(interp, obj, &object) == TCL_OK); - break; - - case ObjectkindClassIdx: - success = (GetObjectFromObj(interp, obj, &object) == TCL_OK) && XOTclObjectIsClass(object); - break; - - case ObjectkindMetaclassIdx: - success = (GetObjectFromObj(interp, obj, &object) == TCL_OK) - && XOTclObjectIsClass(object) - && IsMetaClass(interp, (XOTclClass*)object, 1); - break; - - case ObjectkindBaseclassIdx: - success = (GetObjectFromObj(interp, obj, &object) == TCL_OK) - && XOTclObjectIsClass(object) - && IsBaseClass((XOTclClass*)object); - break; - } - Tcl_SetIntObj(Tcl_GetObjResult(interp), success); - return TCL_OK; -} - -/* xotclCmd __qualify XOTclQualifyObjCmd { {-argName "name" -required 1 -type tclobj} } @@ -14067,6 +14029,39 @@ } /* +objectInfoMethod istype XOTclObjInfoIsTypeMethod { + {-argName "objectkind" -type "object|class|baseclass|metaclass"} +} +*/ +static int XOTclObjInfoIsTypeMethod(Tcl_Interp *interp, XOTclObject *object, int objectkind) { + int success = 0; + + switch (objectkind) { + case ObjectkindObjectIdx: + success = 1; + break; + + case ObjectkindClassIdx: + success = (XOTclObjectIsClass(object) > 0); + break; + + case ObjectkindMetaclassIdx: + success = XOTclObjectIsClass(object) + && IsMetaClass(interp, (XOTclClass*)object, 1); + break; + + case ObjectkindBaseclassIdx: + success = XOTclObjectIsClass(object) + && IsBaseClass((XOTclClass*)object); + break; + } + Tcl_SetIntObj(Tcl_GetObjResult(interp), success); + return TCL_OK; +} + + + +/* objectInfoMethod method XOTclObjInfoMethodMethod { {-argName "infomethodsubcmd" -type "args|body|definition|handle|parameter|parametersyntax|type|precondition|postcondition"} {-argName "name"} Index: library/lib/doc-tools.tcl =================================================================== diff -u -r3c7222644fc726717f54ffe8292acb80996e29e0 -rd9b42d77f43db84a9983cc3bbc4124cf0b52df29 --- library/lib/doc-tools.tcl (.../doc-tools.tcl) (revision 3c7222644fc726717f54ffe8292acb80996e29e0) +++ library/lib/doc-tools.tcl (.../doc-tools.tcl) (revision d9b42d77f43db84a9983cc3bbc4124cf0b52df29) @@ -238,7 +238,7 @@ :method require_part {domain prop value} { if {[info exists :part_class]} { - if {[::nsf::is $value object] && \ + if {[::nsf::is object $value] && \ [$value info has type ${:part_class}]} { return $value } @@ -552,7 +552,7 @@ # requested (from the part_attribute) applicable to the # partof object, which is the object behind [$domain name]? if {[info exists :scope] && - ![::nsf::objectproperty ${:scope} [$domain name]]} { + ![::nsf::is ${:scope} [$domain name]]} { error "The entity '[$domain name]' does not qualify as '${:scope}'" } next @@ -564,7 +564,7 @@ set inherited [dict create] foreach c [lreverse [${:name} info heritage]] { set entity [[::nsf::current class] id $c] - if {![::nsf::is $entity object]} continue + if {![::nsf::is object $entity]} continue if {[$entity eval [list info exists :${member}]]} { dict set inherited $entity [$entity $member] } @@ -996,7 +996,7 @@ :method link {entity_type args} { set id [$entity_type id {*}$args] - if {![::nsf::is $id object]} return; + if {![::nsf::is object $id]} return; set pof "" if {[$id info has type ::nx::doc::Part]} { set pof "[[$id partof] name]#" @@ -1136,7 +1136,7 @@ if {[::nsf::isobject $thing]} { if {[$thing eval {info exists :__initcmd}]} { - :analyze_initcmd [expr {[::nsf::objectproperty class $thing]?"@class":"@object"}] $thing [$thing eval {set :__initcmd}] + :analyze_initcmd [expr {[::nsf::is class $thing]?"@class":"@object"}] $thing [$thing eval {set :__initcmd}] } } elseif {![catch {package present $thing} msg]} { # For tcl packages, we assume that the package is sourceable @@ -1241,8 +1241,8 @@ # initcmds and method bodies. foreach addition $additions { # TODO: for now, we skip over pure Tcl commands and procs - if {![::nsf::is $addition object]} continue; - set kind [expr {[::nsf::is $addition class]?"@class":"@object"}] + if {![::nsf::is object $addition]} continue; + set kind [expr {[::nsf::is class $addition]?"@class":"@object"}] #puts stderr "ADDITION :process [namespace origin $addition]" if {[$addition eval {info exists :__initcmd}]} { :analyze_initcmd $kind $addition [$addition eval {set :__initcmd}] @@ -1793,7 +1793,7 @@ set partof_entity [$entity_type id $qualifier] # TODO: Also, we expect the qualifier to resolve against an # already existing entity object? Is this intended? - if {[::nsf::is $partof_entity object]} { + if {[::nsf::is object $partof_entity]} { return [list $nq_name $partof_entity] } } Index: library/nx/nx.tcl =================================================================== diff -u -rd9c5a4b5c33bfa0bdb33ef52bd703390d933eb98 -rd9b42d77f43db84a9983cc3bbc4124cf0b52df29 --- library/nx/nx.tcl (.../nx.tcl) (revision d9c5a4b5c33bfa0bdb33ef52bd703390d933eb98) +++ library/nx/nx.tcl (.../nx.tcl) (revision d9b42d77f43db84a9983cc3bbc4124cf0b52df29) @@ -347,7 +347,7 @@ set methodName [lindex $path end] foreach w [lrange $path 0 end-1] { #puts stderr "check $object info methods $path @ <$w>" - set scope [expr {[nsf::objectproperty class $object] && !${per-object} ? "Class" : "Object"}] + set scope [expr {[nsf::is class $object] && !${per-object} ? "Class" : "Object"}] if {[$object ::nsf::cmd::${scope}Info::methods -methodtype all $w] eq ""} { # # Create dispatch/ensemble object and accessor method (if wanted) @@ -756,7 +756,7 @@ set parent [::nsf::dispatch $self ::nsf::cmd::ObjectInfo::parent] set grandparent [::nsf::dispatch $parent ::nsf::cmd::ObjectInfo::parent] set tail [namespace tail $parent] - if {$tail eq "slot" && [::nsf::objectproperty class $grandparent]} { + if {$tail eq "slot" && [::nsf::is class $grandparent]} { set aliases [::nsf::dispatch $grandparent ::nsf::cmd::ClassInfo::methods -methodtype alias] foreach alias $aliases { set def [::nsf::dispatch $grandparent ::nsf::cmd::ClassInfo::method definition $alias] @@ -778,7 +778,7 @@ set path $(name) while {1} { set o [::nsf::dispatch $o ::nsf::cmd::ObjectInfo::parent] - if {![::nsf::objectproperty type $o ::nx::EnsembleObject]} break + if {![$o has type ::nx::EnsembleObject]} break array set "" [$o ::nsf::classes::nx::EnsembleObject::subcmdName] set path "$(name) $path" } @@ -853,7 +853,7 @@ :alias "info has mixin" ::nsf::cmd::ObjectInfo::hasmixin :alias "info has namespace" ::nsf::cmd::ObjectInfo::hasnamespace :alias "info has type" ::nsf::cmd::ObjectInfo::hastype - :method "info is" {kind} {::nsf::objectproperty $kind [::nsf::current object]} + :alias "info is" ::nsf::cmd::ObjectInfo::istype :alias "info methods" ::nsf::cmd::ObjectInfo::methods :alias "info mixin guard" ::nsf::cmd::ObjectInfo::mixinguard :alias "info mixin classes" ::nsf::cmd::ObjectInfo::mixinclasses @@ -1216,7 +1216,7 @@ } ObjectParameterSlot public method destroy {} { - if {${:domain} ne "" && [::nsf::objectproperty class ${:domain}]} { + if {${:domain} ne "" && [::nsf::is class ${:domain}]} { ::nsf::invalidateobjectparameter ${:domain} } ::nsf::next @@ -1230,7 +1230,7 @@ if {![info exists :methodname]} { set :methodname ${:name} } - if {[::nsf::objectproperty class ${:domain}]} { + if {[::nsf::is class ${:domain}]} { ::nsf::invalidateobjectparameter ${:domain} } if {${:per-object} && [info exists :default] } { @@ -1273,7 +1273,7 @@ } if {[info exists :type]} { if {[string match ::* ${:type}]} { - set type [expr {[::nsf::objectproperty metaclass ${:type}] ? "class" : "object"}] + set type [expr {[::nsf::is metaclass ${:type}] ? "class" : "object"}] lappend objopts type=${:type} lappend methodopts type=${:type} } else { @@ -1340,7 +1340,7 @@ if {![::nsf::dispatch $slot ::nsf::cmd::ObjectInfo::hastype ::nx::Slot]} continue # Skip some slots for xotcl; # TODO: maybe different parameterFromSlots for xotcl? - if {[::nsf::is ::xotcl::Object class] + if {[::nsf::is class ::xotcl::Object] && [::nsf::dispatch $obj ::nsf::cmd::ObjectInfo::hastype ::xotcl::Object] && ([$slot name] eq "mixin" || [$slot name] eq "filter") } continue @@ -1354,7 +1354,7 @@ Object protected method objectparameter {{lastparameter __initcmd:initcmd,optional}} { #puts stderr "... objectparameter [::nsf::current object]" set parameterdefinitions [::nsf::parametersFromSlots [::nsf::current object]] - if {[::nsf::objectproperty class [::nsf::current object]]} { + if {[::nsf::is class [::nsf::current object]]} { lappend parameterdefinitions -parameter:method,optional } lappend parameterdefinitions \ @@ -1406,7 +1406,7 @@ } set value [::nsf::dispatch $value -objscope ::nsf::current object] } - if {![::nsf::objectproperty class ${:elementtype}]} { + if {![::nsf::is class ${:elementtype}]} { error "$value does not appear to be of type ${:elementtype}" } } @@ -1778,14 +1778,15 @@ ################################################################## Slot method type=baseclass {name value} { - if {![::nsf::objectproperty baseclass $value]} { + # note, that we cannot use "nsf::is baseclass ..." here, since nsf::is call this converter + if {![::nsf::isobject $value] || ![::nsf::dispatch $value ::nsf::cmd::ObjectInfo::istype baseclass]} { error "expected baseclass but got \"$value\" for parameter $name" } return $value } Slot method type=metaclass {name value} { - if {![::nsf::objectproperty metaclass $value]} { + if {![::nsf::isobject $value] || ![::nsf::dispatch $value ::nsf::cmd::ObjectInfo::istype metaclass]} { error "expected metaclass but got \"$value\" for parameter $name" } return $value @@ -1837,10 +1838,10 @@ Class mixin add $m end # TODO: the following is not pretty; however, contains might # build xotcl and next objects. - if {[::nsf::is ::xotcl::Class class]} {::xotcl::Class instmixin add $m end} + if {[::nsf::is class ::xotcl::Class]} {::xotcl::Class instmixin add $m end} namespace eval $object $cmds Class mixin delete $m - if {[::nsf::is ::xotcl::Class class]} {::xotcl::Class instmixin delete $m} + if {[::nsf::is class ::xotcl::Class]} {::xotcl::Class instmixin delete $m} } else { namespace eval $object $cmds } @@ -1906,7 +1907,7 @@ set dest [:getDest $origin] if {[::nsf::isobject $origin]} { # copy class information - if {[::nsf::objectproperty class $origin]} { + if {[::nsf::is class $origin]} { set cl [[$origin info class] create $dest -noinit] # class object set obj $cl @@ -1936,7 +1937,7 @@ ::nsf::forward $dest -per-object $i {*}[$origin ::nsf::cmd::ObjectInfo::forward -definition $i] } - if {[::nsf::objectproperty class $origin]} { + if {[::nsf::is class $origin]} { foreach i [$origin ::nsf::cmd::ClassInfo::forward] { ::nsf::forward $dest $i {*}[$origin ::nsf::cmd::ClassInfo::forward -definition $i] } @@ -1959,7 +1960,7 @@ } # alter 'domain' and 'manager' in slot objects for classes foreach origin [set :targetList] { - if {[::nsf::objectproperty class $origin]} { + if {[::nsf::is class $origin]} { set dest [:getDest $origin] foreach oldslot [$origin info slots] { set newslot [::nx::slotObj $dest [namespace tail $oldslot]] @@ -1992,7 +1993,7 @@ :copy $newName } ### let all subclasses get the copied class as superclass - if {[::nsf::objectproperty class [::nsf::current object]] && $newName ne ""} { + if {[::nsf::is class [::nsf::current object]] && $newName ne ""} { foreach subclass [:info subclass] { set scl [$subclass info superclass] if {[set index [lsearch -exact $scl [::nsf::current object]]] != -1} { Index: library/serialize/serializer.tcl =================================================================== diff -u -r3754364287df2dfdf79b81dfa69224eae19cf691 -rd9b42d77f43db84a9983cc3bbc4124cf0b52df29 --- library/serialize/serializer.tcl (.../serializer.tcl) (revision 3754364287df2dfdf79b81dfa69224eae19cf691) +++ library/serialize/serializer.tcl (.../serializer.tcl) (revision d9b42d77f43db84a9983cc3bbc4124cf0b52df29) @@ -654,7 +654,7 @@ } :method method-serialize {o m modifier} { - if {![::nsf::objectproperty class $o]} {set modifier ""} + if {![::nsf::is class $o]} {set modifier ""} return [$o {*}$modifier info method definition $m] } Index: library/xotcl/library/xotcl2.tcl =================================================================== diff -u -r3754364287df2dfdf79b81dfa69224eae19cf691 -rd9b42d77f43db84a9983cc3bbc4124cf0b52df29 --- library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision 3754364287df2dfdf79b81dfa69224eae19cf691) +++ library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision d9b42d77f43db84a9983cc3bbc4124cf0b52df29) @@ -475,7 +475,6 @@ :alias forward ::nsf::cmd::ObjectInfo::forward :alias hasnamespace ::nsf::cmd::ObjectInfo::hasnamespace :proc invar {} {::nsf::assertion [self] object-invar} - #:proc is {kind} {::nsf::objectproperty object [::nsf::current] $kind} :proc methods { -nocmds:switch -noprocs:switch -incontext:switch pattern:optional @@ -591,13 +590,13 @@ # emulation of isobject, isclass ... Object instproc isobject {{object:substdefault "[self]"}} {::nsf::isobject $object} - Object instproc isclass {{class:substdefault "[self]"}} {::nsf::objectproperty class $class} - Object instproc ismetaclass {{class:substdefault "[self]"}} {::nsf::objectproperty metaclass $class} + Object instproc isclass {{class:substdefault "[self]"}} {::nsf::is class $class} + Object instproc ismetaclass {{class:substdefault "[self]"}} {::nsf::is metaclass $class} Object instproc ismixin {class} { - expr {[::nsf::objectproperty class $class] && + expr {[::nsf::is class $class] && [my ::nsf::cmd::ObjectInfo::hasmixin $class]}} Object instproc istype {class} { - expr {[::nsf::objectproperty class $class] && + expr {[::nsf::is class $class] && [::nsf::dispatch [self] ::nsf::cmd::ObjectInfo::hastype $class]} } @@ -650,7 +649,7 @@ set kind [lindex $definition 2] set name [lindex $definition 3] } else { - set prefix [expr {[::nsf::objectproperty class $obj] ? "inst" : ""}] + set prefix [expr {[::nsf::is class $obj] ? "inst" : ""}] set kind $modifier set name [lindex $definition 2] } @@ -689,7 +688,7 @@ # support for XOTcl specific convenience routines Object instproc hasclass cl { - if {![::nsf::objectproperty class $cl]} {return 0} + if {![::nsf::is class $cl]} {return 0} if {[my ::nsf::cmd::ObjectInfo::hasmixin $cl]} {return 1} ::nsf::dispatch [self] ::nsf::cmd::ObjectInfo::hastype $cl } Index: library/xotcl/tests/testx.xotcl =================================================================== diff -u -r5afef6111e8c64d8035a90aa683ff077a5cf1d91 -rd9b42d77f43db84a9983cc3bbc4124cf0b52df29 --- library/xotcl/tests/testx.xotcl (.../testx.xotcl) (revision 5afef6111e8c64d8035a90aa683ff077a5cf1d91) +++ library/xotcl/tests/testx.xotcl (.../testx.xotcl) (revision d9b42d77f43db84a9983cc3bbc4124cf0b52df29) @@ -2622,9 +2622,9 @@ # class hierarchy copy Class O X copy O::X - ::errorCheck "[::xotcl::is O::X object]" 1 "O::X is an object" - ::errorCheck "[::xotcl::is O::X::Y object]" 1 "O::X::Y is an object" - ::errorCheck "[::xotcl::is O::X::Y::Z object]" 1 "O::X::Y::Z is an object" + ::errorCheck "[::xotcl::is object O::X]" 1 "O::X is an object" + ::errorCheck "[::xotcl::is object O::X::Y]" 1 "O::X::Y is an object" + ::errorCheck "[::xotcl::is object O::X::Y::Z]" 1 "O::X::Y::Z is an object" O::X x1; O::X::Y y1; O::X::Y::Z z1 @@ -3467,8 +3467,8 @@ ::errorCheck [M isclass] 0 "is isclass 0" ::errorCheck [Class info instances M] "" "is not an instance of Class" ::errorCheck [Object isclass m1] 1 "m1 is still a class" - ::errorCheck [::xotcl::is m1 object] 1 "m1 is still an object" - ::errorCheck [::xotcl::is m1 class] 1 "m1 is still a class" + ::errorCheck [::xotcl::is object m1] 1 "m1 is still an object" + ::errorCheck [::xotcl::is class m1] 1 "m1 is still a class" ::errorCheck [::xotcl::relation m1 class] ::xotcl::Class "m1 now a baseclass" ::errorCheck [m1 info class] ::xotcl::Class "m1 is now an instance of Class" Index: tests/destroytest.tcl =================================================================== diff -u -r3754364287df2dfdf79b81dfa69224eae19cf691 -rd9b42d77f43db84a9983cc3bbc4124cf0b52df29 --- tests/destroytest.tcl (.../destroytest.tcl) (revision 3754364287df2dfdf79b81dfa69224eae19cf691) +++ tests/destroytest.tcl (.../destroytest.tcl) (revision d9b42d77f43db84a9983cc3bbc4124cf0b52df29) @@ -381,8 +381,8 @@ ? "set ::firstDestroy" 0 "firstDestroy called" ? "set ::ObjectDestroy" 0 "ObjectDestroy called" ? {::nsf::isobject c1} 1 "object still exists in proc" - #? {::nsf::objectproperty class ::C} 0 "class still exists in proc" - ? {::nsf::objectproperty class ::C} 1 "class still exists in proc" + #? {::nsf::is class ::C} 0 "class still exists in proc" + ? {::nsf::is class ::C} 1 "class still exists in proc" } C create c1 c1 foo @@ -413,13 +413,13 @@ ? [:info class] ::C "object reclassed" #? [:info class] ::xotcl::Object "object reclassed" ? {::nsf::isobject ::C::c1} 1 "object still exists in proc" - ? {::nsf::objectproperty class ::C} 1 "class still exists in proc" + ? {::nsf::is class ::C} 1 "class still exists in proc" } C create ::C::c1 C::c1 foo #puts stderr ======[::nsf::isobject ::C::c1] ? {::nsf::isobject ::C::c1} 0 "object still exists after proc" -? {::nsf::objectproperty class ::C} 0 "class still exists after proc" +? {::nsf::is class ::C} 0 "class still exists after proc" ? "set ::firstDestroy" 1 "firstDestroy called" ? "set ::ObjectDestroy" 1 "ObjectDestroy called" @@ -532,12 +532,12 @@ # reuse the namespace for a class/object Class create ::module - ? {::nsf::objectproperty class ::module} 1 + ? {::nsf::is class ::module} 1 # delete the object/class ... and namespace ::module destroy - ? {::nsf::objectproperty class ::module} 0 + ? {::nsf::is class ::module} 0 } Test case namespace-import { @@ -551,24 +551,24 @@ Class create ::module { :create mod1 } - ? {::nsf::objectproperty class ::module::Foo} 1 - ? {::nsf::objectproperty class ::module::foo} 0 + ? {::nsf::is class ::module::Foo} 1 + ? {::nsf::is class ::module::foo} 0 ? {::nsf::isobject ::module::foo} 1 - ? {::nsf::objectproperty class ::module} 1 + ? {::nsf::is class ::module} 1 Object create ::o { :require namespace } namespace eval ::o {namespace import ::module::*} - ? {::nsf::objectproperty class ::o::Foo} 1 + ? {::nsf::is class ::o::Foo} 1 ? {::nsf::isobject ::o::foo} 1 # do not destroy namespace imported objects/classes ::o destroy - ? {::nsf::objectproperty class ::o::Foo} 0 + ? {::nsf::is class ::o::Foo} 0 ? {::nsf::isobject ::o::foo} 0 - ? {::nsf::objectproperty class ::module::Foo} 1 + ? {::nsf::is class ::module::Foo} 1 ? {::nsf::isobject ::module::foo} 1 ::module destroy Index: tests/doc.tcl =================================================================== diff -u -re29308a6c15da697df375716a3ae3787ade64218 -rd9b42d77f43db84a9983cc3bbc4124cf0b52df29 --- tests/doc.tcl (.../doc.tcl) (revision e29308a6c15da697df375716a3ae3787ade64218) +++ tests/doc.tcl (.../doc.tcl) (revision d9b42d77f43db84a9983cc3bbc4124cf0b52df29) @@ -391,7 +391,7 @@ set cbp [CommentBlockParser process $block] ? [list $cbp status ? COMPLETED] 1 set entity [$cbp current_entity] - ? [list ::nsf::is $entity object] 1 + ? [list ::nsf::is object $entity] 1 ? [list $entity info has type ::nx::doc::@object] 1 ? [list $entity @author] "stefan.sobernig@wu.ac.at gustaf.neumann@wu-wien.ac.at"; ? [list $entity as_text] "some more text and another line for the description"; @@ -408,7 +408,7 @@ ? [list $cbp status ? COMPLETED] 1 set entity [$cbp current_entity] - ? [list ::nsf::is $entity object] 1 + ? [list ::nsf::is object $entity] 1 ? [list $entity info has type ::nx::doc::@command] 1 ? [list $entity as_text] "some text on the command"; ? [list $entity @see] "::o"; @@ -426,7 +426,7 @@ ? [list $cbp status ? COMPLETED] 1 set entity [$cbp current_entity] - ? [list ::nsf::is $entity object] 1 + ? [list ::nsf::is object $entity] 1 ? [list $entity info has type ::nx::doc::@class] 1 ? [list $entity as_text] "some text on the class entity"; ? [list llength [$entity @param]] 1 @@ -467,21 +467,21 @@ eval $script doc process ::Foo set entity [@class id ::Foo] - ? [list ::nsf::is $entity object] 1 + ? [list ::nsf::is object $entity] 1 ? [list $entity info has type ::nx::doc::@class] 1 ? [list $entity as_text] "The class Foo defines the behaviour for all Foo objects"; ? [list $entity @author] "gustaf.neumann@wu-wien.ac.at ssoberni@wu.ac.at" # TODO: Fix the [@param id] programming scheme to allow (a) for # entities to be passed and the (b) documented structures #set entity [@param id ::Foo class attr1] set entity [@param id $entity attr1] - ? [list ::nsf::is $entity object] 1 + ? [list ::nsf::is object $entity] 1 ? [list $entity info has type ::nx::doc::@param] 1 ? [list $entity @see] "::nx::Attribute ::nx::MetaSlot"; set entity [@method id ::Foo class foo] ? [list [@class id ::Foo] @method] $entity - ? [list ::nsf::is $entity object] 1 + ? [list ::nsf::is object $entity] 1 ? [list $entity info has type ::nx::doc::@method] 1 ? [list $entity as_text] "This describes the foo method"; @@ -565,7 +565,7 @@ set i [doc process $script] set entity [@class id ::Bar] - ? [list $i eval [list ::nsf::is $entity object]] 1 + ? [list $i eval [list ::nsf::is object $entity]] 1 ? [list $i eval [list $entity info has type ::nx::doc::@class]] 1 ? [list $i eval [list $entity as_text]] "The class Bar defines the behaviour for all Bar objects"; ? [list $i eval [list $entity @author]] "gustaf.neumann@wu-wien.ac.at ssoberni@wu.ac.at" @@ -574,13 +574,13 @@ # entities to be passed and the (b) documented structures #set entity [@param id ::Bar class attr1] set entity [@param id $entity attr1] - ? [list $i eval [list ::nsf::is $entity object]] 1 + ? [list $i eval [list ::nsf::is object $entity]] 1 ? [list $i eval [list $entity info has type ::nx::doc::@param]] 1 ? [list $i eval [list $entity @see]] "::nx::Attribute ::nx::MetaSlot"; set entity [@method id ::Bar class foo] ? [list $i eval [list [@class id ::Bar] @method]] $entity - ? [list $i eval [list ::nsf::is $entity object]] 1 + ? [list $i eval [list ::nsf::is object $entity]] 1 ? [list $i eval [list $entity info has type ::nx::doc::@method]] 1 ? [list $i eval [list $entity as_text]] "This describes the foo method in the method body"; @@ -592,7 +592,7 @@ } set entity [@method id ::Bar object foo] ? [list $i eval [list [@class id ::Bar] @object-method]] $entity - ? [list $i eval [list ::nsf::is $entity object]] 1 + ? [list $i eval [list ::nsf::is object $entity]] 1 ? [list $i eval [list $entity info has type ::nx::doc::@method]] 1 ? [list $i eval [list $entity as_text]] "This describes the per-object foo method in the method body"; @@ -617,7 +617,7 @@ # error $msg # } # } - # ? [list $i eval [list ::nsf::is [@package id nx::doc] object]] 1 + # ? [list $i eval [list ::nsf::is object [@package id nx::doc]]] 1 # puts stderr [$i eval [list [@package id nx::doc] text]] # puts stderr [$i eval [list [@package id nx::doc] @require]] # set path [file join /tmp nextdoc] Index: tests/info-method.tcl =================================================================== diff -u -r1a67ad0bf0b5c2092e1558d13659bad489f5bb75 -rd9b42d77f43db84a9983cc3bbc4124cf0b52df29 --- tests/info-method.tcl (.../info-method.tcl) (revision 1a67ad0bf0b5c2092e1558d13659bad489f5bb75) +++ tests/info-method.tcl (.../info-method.tcl) (revision d9b42d77f43db84a9983cc3bbc4124cf0b52df29) @@ -100,7 +100,7 @@ ? {o bar} Class.bar ? {o method foo {} {return o.foo}} "::o::foo" - ? {o alias is ::nsf::objectproperty} "::o::is" + ? {o alias is ::nsf::is} "::o::is" ? {o setter x} "::o::x" ? {lsort [o info methods]} "foo is x" Index: tests/object-system.tcl =================================================================== diff -u -rd9c5a4b5c33bfa0bdb33ef52bd703390d933eb98 -rd9b42d77f43db84a9983cc3bbc4124cf0b52df29 --- tests/object-system.tcl (.../object-system.tcl) (revision d9c5a4b5c33bfa0bdb33ef52bd703390d933eb98) +++ tests/object-system.tcl (.../object-system.tcl) (revision d9b42d77f43db84a9983cc3bbc4124cf0b52df29) @@ -17,57 +17,57 @@ } ? {::nsf::isobject Object} 1 -? {::nsf::objectproperty class Object} 1 -? {::nsf::objectproperty metaclass Object} 0 +? {::nsf::is class Object} 1 +? {::nsf::is metaclass Object} 0 ? {Object info superclass} "" ? {Object info class} ::nx::Class ? {::nsf::isobject Class} 1 -? {::nsf::objectproperty class Class} 1 -? {::nsf::objectproperty metaclass Class} 1 +? {::nsf::is class Class} 1 +? {::nsf::is metaclass Class} 1 ? {Class info superclass} ::nx::Object ? {Class info class} ::nx::Class Object create o ? {::nsf::isobject Object} 1 -? {::nsf::objectproperty class o} 0 -? {::nsf::objectproperty metaclass o} 0 +? {::nsf::is class o} 0 +? {::nsf::is metaclass o} 0 ? {o info class} ::nx::Object ? {Object info instances o} ::o ? {Object info instances ::o} ::o Class create C0 -? {::nsf::objectproperty class C0} 1 -? {::nsf::objectproperty metaclass C0} 0 +? {::nsf::is class C0} 1 +? {::nsf::is metaclass C0} 0 ? {C0 info superclass} ::nx::Object ? {C0 info class} ::nx::Class #? {lsort [Class info vars]} "__default_metaclass __default_superclass" Class create M -superclass ::nx::Class ? {::nsf::isobject M} 1 -? {::nsf::objectproperty class M} 1 -? {::nsf::objectproperty metaclass M} 1 +? {::nsf::is class M} 1 +? {::nsf::is metaclass M} 1 ? {M info superclass} ::nx::Class ? {M info class} ::nx::Class M create C ? {::nsf::isobject C} 1 -? {::nsf::objectproperty class C} 1 -? {::nsf::objectproperty metaclass C} 0 +? {::nsf::is class C} 1 +? {::nsf::is metaclass C} 0 ? {C info superclass} ::nx::Object ? {C info class} ::M C create c1 ? {::nsf::isobject c1} 1 -? {::nsf::objectproperty class c1} 0 -? {::nsf::objectproperty metaclass c1} 0 +? {::nsf::is class c1} 0 +? {::nsf::is metaclass c1} 0 ? {c1 info class} ::C Class create M2 -superclass M ? {::nsf::isobject M2} 1 -? {::nsf::objectproperty class M2} 1 -? {::nsf::objectproperty metaclass M2} 1 +? {::nsf::is class M2} 1 +? {::nsf::is metaclass M2} 1 ? {M2 info superclass} ::M ? {M2 info class} ::nx::Class @@ -79,12 +79,12 @@ # meta-class and set subclass of M to the root meta-class M destroy ? {::nsf::isobject C} 1 -? {::nsf::objectproperty class C} 1 -? {::nsf::objectproperty metaclass C} 0 +? {::nsf::is class C} 1 +? {::nsf::is metaclass C} 0 ? {C info superclass} ::nx::Object ? {C info class} ::nx::Class -? {::nsf::objectproperty metaclass M2} 1 +? {::nsf::is metaclass M2} 1 ? {M2 info superclass} ::nx::Class ? {m2 info superclass} ::nx::Object ? {m2 info class} ::M2 @@ -93,9 +93,9 @@ # destroy class M, reclass class instances to the base class C destroy ? {::nsf::isobject c1} 1 -? {::nsf::objectproperty object c1} 1 -? {::nsf::objectproperty class c1} 0 -? {::nsf::objectproperty metaclass c1} 0 +? {::nsf::is object c1} 1 +? {::nsf::is class c1} 0 +? {::nsf::is metaclass c1} 0 ? {c1 info class} ::nx::Object # basic parameter tests @@ -148,14 +148,14 @@ ::nsf::createobjectsystem ::object ::class ? {::nsf::isobject ::object} 1 -? {::nsf::objectproperty class ::object} 1 -? {::nsf::objectproperty metaclass ::object} 0 +? {::nsf::is class ::object} 1 +? {::nsf::is metaclass ::object} 0 ? {::nsf::relation ::object class} ::class ? {::nsf::relation ::object superclass} "" ? {::nsf::isobject ::class} 1 -? {::nsf::objectproperty class ::class} 1 -? {::nsf::objectproperty metaclass ::class} 1 +? {::nsf::is class ::class} 1 +? {::nsf::is metaclass ::class} 1 ? {::nsf::relation ::class class} ::class ? {::nsf::relation ::class superclass} ::object @@ -167,24 +167,24 @@ ::class + C ? {::nsf::isobject ::C} 1 -? {::nsf::objectproperty class ::C} 1 -? {::nsf::objectproperty metaclass ::C} 0 +? {::nsf::is class ::C} 1 +? {::nsf::is metaclass ::C} 0 ? {::nsf::relation ::C class} ::class ? {::nsf::relation ::C superclass} ::object # create an instance of C C + c1 ? {::nsf::isobject ::c1} 1 -? {::nsf::objectproperty class ::c1} 0 -? {::nsf::objectproperty metaclass ::c1} 0 +? {::nsf::is class ::c1} 0 +? {::nsf::is metaclass ::c1} 0 ? {::nsf::relation ::c1 class} ::C # destroy instance and class c1 - ? {::nsf::isobject ::c1} 0 -? {::nsf::objectproperty class ::C} 1 +? {::nsf::is class ::C} 1 C - @@ -194,7 +194,7 @@ ? {catch {::C info has type ::UNKNOWN}} 1 ? {catch {::C info has type ::xyz::Bar}} 1 -#? {catch {::nsf::objectproperty type ::CCCC ::nx::Object}} 1 +#? {catch {::nsf::is type ::CCCC ::nx::Object}} 1 ::C destroy Index: tests/parameters.tcl =================================================================== diff -u -rd9c5a4b5c33bfa0bdb33ef52bd703390d933eb98 -rd9b42d77f43db84a9983cc3bbc4124cf0b52df29 --- tests/parameters.tcl (.../parameters.tcl) (revision d9c5a4b5c33bfa0bdb33ef52bd703390d933eb98) +++ tests/parameters.tcl (.../parameters.tcl) (revision d9b42d77f43db84a9983cc3bbc4124cf0b52df29) @@ -28,8 +28,8 @@ ? {::nsf::isobject o1} 1 ? {::nsf::isobject o1000} 0 - ? {::nsf::objectproperty class C} 1 - ? {::nsf::is C class} 1 + ? {::nsf::is class C} 1 + ? {::nsf::is class C} 1 ? {C info is class} 1 ? {::nsf::parametercheck object o1} 1 @@ -45,26 +45,26 @@ #? {::nsf::parametercheck hasmixin,arg=::M c1} 1 - #? {::nsf::objectproperty type c1 C} 1 + #? {::nsf::is type c1 C} 1 ? {c1 info has type C} 1 ? {c1 info has type C1} {expected class but got "C1" for parameter class} - #? {::nsf::is c1 object -type C} 1 + #? {::nsf::is object c1 -type C} 1 ? {c1 ::nsf::cmd::ObjectInfo::hastype C} 1 ? {::nsf::dispatch c1 ::nsf::cmd::ObjectInfo::hastype C} 1 - #? {::nsf::is c1 object -hasmixin M -type C} 1 - #? {::nsf::is c1 object -hasmixin M1 -type C} 0 - #? {::nsf::is c1 object -hasmixin M -type C0} 0 - ? {::nsf::is o1 object} 1 - ? {::nsf::is o100 object} 0 - ? {::nsf::is 1 integer} 1 - ? {::nsf::is c1 object,type=::C} 1 - ? {::nsf::is o object,type=::C} 0 + #? {::nsf::is object c1 -hasmixin M -type C} 1 + #? {::nsf::is object c1 -hasmixin M1 -type C} 0 + #? {::nsf::is object c1 -hasmixin M -type C0} 0 + ? {::nsf::is object o1} 1 + ? {::nsf::is object o100} 0 + ? {::nsf::is integer 1} 1 + ? {::nsf::is object,type=::C c1} 1 + ? {::nsf::is object,type=::C o} 0 - #? {::nsf::is c1 type C} 1 - #? {::nsf::is o type C} 0 - #? {::nsf::is o object -type C} 0 - #? {::nsf::is o object -hasmixin C} 0 + #? {::nsf::is type c1 C} 1 + #? {::nsf::is type o C} 0 + #? {::nsf::is object o -type C} 0 + #? {::nsf::is object o -hasmixin C} 0 #exit ? {::nsf::parametercheck class o1} {expected class but got "o1" for parameter value} ? {::nsf::parametercheck -nocomplain class o1} 0