Boost logo

Boost :

Subject: Re: [boost] Rave for proposed Boost.Local (functions)
From: Gregory Crosswhite (gcross_at_[hidden])
Date: 2011-02-05 15:59:55


On 2/5/11 12:35 PM, Joel de Guzman wrote:
> Look, let us please stop this syntax nonsense.

It isn't nonsense. Inline Phoenix functions have a special syntax which
does not come naturally but requires training to use and understand.
This is a fact.

Having said that, I think that you are misconstruing us as saying that
this is a bad thing. Nobody here is claiming that this is a bad thing
--- and in fact, I think that the syntax is very impressively designed
because of the way it allows one to construct very nice-looking
functions within the limitations of being based on C++! All we are
saying that it isn't always a good thing, which I am sure you agree with.

Furthermore, I agree with Lorenzo's sentiment that I wish I understood
it better, and if I have the time I may see if I can learn to be more
effective in using it. :-)

> As mentioned,
> phoenix can have all those above (pure c++ function syntax,
> local classes, local variables, etc.) in the form of offline
> phoenix::function.

Yes, one can do that, but looking at the documentation (and please
correct me if I am mistaken!) it looks like writing such a function is
equivalent to writing a function object but with even more boilerplate
to make it lazy. I am sure that there are many situations where this is
incredibly useful (in particular because it means that you don't need to
use boost::bind, which is very nice!), but by itself it does not seem to
me that it provides the same features as Boost.Local. This, again, is
not a criticism; the whole point of this discussion was just to show
that Boost.Local is complimentary to Boost.Phoenix rather than being
made redundant by Boost.Phoenix, that's all.

Having said that, you have mentioned that with a few macros one could
construct pheonix::functions without needing the extra boilerplate, just
as Boost.Local does. If this is the case, then I would look forward to
seeing it. I am certainly not against using Boost.Phoenix when it is
the best tool available. :-)

> At any rate, I repeatedly say: I am not against Boost.Local. As I
> said, in as much as we have BOOST_FOREACH and std::bind, I see no
> reason why we can't have Boost.Local.

Great, then we are actually in agreement! If you think that you or
Boost.Phoenix is being criticized, then I think that there might just be
a miscommunication at work here, since I have been attempting (perhaps
unsuccessfully) to make clear that at least for me there is only
admiration for Boost.Phoenix, not loathing, and I suspect that Lorenzo
feels the same way. :-)

Cheers,
Greg


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