On 8/26/2011 11:23 AM, Joel Falcou wrote: > On 26/08/2011 17:18, Eric Niebler wrote: >> Why can't you use a grammar to recognize patterns like these and >> take appropriate action? > > we do. Another point is that container based operation in our system > need to know the number of dimension of the container. Domains carry > this dimensions informations as we dont want to mix different sized > container in a same expression. The containers we have are : > > table which can have 1 to MAX_DIM dimesnions matrix which behave as > table<2> when mixed with table covector and vector that act as a > matrix when mixed with matrix adn table<2> with table. > > The domain are then flagged with this dimension informations.
OK, then I'll just assume you guys know what you're doing ('cause you clearly do). The original questions was: > Is there a mechanism in Proto to define how the domain of a node new > should be computed depending on the tag and the domains of the > children? The answer is no, but you don't need that, I don't think. Proto will compute the domain of m*v to be matrix. It will use matrix_domain's generator to post-process the new expression. That generator can do anything -- including placing the new expression in the vector domain. In short, there is no requirement that a domain's generator must produce expressions in that domain. Just hack matrix_domain's generator. -- Eric Niebler BoostPro Computing http://www.boostpro.com _______________________________________________ proto mailing list proto@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/proto