Re: Handling pathological lists
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: Handling pathological lists

From: Bryan Oakley <oakley@bardo.clearlight.com>
Date: Mon Oct 31 2005 - 21:07:19 CET

Kaitzschu wrote:
>> You have a list with two elements, and each element is a list of two
>> elements. The result of the flatten should be a list of four elements,
>> right? You get four elements, so what's the problem?
>
>
> But I don't have sublists, I have only one list, with two elements, both
> being arbitrary strings. The fact that latter has multiple whitespace is
> not preservable. In case those are mandatory, flattening just can't be
> done without knowing nesting depth.
>

That is correct -- without you telling the flatten proc which elements
are lists and which aren't, tcl has no way of knowing. The whitespace is
preserved only as long as the string stays a string.
Received on Mon Nov 21 00:37:27 2005