Skip to content
Tcl Source Code History Of Ticket 217966ffffffffff
Login

History Of Ticket 217966ffffffffff

Artifacts Associated With Ticket 217966ffffffffff

  1. Ticket change [cd83450373] (rid 95904) by nobody on 2000-10-26 00:46:54:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 4666 RFE
      Version: 8.3
      SubmitDate: '2000-03-28'
      LastModified: '2000-03-28'
      Severity: LOW
      Status: Closed
      Submitter: techsupp
      ChangedBy: ericm
      RelatedBugIDs: 4665
      OS: Windows NT
      OSVersion: 4.0sp5
      FixedDate: '2000-10-25'
      ClosedDate: '2000-03-28'
      
      
      Name:
      
      Vince Darley
      
      
      CVS:
      
      Tues March 28 2000
      
      
      Comments:
      
      Compiles and runs fine on WinNT, since it's a simple generic patch, I
      
          assume it will work on Unix/MacOS too.
      
      
      DesiredBehavior:
      
      simple addition of 'namespace exists' so we can quickly and easily test if a namespace exists without special-casing children ns/with or without leading ::/...
      
      
      Patch:
      
      Index: tclNamesp.c
      
      ===================================================================
      
      RCS file: /cvsroot/tcl/generic/tclNamesp.c,v
      
      retrieving revision 1.17
      
      diff -C3 -r1.17 tclNamesp.c
      
      *** tclNamesp.c2000/03/27 22:18:561.17
      
      --- tclNamesp.c2000/03/29 00:01:43
      
      ***************
      
      *** 104,109 ****
      
      --- 104,112 ----
      
        static intNamespaceEvalCmd _ANSI_ARGS_((
      
            ClientData dummy, Tcl_Interp *interp,
      
            int objc, Tcl_Obj *CONST objv[]));
      
      + static intNamespaceExistsCmd _ANSI_ARGS_((
      
      +     ClientData dummy, Tcl_Interp *interp,
      
      +     int objc, Tcl_Obj *CONST objv[]));
      
        static intNamespaceExportCmd _ANSI_ARGS_((
      
            ClientData dummy, Tcl_Interp *interp,
      
            int objc, Tcl_Obj *CONST objv[]));
      
      ***************
      
      *** 2409,2414 ****
      
      --- 2412,2418 ----
      
         *    namespace current
      
         *    namespace delete ?name name...?
      
         *    namespace eval name arg ?arg...?
      
      +  *    namespace exists name
      
         *    namespace export ?-clear? ?pattern pattern...?
      
         *    namespace forget ?pattern pattern...?
      
         *    namespace import ?-force? ?pattern pattern...?
      
      ***************
      
      *** 2444,2455 ****
      
        {
      
            static char *subCmds[] = {
      
                    "children", "code", "current", "delete",
      
      !     "eval", "export", "forget", "import",
      
            "inscope", "origin", "parent", "qualifiers",
      
            "tail", "which", (char *) NULL};
      
            enum NSSubCmdIdx {
      
            NSChildrenIdx, NSCodeIdx, NSCurrentIdx, NSDeleteIdx,
      
      !     NSEvalIdx, NSExportIdx, NSForgetIdx, NSImportIdx,
      
            NSInscopeIdx, NSOriginIdx, NSParentIdx, NSQualifiersIdx,
      
            NSTailIdx, NSWhichIdx
      
            };
      
      --- 2448,2459 ----
      
        {
      
            static char *subCmds[] = {
      
                    "children", "code", "current", "delete",
      
      !     "eval", "exists", "export", "forget", "import",
      
            "inscope", "origin", "parent", "qualifiers",
      
            "tail", "which", (char *) NULL};
      
            enum NSSubCmdIdx {
      
            NSChildrenIdx, NSCodeIdx, NSCurrentIdx, NSDeleteIdx,
      
      !     NSEvalIdx, NSExistsIdx, NSExportIdx, NSForgetIdx, NSImportIdx,
      
            NSInscopeIdx, NSOriginIdx, NSParentIdx, NSQualifiersIdx,
      
            NSTailIdx, NSWhichIdx
      
            };
      
      ***************
      
      *** 2486,2491 ****
      
      --- 2490,2498 ----
      
                case NSEvalIdx:
      
            result = NamespaceEvalCmd(clientData, interp, objc, objv);
      
                    break;
      
      + case NSExistsIdx:
      
      +     result = NamespaceExistsCmd(clientData, interp, objc, objv);
      
      +     break;
      
                case NSExportIdx:
      
            result = NamespaceExportCmd(clientData, interp, objc, objv);
      
                    break;
      
      ***************
      
      *** 2946,2951 ****
      
      --- 2953,3006 ----
      
      
            Tcl_PopCallFrame(interp);
      
            return result;
      
      + }
      
      +  
      
      + /*
      
      +  *----------------------------------------------------------------------
      
      +  *
      
      +  * NamespaceExistsCmd --
      
      +  *
      
      +  *Invoked to implement the "namespace exists" command that returns 
      
      +  *true if the given namespace currently exists, and false otherwise.
      
      +  *Handles the following syntax:
      
      +  *
      
      +  *    namespace exists name
      
      +  *
      
      +  * Results:
      
      +  *Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong.
      
      +  *
      
      +  * Side effects:
      
      +  *Returns a result in the interpreter's result object. If anything
      
      +  *goes wrong, the result is an error message.
      
      +  *
      
      +  *----------------------------------------------------------------------
      
      +  */
      
      + 
      
      + static int
      
      + NamespaceExistsCmd(dummy, interp, objc, objv)
      
      +     ClientData dummy;/* Not used. */
      
      +     Tcl_Interp *interp;/* Current interpreter. */
      
      +     int objc;/* Number of arguments. */
      
      +     Tcl_Obj *CONST objv[];/* Argument objects. */
      
      + {
      
      +     Tcl_Namespace *namespacePtr;
      
      +     Tcl_Obj *resultPtr;
      
      + 
      
      +     if (objc != 3) {
      
      + Tcl_WrongNumArgs(interp, 2, objv, "name");
      
      + return TCL_ERROR;
      
      +     }
      
      + 
      
      +     /*
      
      +      * Check whether the given namespace exists
      
      +      */
      
      + 
      
      +     resultPtr = Tcl_GetObjResult(interp);
      
      +     if (GetNamespaceFromObj(interp, objv[2], &namespacePtr) != TCL_OK) {
      
      + return TCL_ERROR;
      
      +     }
      
      +     Tcl_SetBooleanObj(resultPtr, (namespacePtr == NULL) ? 0 : 1);
      
      +     return TCL_OK;
      
        }
      
      
        /*
      
      
      PatchFiles:
      
      tclNamesp.c
      
      
      
      
      
      
    4. foundin initialized to: "obsolete: 8.3"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "69. Other"
    10. title initialized to: "patch to provide 'namespace exists' subcommand"
    11. type initialized to: "RFE"
  2. Ticket change [9a0502a8c8] (rid 110886) by welch on 2000-10-26 08:10:56:

    1. closedate changed to: "2000-10-26T01:10:56"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  3. Ticket change [b4ed33642c] (rid 125137) by dgp on 2001-04-14 02:52:18:

    1. foundin changed to: "None"
    2. status changed to: "Open"
    3. subsystem changed to: "None"
  4. Ticket change [9d2de9aeca] (rid 96266) by dgp on 2001-04-14 02:52:53:

    1. closedate changed to: "2001-04-13T19:52:53"
    2. closer changed to: "dgp"
    3. status changed to: "Closed"
    4. subsystem changed to: "21. [namespace]"