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. Advertisements

  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. Advertisements

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:
    442
  2. sturlamolden
    Replies:
    9
    Views:
    1,012
    Antoon Pardon
    May 3, 2007
  3. Boltar

    Lazy evaluation question

    Boltar, Jan 5, 2008, in forum: C Programming
    Replies:
    40
    Views:
    1,379
    Peter Nilsson
    Jan 10, 2008
  4. Ken Pu
    Replies:
    3
    Views:
    865
    Steven D'Aprano
    Jan 16, 2009
  5. markolopa
    Replies:
    6
    Views:
    488
    Steven D'Aprano
    Nov 12, 2009
  6. Michael Neumann

    Lazy evaluation

    Michael Neumann, Apr 30, 2004, in forum: Ruby
    Replies:
    50
    Views:
    713
    Paul Brannan
    May 4, 2004
  7. Daniel Nugent

    Generators via Lazy Evaluation

    Daniel Nugent, Oct 29, 2005, in forum: Ruby
    Replies:
    0
    Views:
    155
    Daniel Nugent
    Oct 29, 2005
  8. Martin DeMello

    lazy evaluation?

    Martin DeMello, Feb 7, 2006, in forum: Ruby
    Replies:
    6
    Views:
    269
    Hal Fulton
    Feb 8, 2006
Loading...