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 - 18:22:43 CET

Kaitzschu wrote:
> On Mon, 31 Oct 2005, Donal K. Fellows wrote:
>
>> As far as I can tell, it does the right thing on the two sample cases
>> you've posted so far.
>>
>> % flatten [list \{ \}]
>> { }
>> % flatten [list [list a b] c [list d e [list f g]]]
>> a b c d e f g
>
>
> And fails this (unposted case),
> % flatten [list "fgoo bar" "boooo far"]
> fgoo bar boooo far
> which, I guess, is pretty much impossible to avoid, since lists don't
> force single whitespace.
>

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?
Received on Mon Nov 21 00:37:25 2005