RE: Major Bug in Interpreter [Attn: Robert Craig]
- Posted by Robert Craig <rds at RapidEuphoria.com> Feb 14, 2005
- 509 views
Derek Parnell wrote: > However, it does effect some of my code though. I now have to go > through it all to catch my use of an undocumented, but reasonable, > coding practice. Reasonable, because this is how it works in other languages > that I use. FYI, there are popular languages like C and C++ which do *not* define what will happen if you call a function with side effects in the middle of a statement or expression. In something as simple as: expr_a + expr_b C/C++ does *not* define whether expr_a or expr_b is evaluated first. C/C++ defines expression evaluation order only partially, in terms of precedence rules. In a call to a C function: myfunc(expr_a, expr_b, expr_c); the order of evaluation of the arguments is *undefined* by the language. x[expr_a] = expr_b; is the same story. In these situations, function side-effects can create portability issues as well as readability issues. If you are going to check your Euphoria code, you had better also check all the C/C++ code you've ever written for this portability bug. See the "ANSI C White Book" Section A7 - Expressions. It seems to me Ada and some others are pretty much the same. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com