As any C macro programmer will tell you, the three are not equivalent if you want to substitute any scalar expression for $x. The easy way of telling whether two pieces of code are identical is to force them into one canonical form, and then check if the two forms are identical. In the general case though, proving the functional identity of two pieces of code is equivalent to solving the halting problem, and thus infeasible (I think).
In reply to Re: Equivalency of Code
by Corion
in thread Equivalency of Code
by rkosai
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |