Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 096a7f09a61df36c88f233fca3d89bcd64c244e0
Ticket: 217828ffffffffffffffffffffffffffffffffff
support for empty named array
User & Date: nobody on 2000-10-26 00:44:25
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 1533 RFE
    Version: 8.1b2
    SubmitDate: '1999-03-18'
    LastModified: '1999-04-05'
    Severity: MED
    Status: Closed
    Submitter: pat
    ChangedBy: stanton
    RelatedBugIDs: 977
    OS: Linux-Red Hat
    OSVersion: 5.2
    Machine: Other
    FixedDate: '2000-10-25'
    ClosedDate: '1999-04-05'
    
    
    Name:
    
    Jean-Luc Fontaine
    
    
    
    Extensions:
    
    BLT-2.4, Tktable-2.4, stooop-3.7, scwoop-2.6, tkpiechart-5.2.2
    
    
    
    CustomShell:
    
    see above
    
    
    
    DesiredBehavior:
    
        Makes the following code possible:
    
        
    
        set ($this,m) x
    
        puts $(this,m) ;# instead of $className::($this,m)
    
        
    
        thus making the stooop extension much less verbose when accessing class
    
        data members, and much faster too!
    
        
    
        This new feature does not break anything in the Tcl core.
    
        
    
        Moreover, it would add some consistency to the core:
    
        
    
        namespace a {
    
            variable {}
    
        }
    
        set a::(x) 0
    
        puts $a::(x)  ;# works with current tcl version
    
        namespace a {
    
            set (x) 0
    
            puts $(x) ;# should work as line above
    
        }
    
        
    
    
    
    
    
    
    
    Patch:
    
    *** generic/tclParse.c.origThu Mar 18 21:46:07 1999
    
    --- generic/tclParse.cThu Mar 18 21:46:41 1999
    
    ***************
    
    *** 1580,1585 ****
    
    --- 1580,1586 ----
    
          unsigned char c;
    
          int varIndex, offset;
    
          Tcl_UniChar ch;
    
    +     unsigned array;
    
      
    
          if (numBytes >= 0) {
    
      end = string + numBytes;
    
    ***************
    
    *** 1684,1695 ****
    
          }
    
          break;
    
      }
    
      tokenPtr->size = src - tokenPtr->start;
    
    ! if (tokenPtr->size == 0) {
    
          goto justADollarSign;
    
      }
    
      parsePtr->numTokens++;
    
    ! if ((src != end) && (*src == '(')) {
    
          /*
    
           * This is a reference to an array element.  Call
    
           * ParseTokens recursively to parse the element name,
    
    --- 1685,1697 ----
    
          }
    
          break;
    
      }
    
    + array = ((src != end) && (*src == '('));
    
      tokenPtr->size = src - tokenPtr->start;
    
    ! if ((tokenPtr->size == 0) && !array) {
    
          goto justADollarSign;
    
      }
    
      parsePtr->numTokens++;
    
    ! if (array) {
    
          /*
    
           * This is a reference to an array element.  Call
    
           * ParseTokens recursively to parse the element name,
    
    *** tests/encoding.test.origSat Mar 13 19:08:19 1999
    
    --- tests/encoding.testThu Mar 18 21:46:41 1999
    
    ***************
    
    *** 260,266 ****
    
      
    
      test encoding-13.1 {LoadEscapeTable} {
    
          set x [encoding convertto iso2022 ab\u4e4e\u68d9g]
    
    ! } "\x1b(Bab\x1b$@8C\x1b$(DD%\x1b(Bg"
    
      
    
      test encoding-14.1 {BinaryProc} {
    
          encoding convertto identity \x12\x34\x56\xff\x69
    
    --- 260,266 ----
    
      
    
      test encoding-13.1 {LoadEscapeTable} {
    
          set x [encoding convertto iso2022 ab\u4e4e\u68d9g]
    
    ! } "\x1b(Bab\x1b$@8C\x1b\$(DD%\x1b(Bg"
    
      
    
      test encoding-14.1 {BinaryProc} {
    
          encoding convertto identity \x12\x34\x56\xff\x69
    
    *** tests/parseOld.test.origThu Mar 18 21:46:11 1999
    
    --- tests/parseOld.testThu Mar 18 21:46:41 1999
    
    ***************
    
    *** 185,193 ****
    
          set b
    
      } {a$!}
    
      test parseOld-5.12 {array variable substitution} {
    
    !     set b a$()
    
    !     set b
    
    ! } {a$()}
    
      catch {unset a}
    
      test parseOld-5.13 {array variable substitution} {
    
          catch {unset a}
    
    --- 185,192 ----
    
          set b
    
      } {a$!}
    
      test parseOld-5.12 {array variable substitution} {
    
    !     list [catch {set b a$()} msg] $msg
    
    ! } {1 {can't read "()": no such variable}}
    
      catch {unset a}
    
      test parseOld-5.13 {array variable substitution} {
    
          catch {unset a}
    
    
    
    
    
    
    
    
    
    PatchFiles:
    
        generic/tclParse.c
    
        tests/encoding.test
    
        tests/parseOld.test
    
        
    
    
    
    
    
    
    
    
    
  4. foundin changed to: "obsolete: 8.1b2"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to: "support for empty named array"
  11. type changed to: "Bug"