Tcl Source Code

View Ticket
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2018 Conference, Houston/TX, US, Oct 15-19
Send your abstracts to
or submit via the online form by Aug 20.
Ticket UUID: 70176515d1019f8f11e18ff0cc9c7454b94c4dce
Title: Errors in list commands when list has a space before a closing quote
Type: Bug Version: 8.5.11
Submitter: migfilg Created on: 2014-01-28 16:59:04
Subsystem: 14. List Object Assigned To: dgp
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2014-01-28 19:30:41
Resolution: Invalid Closed By: dgp
    Closed on: 2014-01-28 19:30:41
Unexpected errors with (at least) lindex and lassign commands acting
on a list that has a space before a closing quote:

> lindex {x="a" y="a " z="a"}
list element in quotes followed by "a"" instead of space
> lassign {x="a" y="a " z="a"} v
list element in quotes followed by "a"" instead of space

In my view, either the quote before z is a separate list element after
'y="a' and before 'z="a"', or it matches the previous one after 'y=' 
and in both cases it will not match the next one and leave 'a"' as
a spurious continuation of a list element...

This must really be bug: compare with
> lindex {x="a" y=" a" z="a"} 0
> lindex {x="a" y=" a" z="a"} 1
> lindex {x="a" y=" a" z="a"} 2
> lindex {x="a" y=" a" z="a"} 3

Thanks in advance for any help in coping with this,
Miguel Filgueiras
User Comments: dgp added on 2014-01-28 19:30:41:
There is no bug here.


for detail on the rules for parsing the elements
of a list from a string.