Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-11-26 11:36:11


Joel de Guzman <joel_at_[hidden]> writes:

> Hi. Here's a preview of Phoenix V2. This will probably be the last
> release of the library. Phoenix V2 will be the basis of the Phoenix
> and Boost.Lambda merger.

  If these basic rules are not followed, the result is either in
  error, or is immediately evaluated. Some examples:

    var(x) = 123 // good (lazy)
    x = 123 // oops (immediate)
    var(x)[0] // good (lazy)
    x[0] // oops (immediate)
    var(x)[var(i)] // good (lazy)
    x[var(i)] // bad and illegal (x is not a phoenix primitive or composite)
    var(x[var(i)]) // bad and illegal (x is not a phoenix primitive or composite)

I would avoid attaching value judgements, and in this case,
vertically align the comments:

    x = 123 // immediate
    var(x) = 123 // lazy

    x[0] // immediate
    var(x)[0] // lazy

    var(x)[var(i)] // lazy
    x[var(i)] // illegal (x is not a phoenix primitive or composite)
    var(x[var(i)]) // illegal (x is not a phoenix primitive or composite)

And this leaves me wondering what about:

    var(x)[i]

??

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk