Re: [proto] Feature request: control how the built-in operator overloads build expressions

2012-05-12 Thread Mathias Gaunard

On 11/05/2012 20:34, Eric Niebler wrote:


This seems quite reasonable. Could you file a feature request on trac so
I don't loose track of it? Thanks.


Trac ticket #6891


I wanted to discuss this first because I was afraid you might discard 
the idea outright and say it's the job of the generator to deal with this.

___
proto mailing list
proto@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/proto


Re: [proto] Feature request: control how the built-in operator overloads build expressions

2012-05-11 Thread Eric Niebler
On 5/11/2012 8:04 AM, Mathias Gaunard wrote:
> 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.

This seems quite reasonable. Could you file a feature request on trac so
I don't loose track of it? Thanks.

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com
___
proto mailing list
proto@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/proto