News for hackers. Stuff that matters.
Re:What's Coming in Python 3.8 by RhodesianHunter on Thursday July 18, 2019 @11:22PM (#20475936)
Inside of any lambda that takes a single parameter you can refer to the parameter as 'it'. If you prefer to name your parameters you can do so as well, it's just slightly more verbose:

  users.asSequence()
    .filter { user -> 
      user.lastName.startsWith("S") 
    }
    .sortedBy { user -> 
      user.lastName 
    }
    .take(3)

There are no comments on this comment yet.