From: Cary R. <cy...@ya...> - 2008-12-15 00:57:21
|
--- On Sun, 12/14/08, Martin Whitaker <mai...@ma...> wrote: > Aren't you going to have to write code to check that a > function meets the conditions that allow it to be replaced > by a constant? Or were you intending to do this on the fly > as you evaluated the function. I already have checks to verify that the arguments are constant and yes I'm planning to do the rest on the fly in the eval_tree infrastructure. If I run into something that isn't allowed I just return 0 and everything unwinds into a normal function call. It would be nice to know if the function was being evaluated in a constant context vs a compiler optimization. The later is allowed to become a normal function call, but the former should really give an error vs a zero result. Actually this will give an error message, but it is only that the function did not evaluate to a constant value instead of exactly why the function could not be evaluated as a constant. I plan to keep all this in mind as I'm working on things, but may add this after I get constant functions fully implemented. In reality all of the eval_tree functions could benefit from the constant context information. > > I really need to get myself a copy of 1364-2005! ... > I found it was cheaper to buy online from ANSI > (www.ansi.org) than from the IEEE. It may be different if > you're an IEEE member. Thanks, I will check both since I have easy access to multiple IEEE members. Cary |