|
Proto : |
Subject: [proto] Adding stuff in proto operator
From: Joel Falcou (joel.falcou_at_[hidden])
Date: 2010-12-28 17:05:14
Here i smy use case. I guess Eric answer will be "do this at evaluation
time" but let's
I have some array/matrix DSEL going on. I want to test if two expression
containing
said matrix has compatible size before creating a proto ast node.
e.g if a,b are matrices, a + b should assert if size(a) != size(b) (in
the matlab meaning of size).
Now i can do the check when evaluating the expression before trying to
assign it BUT it irks
me that the assert triggers inside the matrix expression evaluator
instead of at the line said +
was wrongly called.
Could we have some way to specify code to call before returning the a
new operator AST node,
shoudl I overload operators myself ? Should I stick with the "assert in
eval" policy and try to come
up with way to tell the user which operators faile din which expression,
did I miss the obvious ?
Proto list run by eric at boostpro.com