machineghost schrieb:
>zip(text, list(repeat(BR(), text.length)));
> [["This", br], ["is", br], ["a", br], ["test", br]]

Right, this works, since you're using an array here. This is basically 
the same as my Test 1.

Thanks for pointing out that zip should only be used with arrays, not 
with iterators. I did not expect that the docs for zip need to be taken 
so literally, and I'm still not sure that this is the problem. For 
instance, the following works as expected:

zip(text, repeat("*"));

And if you replace zip with izip (which *is* an Iter library function), 
the Test 2 does not work either. As I understand the difference between 
zip and izip is that izip returns an iterator instead of an array, but I 
would expect of an Iter lib function that it also takes iterators as 
input, and the documentation does not claim otherwise here.

The following does not work, either:

list(izip(text, repeat(BR()));

So I'm still puzzled.

 > I think appendChildNodes handles flattening that mess for you, but if
 > not just use the function.

Yes, as I already wrote, you don't need to flatten since this is done 
implicitly. My Test 1 works nicely, without flattening.

-- Christoph

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to