Boost logo

Boost :

From: Joel (joel_at_[hidden])
Date: 2004-11-26 20:48:37


David Abrahams wrote:
> 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)

Done. Thanks!

> And this leaves me wondering what about:
>
> var(x)[i]

Lazy. Equivalent to:

     var(x)[val(i)]

Added to the examples.

Regards,

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

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