#664 request for empty name array syntax support

obsolete: 8.0.3
closed-fixed
nobody
2
2001-04-16
2000-10-26
Anonymous
No

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

Discussion

  • Brent B. Welch
    Brent B. Welch
    2000-10-26

    • priority: 5 --> 2
    • status: open --> closed-fixed
     
  • Don Porter
    Don Porter
    2001-04-16

    • labels: 104246 --> 45. Parsing and Eval