Skip to content
Tcl Source Code History Of Ticket 218695ffffffffffffffffffffffffffffffffff
Login

History Of Ticket 218695ffffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 218695ffffffffffffffffffffffffffffffffff

  1. Ticket change [e3f0c20fa4] (rid 87879) by nobody on 2000-10-26 01:04:13:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 1775 RFE
      Version: 8.0.5
      SubmitDate: '1999-04-09'
      LastModified: '1999-09-15'
      Severity: LOW
      Status: Released
      Submitter: pat
      ChangedBy: hobbs
      OS: Solaris
      OSVersion: 5.5.1
      Machine: Other
      FixedDate: '1999-09-15'
      FixedInVersion: 8.3b1
      ClosedDate: '2000-10-25'
      
      
      Name:
      
      scott murdock
      
      
      Extensions:
      
      tclx tcl-dp img itcl
      
      
      Comments:
      
      This is simpler and faster than a loop to get the names to unset. The
      
          alternative of a separate array for the subset may not be appropriate
      
          for a given program.
      
      
          I just copied the array names code and modified it a little.
      
      
          The only thing about this that is specific to 8.0.5 is the patch line
      
          numbers.
      
      
      DesiredBehavior:
      
      enables unsetting a selected set of array elements, using a name
      
          pattern,
      
          eg.  array unset foo xyz,*
      
      
      Patch:
      
      *** generic/tclVar.c.orig       Tue Feb  2 16:55:06 1999
      
      --- generic/tclVar.c    Thu Apr  8 18:04:21 1999
      
      ***************
      
      *** 2872,2881 ****
      
      
            enum {ARRAY_ANYMORE, ARRAY_DONESEARCH,  ARRAY_EXISTS, ARRAY_GET,
      
                ARRAY_NAMES, ARRAY_NEXTELEMENT, ARRAY_SET, ARRAY_SIZE,
      
      !         ARRAY_STARTSEARCH}; 
      
            static char *arrayOptions[] = {"anymore", "donesearch", "exists",
      
                                         "get", "names", "nextelement", "set", "size", "startsearch", 
      
      !                                  (char *) NULL};
      
      
            Var *varPtr, *arrayPtr;
      
            Tcl_HashEntry *hPtr;
      
      --- 2872,2881 ----
      
      
            enum {ARRAY_ANYMORE, ARRAY_DONESEARCH,  ARRAY_EXISTS, ARRAY_GET,
      
                ARRAY_NAMES, ARRAY_NEXTELEMENT, ARRAY_SET, ARRAY_SIZE,
      
      !         ARRAY_STARTSEARCH, ARRAY_UNSET}; 
      
            static char *arrayOptions[] = {"anymore", "donesearch", "exists",
      
                                         "get", "names", "nextelement", "set", "size", "startsearch", 
      
      !                                  "unset", (char *) NULL};
      
      
            Var *varPtr, *arrayPtr;
      
            Tcl_HashEntry *hPtr;
      
      ***************
      
      *** 3233,3238 ****
      
      --- 3233,3271 ----
      
                          &searchPtr->search);
      
                  searchPtr->nextPtr = varPtr->searchPtr;
      
                  varPtr->searchPtr = searchPtr;
      
      +           break;
      
      +       }
      
      +         case ARRAY_UNSET: {
      
      +           Tcl_HashSearch search;
      
      +           Var *varPtr2;
      
      +           char *pattern = NULL;
      
      +           char *name;
      
      +           Tcl_Obj *namePtr;
      
      +           
      
      +           if ((objc != 3) && (objc != 4)) {
      
      +               Tcl_WrongNumArgs(interp, 2, objv, "arrayName ?pattern?");
      
      +               return TCL_ERROR;
      
      +           }
      
      +           if (notArray) {
      
      +               return TCL_OK;
      
      +           }
      
      +           if (objc == 4) {
      
      +               pattern = Tcl_GetStringFromObj(objv[3], (int *) NULL);
      
      +           }
      
      +           for (hPtr = Tcl_FirstHashEntry(varPtr->value.tablePtr, &search);
      
      +                   hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
      
      +               varPtr2 = (Var *) Tcl_GetHashValue(hPtr);
      
      +               if (TclIsVarUndefined(varPtr2)) {
      
      +                   continue;
      
      +               }
      
      +               name = Tcl_GetHashKey(varPtr->value.tablePtr, hPtr);
      
      +               if ((objc == 4) && !Tcl_StringMatch(name, pattern)) {
      
      +                   continue;   /* element name doesn't match pattern */
      
      +               }
      
      +               if (Tcl_UnsetVar2(interp, varName, name, 0) != TCL_OK) {
      
      +                   return TCL_ERROR;
      
      +               }
      
      +           }
      
                  break;
      
              }
      
            }
      
      
      PatchFiles:
      
      generic/tclVar.c
      
      
      
      
      Added to 8.3 with minor mods. 
      -- 09/15/1999 hobbs
      
    4. foundin initialized to: "final: 8.0.5"
    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: "add array unset subcommand."
    11. type initialized to: "RFE"
  2. Ticket change [dbb8dbbf6d] (rid 108008) by welch on 2000-10-26 08:27:11:

    1. closedate changed to: "2000-10-26T01:27:11"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  3. Ticket change [ea55d528bf] (rid 103356) by dgp on 2001-04-21 03:49:30:

    1. foundin changed to: "None"
    2. status changed to: "Open"
    3. subsystem changed to: "None"
  4. Ticket change [6af9e38910] (rid 128240) by dgp on 2001-04-21 03:50:09:

    1. closedate changed to: "2001-04-20T20:50:09"
    2. closer changed to: "dgp"
    3. status changed to: "Closed"
    4. subsystem changed to: "07. Variables"