Lazy evaluation

Discussion in 'Ruby' started by Srinivas Jonnalagadda, Nov 4, 2005.

  1. 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
     
    Srinivas Jonnalagadda, Nov 4, 2005
    #1
    1. Advertising

  2. Srinivas Jonnalagadda

    MenTaLguY Guest

    --=-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)

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

    --=-XXp1llel8P2x67B7Ip5L--
     
    MenTaLguY, Nov 4, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    334
  2. sturlamolden
    Replies:
    9
    Views:
    760
    Antoon Pardon
    May 3, 2007
  3. Ken Pu
    Replies:
    3
    Views:
    679
    Steven D'Aprano
    Jan 16, 2009
  4. Boris Borcic
    Replies:
    0
    Views:
    559
    Boris Borcic
    Jan 16, 2009
  5. Boris Borcic
    Replies:
    0
    Views:
    552
    Boris Borcic
    Jan 16, 2009
Loading...

Share This Page