Boost logo

Boost :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-03-13 22:56:09


*I vote to accept proto*


Do you think that you could use tag_of<> or ::proto_tag consistently?

 The actual type of _1 looks like this:
 expr< tag::terminal, args0< placeholder1 >, 0 >
Should this be args1< placeholder1 >?
Ok. No. I'm not really happy with this, but I don't see a better way.
I guess the best way to think of it is that the number represents
the number of proto expressions children rather than the
number of arguments.

  The expr<> struct lives in the boost::proto namespace, as do all of
Proto's operator overloads.
  The overloads are found via ADL (Argument-Dependent Lookup). That is
why expressions must be "tainted"
  with Proto-ness for Proto to be able to build trees out of expressions.
Is ADL the only reason? I should hope that the operators are overloaded
to take expr<>.

 flatten() returns a view which makes a tree appear as a flat Fusion
 If the top-most node has a tag type T, then the elements of the flattened
 sequence are the children nodes that do not have tag type T
Is there a way to customize the decision of which nodes to expand?

I don't like this name. It confused me at first since
posit is a complete word which means something totally different.
positive would be better. IMO.
 ternary ?:
You can't overload that operator!?
 nary function call
n-ary function call?

 if_< is_same< _arg, char const * >() >
Why ()? Why a transform? Is this boost::is_same?

 We can use matches<> and BOOST_MPL_ASSERT() to issue readable
compile-time errors for invalid expressions, as below:
I'm only partially convinced. The error message will be short, sure,
but if the expression is complicated, it may not be enough
information, since this a very coarse grained error message.

 A grammar decorated with transforms is a function object that takes
three parameters:
  expr -- the Proto expression to transform
  state -- the initial state of the transformation
  visitor -- any optional mutable state information
What type should "state" and "visitor" be? Why
are they two different arguments?
Do transforms work if the grammar has transforms at any level? Or do
I need a transform at the top level?

 The result of applying the first transform should be a compile-time
Boolean. If it is true...
Meaning it should be an MPL Integral Constant Wrapper? If non-zero?

 This uses proto:::make<> under the covers to evaluate the transform.)

 that it, when<> also behaves like a transform.

 fusion::cons<FoldTreeToList, _state>(FoldTreeToList, _state)
I'm getting confused. Let me see... This is a transform that
applies FoldTreeToList to its argument and uses the result to construct
a fusion::cons with the current state. Question. Why reverse_fold_tree?
would reverse_fold work as well because it would first evaluate the
right side of the comma, creating a fusion::cons and then take the left
side and push it onto the front?

  ...a problem for a type like std::vector<_arg(_arg1)>(), which is a
valid transform...
Can't you substitute /first/ and /then/ check is_callable?

What do I do if I want a statically initialized terminal
that has a custom domain? Inhetitance from extends<>
makes my type a non-aggregate...

It looks like the comments in users_guide\examples\mixed.html in
DereferenceCtx and IncrementCtx were copied from vector.html and
not updated. Also, VectorOps should be MixedOps?

Why is args0 unary!?

 context(Expr::proto_tag(), arg_c\<0\>(expr), arg_c\<1\>(expr), ...)
Why does callable_eval have no members listed?

Is it just more boostbook weirdness that the Synopsis
has an empty eval<>?

Do you really need to show all the specializations
of callable_eval?


The one argument form writes to std::cout, right?

Is domainns_ a private namespace to block ADL?
If so, it should not appear in the documentation...

A general comment about eval: It should be noted
that the context is *not* copied, and so it
is safe for it to have mutable state. (Since
this is not usual for function objects which
is what callable_context implements)

I don't think that you should need to show all the
specializations of expr in the documentation.
exprns_ is a private namespace? It shouldn't appear
in the documentation.

operator= is specified as returning the same type!?
Is this a doxygen or boostbook problem?
 static expr::make... What are the overloads that take
a size_t template parameter for?

What is the rational for only bringing flatten into namespace proto.

What does this do?

Why does if_else specify the return type while all the
others say /unspecified/

this is not pretty.

Why does this say that the it contains fold_tree, but fold_tree
doesn't appear in the listing.

This says that reverse_fold simply inherits from fold!?

Is there some way to do a fold tree that recurses over
some set of tags rather than a single fixed tag?

 Function pointer types
How are function pointer types interpreted as transforms?
Oh. OK. They are treated the same as functions.


No comments. (Besides what I said about arg0 earlier)

no comments.

why doesn't this use detail/prefix.hpp and suffix.hpp
This should include detail/dont_care.hpp
Why does the display_expr take the depth first?
I would expect that users would want to override the
default output stream more often then the starting depth.

Ought to #include <boost/mpl/if.hpp>
The global function object proto::deep_copy can
cause the usual subtle ODR violation for objects in headers
with internal linkage.
I don't think that this header needs to #include <boost/proto/generate.hpp>

