Boost logo

Boost :

Subject: Re: [boost] [Proto] Can't statement like expression be part of proto
From: Eric Niebler (eric_at_[hidden])
Date: 2010-06-05 15:19:25


On 6/5/2010 2:26 PM, joel falcou wrote:
> after digetsing all the contents of eric boost'con talk i came to the
> conclusion that epxression-tempalte enabled statement may be part of
> proto like operators. One can see the ability of having if or for as a
> real expression geenrator for any EDSL as actaully a feature.
>
> What may prevent if_, for_ and such to be first class, EDSL agnostic
> citizen fo proto ?

Right now, Proto restricts itself to expressions. Proto isn't in the
business of simulating C++ statements. That, to me, lies within the
domain of C++-like DSELs -- BLL and Phoenix, for example. That's not to
say something like this wouldn't generally be useful, but it's hard to
know when to stop. DSEL-agnostic STL constructs? Map/reduce constructs?
Concurrency constructs? I prefer to leave these to other libraries
implemented on top of Proto.

Besides, slurping that stuff into Proto raises hairy issues: what's the
best syntax? And what's the best tree structure? As you know, Joel and I
are of two minds about what a the AST for if/else should look like.
Expressions are simple: don't mess with C++'s rules for precedence and
associativity. Statements are a matter of taste.

Once Phoenix 3 is implemented, you can easily reuse Phoenix 3 C++
statement-like expressions by making your domain a sub-domain of Phoenix's.

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

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