<html><head><base href="x-msg://5/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Something like<div>List = [1 , 2 , 3 , 4]</div><div>traverse n in List:</div><div> n = n + 1</div><div>Would return</div><div><br></div><div>[2,3,4,5]</div><div><br></div><div>This is really syntactic sugar for</div><div><br></div><div>map(lambda x: x=x+1, List)</div><div> </div><div><div><div>On Sep 10, 2011, at 5:33 PM, Tal Liron wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div bidimailui-detected-decoding-type="latin-charset" bgcolor="#FFFFFF" text="#000000" style="direction: ltr; ">On 09/10/2011 05:20 PM, Joshua Herman wrote:<blockquote cite="mid:CAB3V1zkgdDoNhjjhpukxtSSRLe4QnMavmxeh6DEUtDuiUp_reg@mail.gmail.com" type="cite"><pre wrap="">When I first learned python I thought lists were linked lists having
com e from a Lisp background. Although, what is probably most likely
that python could do is introduce a LinkedList class and keep the name
of Lists.
</pre></blockquote>Python has a lot of features inspired by functional languages: sequences, generators and (rather enervated) lambdas. I think the "for" and "yield" keywords support these very naturally and transparently for beginners and advanced programmers alike.<br><br>Of course, we can all implement LinkedLists, etc., on our own via classes and functions. What I'm personally missing in Python is a natural syntax for iteration and traversal, as natural as "for" is. This traversal would be able to handle everything from singly-linked lists, through double-linked lists, to graphs and hypergraphs. And, at the other end, something like "yield" that can cleanly generate these traversable structures.<br><br>Time for a PEP?<br><br>-Tal<br>_______________________________________________<br>Chicago mailing list<br><a href="mailto:Chicago@python.org">Chicago@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/chicago">http://mail.python.org/mailman/listinfo/chicago</a></div></span></blockquote></div><br></div></body></html>