Hi,<br><br><div class="gmail_quote">On 28 September 2010 15:07, Martin Tomko <span dir="ltr">&lt;<a href="mailto:martin.tomko@geo.uzh.ch">martin.tomko@geo.uzh.ch</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I want to have a function that acts only on lists of length 3 (I have a function that filters a list of lists and returns only those of that length). I guess I could change them into tuples (is there a way?)</blockquote></div>
<div><br></div><div>Well if both the producer and the consumer of this value are your own functions, you can use something other than a list. You can also implement a length indexed list, or use such an implementation but it will be overkill for this task, I think.</div>
<div><br></div><div>The two options are either implementing a wrapper type with three fields, or using a 3-tuple.</div><div>I would use a 3-tuple in both the producer and consumer functions.</div><div><br></div><div>Best,</div>
<div>Ozgur</div>