Lazy evaluation

  • Thread starter Srinivas Jonnalagadda
  • Start date
S

Srinivas Jonnalagadda

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
 
M

MenTaLguY

--=-XXp1llel8P2x67B7Ip5L
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

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)

iD8DBQBDa1ujcUNIGiXCc4MRAs3nAJ95PweHuqhxw7eoEGB0SppfFUmUKgCfXEI/
Gl9Fz32IP2y8YajU2RPlM84=
=fpTo
-----END PGP SIGNATURE-----

--=-XXp1llel8P2x67B7Ip5L--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top