Is this a bug - list handling in TCL 8.0 
Author Message
 Is this a bug - list handling in TCL 8.0

Hi all.

  Is this a bug?

       coorong> tclsh8.0
       % set a {abc"def}
       abc"def
       % set b {"defg}
       "defg
       % llength $a
       1
       % llength $b
       unmatched open quote in list
       %

  I can't see why the llength of 'b' should fail.

  I am running tcl 8.0 patch level 2 on Solaris 2.6, (Yes, yes, I know we
will be upgrading to 8.0.4 next week).

  Do other people get this behaviour?

  Is this a bug, do I just not understand the issues, or is there some
inhumanly subtle quoting problem occuring that I just can't see?

--
-

; The Australian National University,        Australia     :  (02) 6279 8390
; Canberra,         Australia                International : +61 2 6279 8390



Tue, 10 Jul 2001 03:00:00 GMT  
 Is this a bug - list handling in TCL 8.0

Quote:

>       % set b {"defg}
>       "defg
>       % llength $b
>       unmatched open quote in list

>  I can't see why the llength of 'b' should fail.

Not all strings are valid Tcl lists.  The value of the variable 'b'
is not a valid Tcl list because you never finshed quoting its first
element.  That's what the error message tells you.

Are you sure you don't want [string length] ?

If you need 'b' to hold a list of one element, the literal string: "defg
you create it like so:

% set b [list {"defg}]
{"defg}
% llength $b
1
% lindex $b 0
"defg

--
| Don Porter, D.Sc.   Mathematical and Computational Sciences Division |

| http://math.nist.gov/mcsd/Staff/DPorter/                        NIST |
|______________________________________________________________________|



Tue, 10 Jul 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Bug Found in Tcl 8.0/Tk 8.0

2. Combine Tcl/Tk/Tix (8.0) and Xt/Motif event handling

3. BUG WITH TCL > 8.0 - CHARACTERS

4. Tcl 8.0 popen bug?

5. Tcl/Tk 8.0 Oddities (Bugs ?)

6. Bug in tcl/tk/tix 8.0

7. Tcl 8.0 Bug?

8. BUG+FIX: tcl 8.0: Tcl_PushCallFrame causes crash

9. Tcl 8.0 BUG when creating invalid line in canvas

10. bug in Tcl 8.0 on windows?

11. TCL 8.0 Bug/Feature? /dev/tty automagic behavior

12. BUG in tcl 8.0: string compare ignores locale

 

 
Powered by phpBB® Forum Software