Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Lazy evaluation

Reply
Thread Tools

Lazy evaluation

 
 
Srinivas Jonnalagadda
Guest
Posts: n/a
 
      11-04-2005
I was just looking at lazy.rb (http://moonbase.rydia.net/software/lazy/).

The example 'rjust_lines' on that page is very interesting for several
numerical computation scenarios, as well, where _not every_ computed
result is actually used. However, the computation could involve
multiplication of two vectors, and in the absence of any lazy
evaluation, the cost of entire set of computations would be incurred
right then!

I do not know Scheme, hence cannot perhaps appreciate just how routine
such programming could be, but expression templates technique in C++
was used to a similar effect in libraries such as Blitz++.

Very nice feature -- thank you!

Best regards,

JS


 
Reply With Quote
 
 
 
 
MenTaLguY
Guest
Posts: n/a
 
      11-04-2005
--=-XXp1llel8P2x67B7Ip5L
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Fri, 2005-11-04 at 18:41 +0900, Srinivas Jonnalagadda wrote:
> I do not know Scheme, hence cannot perhaps appreciate just how routine=20
> such programming could be, but expression templates technique in C++=20
> was used to a similar effect in libraries such as Blitz++.


Well, Haskell is a language where all computations are lazy by default.
So it's very, very routine there.

-mental

--=-XXp1llel8P2x67B7Ip5L
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQBDa1ujcUNIGiXCc4MRAs3nAJ95PweHuqhxw7eoEGB0Sp pfFUmUKgCfXEI/
Gl9Fz32IP2y8YajU2RPlM84=
=fpTo
-----END PGP SIGNATURE-----

--=-XXp1llel8P2x67B7Ip5L--


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
lazy evaluation is sometimes too lazy... help please. Ken Pu Python 3 01-16-2009 11:23 AM
Re: lazy evaluation is sometimes too lazy... help please. Boris Borcic Python 0 01-16-2009 10:46 AM
Re: lazy evaluation is sometimes too lazy... help please. Boris Borcic Python 0 01-16-2009 10:37 AM
hello! first post to clr. I'm asking about an attempt at a lazy rubysolution to computing fibonacci numbers for a project euler problem. seems tobe a bug in lazy ruby... tphyahoo Ruby 6 08-08-2008 08:15 PM
Another method of lazy, cached evaluation. simonwittber@gmail.com Python 3 01-19-2006 04:11 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57