News for hackers. Stuff that matters.
Re:You, Too, Can Be on the Cutting Edge of Functional Progra... by eru on Wednesday May 09, 2012 @11:09AM (#3948907)
Slightly off-topic: In Python you will also benefit from using the sorted and reverse functions to avoid mutability. Generator functions are a nice way to build collections without using explicit append:

  def collection ():
    list = []
    while someLoopCondition ():
      while someOtherLoopCondition ():
        list.append (someStuff ())
    return list
vs

  def collection2():
    while someCondition ():
      while someOtherLoopCondition ():
        yield someStuff ()

There are no comments on this comment yet.