[Chicago] List revolution
zitterbewegung at gmail.com
Sun Sep 11 00:37:12 CEST 2011
List = [1 , 2 , 3 , 4]
traverse n in List:
n = n + 1
This is really syntactic sugar for
map(lambda x: x=x+1, List)
On Sep 10, 2011, at 5:33 PM, Tal Liron wrote:
> On 09/10/2011 05:20 PM, Joshua Herman wrote:
>> 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.
> 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.
> 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.
> Time for a PEP?
> Chicago mailing list
> Chicago at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Chicago