> On Thu, Apr 21, 2005 at 11:45:27AM +0200, Paul Johnson wrote:

> It certainly makes more sense to me that the answer would be 2 2.  But
> however it ends up, so long as we know what the answer will be, we can
> utilize it effectively in our programs.

The trick with this construct usually in C is that the C standard doesn't
specify the order of evaluation of function arguments, so you can never be
sure if you'll get the same result if you compile it other than on your
development system (different compilers may evaluate them in a different
order). The Pugs example given in the original post seems to me to be
fairly sane, as it shows left-to-right evaluation. The Perl 5 example, as
far as I can tell, shows left-to-right for the first case and
right-to-left for the second case, which is just odd... please correct me
if I'm wrong, but that seems the only way those answers could have been
arrived at.
So really, what needs to be said is how Perl 6 is supposed to evaluate the
arguments to function calls, then we can know if the current behaviour in
Pugs is correct.

Reply via email to