Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-04-16
21:04 • Ticket [218532ffff] request for empty name array syntax support status still... artifact: a4dc8d3e90 user: dgp
2000-10-26
08:24 • Closed ticket [218532ffff]. artifact: 0434af78c4 user: welch
01:01 • New ticket [218532ffff]. artifact: 6d185b2607 user: nobody

request for empty name array syntax support

Closed / Fixed218532ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:01:49
OriginalBugID: 915 RFE
Version: 8.0.3
SubmitDate: '1998-12-04'
LastModified: '1999-08-06'
Severity: MED
Status: Released
Submitter: welch
ChangedBy: hobbs
RelatedBugIDs: 822
OS: Linux
OSVersion: Redhat 5.1
Machine: Other
FixedDate: '1999-08-06'
FixedInVersion: 8.2b1
ClosedDate: '1999-08-06'


Name:
Jean-Luc Fontaine

Extensions:
BLT 2.4, TkTable 2.3, stooop 3.6.1, scwoop 2.4, tkpiechart 5.2

CustomShell:
see small patch above.

DesiredBehavior:
support of empty named array syntax, which would add 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
}
Furthermore, it would greatly enhance stooop's performance and make it much less verbose.

Patch:
*** generic/tclCompile.c.orig   Sat Sep  5 11:00:09 1998
--- generic/tclCompile.c        Sat Sep  5 11:01:55 1998
***************
*** 3151,3157 ****
                  c = *src\;
              \}
        \}
!       if (src == name) \{
            /*
             * A '\$' by itself, not a name reference. Push a \"\$\" string.
             */
--- 3151,3157 ----
                  c = *src\;
              \}
        \}
!       if ((src == name) && (*src != '(')) \{
            /*
             * A '\$' by itself, not a name reference. Push a \"\$\" string.
             */
*** generic/tclParse.c.orig     Sat Sep  5 11:02:52 1998
--- generic/tclParse.c  Sat Sep  5 !
11:01:55 1998
***************
*** 813,819 ****
                string++\;
            \}
        \}
!       if (string == name1) \{
            if (termPtr != 0) \{
                *termPtr = string\;
            \}
--- 813,819 ----
                string++\;
            \}
        \}
!         if ((string == name1) && (*string != '(')) \{
            if (termPtr != 0) \{
                *termPtr = string\;
            \}

PatchFiles:
generic/tclCompile.c
generic/tclParse.c



A patch for Tcl 8.1 is also available: please let me know if you also want it.
I am also emailing a corresponding test suite file to Brent.

This was introduced in 8.2b1. 
-- 08/06/1999 hobbs
welch Closed ticket [218532ffff]. [History diff]2000-10-26 08:24:12
dgp Ticket [218532ffff]: 3 changes [History diff]2001-04-16 21:04:54
Log in (anonymous is fine) to add a comment.