From: Daniel Sheppard Date: 2006-02-23T08:45:04+09:00 Subject: Re: [ANN] lazy.rb 0.9.5 -- transparent futures! ------_=_NextPart_001_01C63809.E8184F6A Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable You can just do =20 table_name =3D "CUSTOMERS" x =3D promise { table_name } puts x =3D> "CUSTOMERS" =20 though you have to then make sure that you leave that table_name variable alone. =20 table_name =3D "CUSTOMERS" x =3D promise { table_name } table_name =3D "MONKEYS" puts x =3D> "MONKEYS" ________________________________ From: Shashank Date [mailto:shanko_date@yahoo.com]=20 Sent: Thursday, 23 February 2006 9:15 AM To: ruby-talk ML Cc: mental@rydia.net Subject: Re: [ANN] lazy.rb 0.9.5 -- transparent futures! =09 =09 Hi, =20 I have a feature request (along with a quick-hack solution). =20 Please ignore if this is already done or sounds crazy. :-) =20 Problem: All the promises I make, cannot have any arguments ! ! =20 So something like this is what I have in mind: =20 x =3D promise("CUSTOMERS") { |table_name| long_running_query(table_name)} =20 Admitedly, in this one-liner it does not make much sense. But if the block had many many lines of code and referred to the block variable at multiple places, suddenly it would be mean more to me. =20 I have attached my hackish solution without really thinking all the way thru. Thanks, =20 -- Shashank MenTaLguY wrote: I'd like to announce a new version of lazy.rb -- this one offering thread safety and transparent futures! =09 Here's the web site, complete with gem and tarball downloads, plus a bit of documentation: =09 http://moonbase.rydia.net/software/lazy.rb/ =09 Bug reports would be very, very welcome. =09 =09 =09 ________________________________ Yahoo! Mail Use Photomail to share photos without annoying attachments. ------_=_NextPart_001_01C63809.E8184F6A--