Proto comes with operator overloads that call make_expr if the arguments are in a compatible domain and if the grammar is satisfied.

In some cases however, we'd like to build custom trees that don't exactly map to what the default operator overloads would do. We suggest adding an extension point per-domain to specify how to make_expr but only in the context of the provided operator overloads.

The transformation could arguably be done in the generator or in a later pass, but we'd prefer doing that early for different reasons: - This only affects expressions generated through the built-in operator overloads. Other expressions are generated through our custom functions, which already do what we want. - We'd like to keep the responsibility of the generator of converting a naked expression to an expression in our domain (which, in the case of NT2, involves computing the size and logical type of the elements). - Doing it at a later pass means we have to run the generator on things that don't necessarily have the desired form

The alternative is for us to not rely on Proto-defined operator overloads and to overload all that stuff ourselves.
_______________________________________________
proto mailing list
proto@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/proto

Reply via email to