From: zuzu Date: 2004-08-27T04:52:21+09:00 Subject: Re: python generators to ruby closures, help word. http://www.ruby-doc.org/stdlib/libdoc/generator/rdoc/classes/Generator.html am i correct in assuming that "makes an internal iterator external" is just another way of saying "turns a subroutine into a continuation", "using yield rather than return"? or aka, a function to continuation translator? -z On Thu, 26 Aug 2004 15:42:31 -0400, zuzu wrote: > On Fri, 27 Aug 2004 04:14:42 +0900, Michael Neumann wrote: > > zuzu wrote: > > > can anyone help me decode the following python example using > > > generators into The Ruby Way using closures? > > > > I'm sure the Ruby version must be human-readable... maybe you can > > describe in short words, what the Python example tries to achive? > > actually i'm not much of a python programmer; stopped learning it once > i sunk my teeth into ruby. so other than the generic "to implement > unix-style pipes and filters", i'm not really sure *how* that was > working (and hoping someone here was python-ruby bilingual). > > > You might have a look at generator.rb which ships with Ruby and > > implements generators or "streams" with continuations. > > however, armed with this newly acquired knowledge, perhaps that's all > i needed to know. thanks! > > > Regards, > > > > Michael > > peace, > -z >