[Pharo-project] Python like generators for Pharo
Hi folks I've been reading a bit about Python generators and I think they're awesome. So I quickly looked for a Smalltalk implementation and found that GNU Smalltalk has one (http://smalltalk.gnu.org/blog/bonzinip/fun-generators). Now, I was wondering if there's an implementation for Pharo / Squeak (since I didn't find one on SqueakSource) and if not, if there might be any interest in one. If you're curious you should take a look at these: Generator Tricks for Systems Programmers - Version 2.0 A Curious Course on Coroutines and Concurrency http://www.dabeaz.com/generators-uk/GeneratorsUK.pdf Cheers, Max
Hi Max, See the Generator package in http://source.lukas-renggli.ch/continuations. IMHO, generators are pretty useless in Smalltalk though. Lukas On 13 July 2011 10:14, Max Leske <maxleske@gmail.com> wrote:
Hi folks I've been reading a bit about Python generators and I think they're awesome. So I quickly looked for a Smalltalk implementation and found that GNU Smalltalk has one (http://smalltalk.gnu.org/blog/bonzinip/fun-generators). Now, I was wondering if there's an implementation for Pharo / Squeak (since I didn't find one on SqueakSource) and if not, if there might be any interest in one. If you're curious you should take a look at these:
Generator Tricks for Systems Programmers - Version 2.0 A Curious Course on Coroutines and Concurrency http://www.dabeaz.com/generators-uk/GeneratorsUK.pdf
Cheers, Max
-- Lukas Renggli www.lukas-renggli.ch
On 13 July 2011 10:20, Lukas Renggli <renggli@gmail.com> wrote:
Hi Max,
See the Generator package in http://source.lukas-renggli.ch/continuations.
IMHO, generators are pretty useless in Smalltalk though.
+1 Closures is all you need most of the times.
Lukas
-- Best regards, Igor Stasenko AKA sig.
Cool Lukas, good to know. I agree, closures usually do the trick. But it's still good to know. Maybe, someday I will have to parse GB's of Apache logs in Pharo... :D On 13.07.2011, at 15:27, Igor Stasenko wrote:
On 13 July 2011 10:20, Lukas Renggli <renggli@gmail.com> wrote:
Hi Max,
See the Generator package in http://source.lukas-renggli.ch/continuations.
IMHO, generators are pretty useless in Smalltalk though.
+1
Closures is all you need most of the times.
Lukas
-- Best regards, Igor Stasenko AKA sig.
On 13 July 2011 16:12, Max Leske <maxleske@gmail.com> wrote:
Cool Lukas, good to know.
I agree, closures usually do the trick. But it's still good to know. Maybe, someday I will have to parse GB's of Apache logs in Pharo... :D
xstreams look pretty nice too for the kind of lazy iteration generators provide, no ? -- Damien Pollet type less, do more [ | ] http://people.untyped.org/damien.pollet
participants (4)
-
Damien Pollet -
Igor Stasenko -
Lukas Renggli -
Max Leske