News for hackers. Stuff that matters.
Re:Project Euler by kccqzy on Sunday December 10, 2017 @10:06PM (#15894867)
You can do the same in Python, which steals Haskell’s list comprehension.

By the way doesn’t the original problem say exclude multiples of 15?

IMO Python’s generators and coroutines are one of its most useful yet least appreciated features. Being able to suspend a function, resume it, get values from it, send values or exceptions to it is a highly powerful feature. You can use them to implement user-space cooperative threads, write a scheduler for that, implement message-passing concurrency, and do highly efficient multiplexed I/O in the style of asyncio.

Re:Project Euler by oldandtired on Sunday December 10, 2017 @10:56PM (#15895061)
and Python got this from....? (which language)
Re:Project Euler by kccqzy on Sunday December 10, 2017 @11:02PM (#15895079)
Well Python got it from Haskell. I thought I made it clear enough.

See https://docs.python.org/3/howto/functional.html

Re:Project Euler by oldandtired on Monday December 11, 2017 @05:16AM (#15896154)
Well years ago, I saw a discussion that put this in the context of python's generators being inspired by what was in Icon.
Re:Project Euler by bunderbunder on Monday December 11, 2017 @08:55AM (#15897012)
I'm just now looking at Icon code for the first time, but, to me, Python's list comprehension syntax looks more similar to Haskell's than Icon's.