Index: generic/gentclAPI.decls =================================================================== diff -u -r7050a52ac53992d9a3aec12e48b0fa58a26449e6 -r7d9452f6a7cc8b99fd09058dfbb8992e0cba5b9e --- generic/gentclAPI.decls (.../gentclAPI.decls) (revision 7050a52ac53992d9a3aec12e48b0fa58a26449e6) +++ generic/gentclAPI.decls (.../gentclAPI.decls) (revision 7d9452f6a7cc8b99fd09058dfbb8992e0cba5b9e) @@ -51,6 +51,10 @@ xotclCmd dot XOTclDotCmd { {-argName "args" -type allargs} } +xotclCmd exists XOTclExistsCmd { + {-argName "object" -required 1 -type object} + {-argName "var" -required 1} +} xotclCmd finalize XOTclFinalizeObjCmd { } xotclCmd interp XOTclInterpObjCmd { Index: generic/predefined.h =================================================================== diff -u -r9258921e23a23575d69276bfe1e6afe7ba80ce74 -r7d9452f6a7cc8b99fd09058dfbb8992e0cba5b9e --- generic/predefined.h (.../predefined.h) (revision 9258921e23a23575d69276bfe1e6afe7ba80ce74) +++ generic/predefined.h (.../predefined.h) (revision 7d9452f6a7cc8b99fd09058dfbb8992e0cba5b9e) @@ -109,7 +109,6 @@ "::xotcl::alias ::xotcl2::classInfo [namespace tail $cmd] $cmd}\n" "foreach cmd [info command ::xotcl::cmd::ClassInfo::*] {\n" "set cmdName [namespace tail $cmd]\n" -"if {$cmdName in [list \"instfilter\" \"instforward\" \"instmixin\" \"instmixinguard\" \"instparams\"]} continue\n" "::xotcl::alias ::xotcl2::classInfo $cmdName $cmd}\n" "unset cmd\n" "Object forward info -onerror ::xotcl::infoError ::xotcl2::objectInfo %1 {%@2 %self}\n" Index: generic/predefined.xotcl =================================================================== diff -u -r9258921e23a23575d69276bfe1e6afe7ba80ce74 -r7d9452f6a7cc8b99fd09058dfbb8992e0cba5b9e --- generic/predefined.xotcl (.../predefined.xotcl) (revision 9258921e23a23575d69276bfe1e6afe7ba80ce74) +++ generic/predefined.xotcl (.../predefined.xotcl) (revision 7d9452f6a7cc8b99fd09058dfbb8992e0cba5b9e) @@ -221,7 +221,6 @@ } foreach cmd [info command ::xotcl::cmd::ClassInfo::*] { set cmdName [namespace tail $cmd] - if {$cmdName in [list "instfilter" "instforward" "instmixin" "instmixinguard" "instparams"]} continue ::xotcl::alias ::xotcl2::classInfo $cmdName $cmd } unset cmd Index: generic/tclAPI.h =================================================================== diff -u -r7050a52ac53992d9a3aec12e48b0fa58a26449e6 -r7d9452f6a7cc8b99fd09058dfbb8992e0cba5b9e --- generic/tclAPI.h (.../tclAPI.h) (revision 7050a52ac53992d9a3aec12e48b0fa58a26449e6) +++ generic/tclAPI.h (.../tclAPI.h) (revision 7d9452f6a7cc8b99fd09058dfbb8992e0cba5b9e) @@ -173,6 +173,7 @@ static int XOTclDeprecatedCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclDispatchCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclDotCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); +static int XOTclExistsCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclFinalizeObjCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclGetSelfObjCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclImportvarCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); @@ -255,6 +256,7 @@ static int XOTclDeprecatedCmd(Tcl_Interp *interp, char *what, char *oldCmd, char *newCmd); static int XOTclDispatchCmd(Tcl_Interp *interp, XOTclObject *object, int withObjscope, int withNoassertions, Tcl_Obj *command, int nobjc, Tcl_Obj *CONST nobjv[]); static int XOTclDotCmd(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); +static int XOTclExistsCmd(Tcl_Interp *interp, XOTclObject *object, char *var); static int XOTclFinalizeObjCmd(Tcl_Interp *interp); static int XOTclGetSelfObjCmd(Tcl_Interp *interp, int selfoption); static int XOTclImportvarCmd(Tcl_Interp *interp, XOTclObject *object, int nobjc, Tcl_Obj *CONST nobjv[]); @@ -338,6 +340,7 @@ XOTclDeprecatedCmdIdx, XOTclDispatchCmdIdx, XOTclDotCmdIdx, + XOTclExistsCmdIdx, XOTclFinalizeObjCmdIdx, XOTclGetSelfObjCmdIdx, XOTclImportvarCmdIdx, @@ -1731,6 +1734,25 @@ } static int +XOTclExistsCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + parseContext pc; + + if (ArgumentParse(interp, objc, objv, NULL, objv[0], + method_definitions[XOTclExistsCmdIdx].paramDefs, + method_definitions[XOTclExistsCmdIdx].nrParameters, + &pc) != TCL_OK) { + return TCL_ERROR; + } else { + XOTclObject *object = (XOTclObject *)pc.clientData[0]; + char *var = (char *)pc.clientData[1]; + + parseContextRelease(&pc); + return XOTclExistsCmd(interp, object, var); + + } +} + +static int XOTclFinalizeObjCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { parseContext pc; @@ -2292,6 +2314,10 @@ {"::xotcl::dot", XOTclDotCmdStub, 1, { {"args", 0, 0, convertToNothing}} }, +{"::xotcl::exists", XOTclExistsCmdStub, 2, { + {"object", 1, 0, convertToObject}, + {"var", 1, 0, convertToString}} +}, {"::xotcl::finalize", XOTclFinalizeObjCmdStub, 0, { } }, Index: generic/xotcl.c =================================================================== diff -u -r6db1260f0b59b82fa839fdd841138c413ce00c8b -r7d9452f6a7cc8b99fd09058dfbb8992e0cba5b9e --- generic/xotcl.c (.../xotcl.c) (revision 6db1260f0b59b82fa839fdd841138c413ce00c8b) +++ generic/xotcl.c (.../xotcl.c) (revision 7d9452f6a7cc8b99fd09058dfbb8992e0cba5b9e) @@ -10642,6 +10642,14 @@ } /* + * ::xotcl::exists command + */ +static int XOTclExistsCmd(Tcl_Interp *interp, XOTclObject *obj, char *var) { + Tcl_SetIntObj(Tcl_GetObjResult(interp), varExists(interp, obj, var, NULL, 1, 1)); + return TCL_OK; +} + +/* * ::xotcl::finalize command */ static int destroyObjectSystems(Tcl_Interp *interp);