O'Reilly logo
  • ninjew1 thinks this is interesting:

Example 6-3. Calculating a series of drop velocities, with the error fixed


Cover of Introducing Elixir
  • 6. Lists
  • from Introducing Elixir
  • by Simon St. Laurent, J. David Eisenberg
  • Publisher: O'Reilly Media, Inc.
  • Released: September 2014


Rather than reverse the results you can simply use: results ++ [Drop.fall_velocity(head)] instead of [Drop.fall_velocity(head) | results]