News for hackers. Stuff that matters.
Re:Swift and the Legacy of Functional Programming by carapace on Monday November 21, 2016 @01:54PM (#13008030)

    persons = [person for person in (Person(name) for name in names) if person.isValid()]
This is Python.
Re:Swift and the Legacy of Functional Programming by contras1970 on Monday November 21, 2016 @02:50PM (#13008540)
i've been struggling with python incomprehensions since time immemorial. map/filter are a breeze.
Re:Swift and the Legacy of Functional Programming by laylomo on Tuesday November 22, 2016 @12:07AM (#13011767)
It's easy. The first bit:

    [person
tells you that you're getting a list of persons. That's the most important part. The rest is telling you how they're getting in that list.

It's almost like a select query in (pseudo) SQL.

    select person from people where person.isvalid = true
vs

    [person for person in people if person.isvalid]