Boost logo

Boost :

From: james.jones_at_[hidden]
Date: 2007-02-22 08:47:03


From: "Stjepan Rajko" <stipe_at_[hidden]>
> Yes - this brings up a downside of the current choice of using >>= and
> >=, they are too similar and reading them can be confusing. || (or |
> maybe) would be a much better choice than >=, as you suggest.
>
> The reason for using >>= is that, for something like:
>
> source
> || (path11 >>= path12 >>= path13)
> || path2
>
> to work, (path11 >>= path12 >>= path13) has to be evaluated right to
> left in order for the expression to evaluate to path11 which needs to
> connect to source. Similarly, || needs to evaluate left to right so
> that both path11 and path2 connect to source.
>
> As far as binary operators that get evaluated right to left go, we're
> pretty much stuck with different assignment operators, which would
> prevent us from using >> for >>=.
>
> Although, there could be an altogether different scheme that would
> make using >> (or <<) possible :-)

Not an altogether different scheme, but why does:

        path11 (op) path12

have to evaluate to path11? Why can't it evaluate to a proxy object which refers to path11? As long as it does this, you don't need to worry about order of evaluation.

        (path11 (op) path12) (op) path13 evaluates to
                proxy(path11) (op) path13 evaluates to
                proxy(path11)

Proxies are a wonderful trick. :)

-
James Jones Administrative Data Mgmt.
Webmaster 375 Raritan Center Pkwy, Suite A
Data Architect Edison, NJ 08837


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