Boost logo

Boost Users :

From: Markus Werle (numerical.simulation_at_[hidden])
Date: 2007-04-03 17:47:03


Eric Niebler wrote:

> Well, Boost has as wiki, so what's stopping you? :-)

U R RIGTH

> [...]
> Oh, nothing at all. The benefit comes when declaring global primitives.
> Consider this at namespace scope:
>
> namespace my {
> struct placeholder {};
> proto::terminal<placeholder>::type const _ = {{}};
> }
>
> If terminal<>::type were a type with a constructor, that constructor
> would have to run *sometime* and the placeholder wouldn't be usable
> until after that time. Trouble is, C++ makes very few promises about
> when that *sometime* is. In contrast, the code above requires no runtime
> initialization. The placeholder just *is*, and there is no time during
> your program's execution when it is invalid to use it.

I got it. Thanx.
Where in the wiki do we put that piece of information?

>>> The only problem I had using MPL with proto was compile-time
>> performance
>>> problems when using MPL lambdas.
>>> In order to keep compile times down,
>>> I've replaced as much template meta-programming in proto as possible
>>> with preprocessor meta-programming.
>>
>> Could you publish an article about that?
>> Your article "Conditional Love: Foreach
>> Redux" (http://www.artima.com/cppsource/foreach.html)
>> is a good example about cool things that are hidden in some
>> innocent looking piece of code. Reading the header file never would
>> have exposed the things that matter (at least to me).
>
> I don't think that would make for an interesting article. See below.

Seems like leaping ahead is your daily bread.
(a rhyme! I claim copyright on that one!)
So for you it's crap and for me it's all new and cool stuff.

> I'm sorry to disappoint you, but there is probably no way you can profit
> from proto's innards.

I disagree.
If I understand what's inside I probably could make it do
what Daixtrose did for me the last years: compile-time differentitaion
of arbitray expressions with regard to every variable contained.

If proto fits my needs I can put all my rewrite attempts to the garbage bin
and spend time on using proto.
So proto is what I want to learn and what I want to understand in-depth.

>> Apropos proto: are you planning to introduce a glommable disambiguation
>> mechanism [Geoffrey Furnish]?
>
> I Googled this: http://www.adtmag.com/joop/carticle.aspx?ID=627. IIUC,
> this is a way to control which sub-expressions can combine with which
> others, and with which operators. Proto can do this, and its mechanism
> is much more powerful and elegant, IMNSHO. You define the meta-grammar
> of your DSEL, and then you tell Proto that only expression types that
> conform to that meta-grammar are allowed. Operators that produce invalid
> expressions are not even considered.
>
> First read this ("Patterns and Meta-Grammars"):
> http://tinyurl.com/3akbtb

That's for the usenet archive:
<http://boost-sandbox.sourceforge.net/libs/proto/doc/html/boost_proto/user_s_guide/pattern_matching_and_meta_grammars.html>
 
> Then this ("Extending Proto"):
> http://tinyurl.com/2xs222

[ No critique, I simply love links that give me an idea of what was meant
even in 10 years when tinyurl is down or lost. Adding this for future
readers]
<http://boost-sandbox.sourceforge.net/libs/proto/doc/html/boost_proto/user_s_guide/extending_proto.html>

Thanks for the links, I take a closer look at that first.

best regards,

Markus


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net