News for hackers. Stuff that matters.
Re:Worst Bug Ever by teilo on Tuesday January 22, 2013 @11:33AM (#5097886)
The example in the code was not a side-effect. They were creating a new list by invoking a function on every member of the old list.

Here's the same thing re-written in Python:

  d = [compute_diffraction_at_wavelength(x, WAVELENGTH) for x in LensLayers]
Or oldschool Python (and still faster, I think):

  d = map(compute_diffraction_at_wavelength(WAVELENGTH), LensLayers)

There are no comments on this comment yet.