News for hackers. Stuff that matters.
Re:How to write X in both Python 3 and JavaScript by hnlauncher on Friday September 14, 2018 @12:18PM (#17988471)
https://www.pyret.org/ does it like this:

  for each(str from [list: "Ahoy", "world!"]):
    print(str)
  end

  for map(n from [list: 1,2,3]): n * n end
  # ==> [list: 1, 4, 9]

  for filter(n from [list: 1, 2, 3]):
    n >= 2
  end
  # ==> [list: 2, 3]

  for fold(sum from 0, n from [list: 4, 5, 6]):
    sum + n
  end
  # ==> 15

There are no comments on this comment yet.