This should #include <boost/ref.hpp> and does not need to
#include <boost/proto/generate.hpp>

No comments. (Yeah!)

Why is operator= only overloaded for non-const expr's when
they are terminals?
Same thing for operator[]
Doesn't use #include <boost/preprocessor/arithmetic/inc.hpp>
nor #include <boost/preprocessor/facilities/intercept.hpp>
You're not using #include <boost/utility/result_of.hpp>

needs to #include
<boost/preprocessor/repetition/enum_trailing_params.hpp> and
<boost/preprocessor/repitition/repeat_from_to.hpp>. Does not need
<boost/preprocessor/arithmetic/dec.hpp> or
Should there be a BOOST_PROTO_EXTENDS_ALL macro, so that I don't
have to write out all four macros? At the very least, you need to
note that BOOST_PROTO_EXTENDS does not overload [], (), and =, since
it differs from boost::proto_extends in this respect.

Needs to #include <boost/mpl/if.hpp>
Why do you put BOOST_PROTO_CALLABLE() in the
definitions of functional::flatten/pop_front/reverse
and then specialize is_callable too?
The specializations of fusion::extension::is_view_impl
use Iterator as the name of the template parameter of apply??
Why does value_of_impl<proto::tag::proto_expr_iterator> have
a specialization of apply for references? The primary template
works, doesn't it?

What is the point of expr_traits? Doesn't expr expose this
information directly? It is in namespace detail so it isn't
intended to be specialized by users is it?
Is there a particular reason for not defining a generator as a
polymorphic function object? Efficiency?
The template template arguments for pod_generator are worrisome.
Take a look at the example in extends.hpp for is_proto_expr.
If I want to make a POD wrapper it seems that I need /two/
template arguments and thus cannot use pod_generator at all...

You might note the format of DATA in the macros. I'm
finding it difficult to work out what they are doing.
BOOST_PROTO_AT_TYPE(...) why add_const?
The implementation of BOOST_PROTO_VARARG_TEMPLATE_YES_ converting
a seq to a tuple to a list is clumsy. Why isn't it implemented using
BOOST_PP_SEQ_FOR_EACH_I_R? Same thing goes for
What is BOOST_PROTO_SEQ_PUSH_FRONT for? Oh. I get it.
This is already being instantiated inside a BOOST_PP_SEQ_FOR_EACH_I...
I'm thinking that these macros belong in their own file.

Should include <boost/type_traits/is_array.hpp>
I don't quite get vararg_matches. The specialization for Zero = false
looks fishy. If I understand correctly, you are explicitly
forcing the size to /include/ the vararg argument.
In fact, I'm not sure that I like the fact that you are forcibly
overriding the size of the arg sequence at the expr level at all.
In addition, the argument "From" to vararg_matches_impl will skip
over the argument that corresponds to the vararg. What am I missing?
Oh. I see, vararg_matches_impl doesn't take a half-open range...
Is there a noticeable performance improvement vs. doing this more
naturally? Ok it looks right, but it took quite a bit of work to
demonstrate. I think that you are testing the element that is in
the same position as the vararg<> in both matches<> and
vararg_matches<>, though?
Why is matches_ specialized to return false for a terminal tag
and proto::_?

no comments.

no comments.

Why do you hard code arg0, arg1, ... rather than using the
preprocessor? I know it's easy but it's still not configurable.

no comments.

why does unref leave array references as references, but does
not treat plain arrays differently from other values?
In other files you create an object of type functional::*
for unref you duplicate the overloads at namespace scope.
It would be best to stick to a single style consistantly, IMO.

no comments.

I don't see what BOOST_MPL_AUX_LAMBDA_ARITY_PARAM in detail::callable is
Why does as_expr not copy arrays? It differs from deep_copy in this?
All the operator definitions are the same thing over and over and over
again. Why don't you use a macro? Oh. Except the documentation

no comments.

no comments.

no comments.

The name uncv is misleading since it is only unconst.

no comments.

no comments.

no comments.

no comments.

no comments.

no comments.

why does transform::_ref have a leading _ unlike expr?

no comments.

I don't think that detail::as_callable is a good name.
It should be more like: bind_visitor_and_transform_for_fusion_fold

no comments.

Why are there specializations of construct_ for expr both
for any number of arguments and for each number of arguments?
The documentation says that
  If X is a template like Object2<Y0,Y1,...>, ...
  Otherwise, if X is a transform ...
The tests actually happen in the opposite order.
In other words, a templated transform is treated as a transform,
not a template.

no comments.

no comments.


It would probably better to define a macro BOOST_PROTO_HAS_SEPARATE_FUSION
rather than constantly saying #if BOOST_VERSION < 103500

In Christ,
Steven Watanabe

Boost list run by bdawes at, gregod at, cpdaniel at, john at