From: "Shot (Piotr Szotkowski)" Date: 2009-10-03T20:50:39+09:00 Subject: Re: Backporting Enumerator.new { ... } to Ruby 1.8.7 --yEPQxsgoJgBvi8ip Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Roger Pack: >> What is the sanest way to backport the following example so that it >> works more-or-less in the same way under Ruby 1.8.7 as it does under >> Ruby 1.9? >> def multiplier param >> Enumerator.new do |yielder| > This might help: > http://talklikeaduck.denhaven2.com/2006/10/15/enumeration-improvement-in-= ruby-1-9 > http://stackoverflow.com/questions/1436037/how-do-enumerators-work-in-rub= y-1-9-1/1481303#1481303 > http://anthonylewis.com/2007/11/09/ruby-generators Hm. I read these and =E2=80=93 given that it lacks Fibers =E2=80=93 can=E2= =80=99t figure out a way to come up with a simple lazy enumerator in Ruby 1.8. :| What am I missing? =E2=80=94 Shot --=20 Ill-informed qmail-bashing is better than no qmail-bashing at all. [Don Mar= ti] --yEPQxsgoJgBvi8ip Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkrHOosACgkQi/mCfdEo8Uqs8gCfaEkUVuQ2JG33AQ5Z3aMVuT/C SuoAoLRYnJosb/BkOMGO7i0CVWqRmk+2 =W4R+ -----END PGP SIGNATURE----- --yEPQxsgoJgBvi8ip--