From: Aldric Giacomoni Date: 2009-11-18T03:24:43+09:00 Subject: Re: Trajectories Caleb Clausen wrote: > On 11/17/09, Marnen Laibow-Koser wrote: >>> Yeah, but you can't manipulate their results when they return one if >>> they ever do as if they were numbers. >> >> Of course you can, unless I'm totally misunderstanding. Got a concrete >> example > > The pi_over_4 method I posted earlier is a good one. You can't > manipulate the _future_ result of that as if it were a number, because > (among other things) it never returns. Need a lazy functional language > for that kind of thing. (If that even suffices....) > > _Maybe_ you could write a futures library and implement the pi_over_4 > formula within that in some kind of useful way, but idunno.... I kind > of think you need laziness built into the core language for something > like that to be useful. Well, we -can- make laziness work.. Look at this: http://innig.net/software/ruby/closures-in-ruby.rb Do a search for 'fibonacci' and check out the lazy implementation. -- Posted via http://www.ruby-forum.com/.