On 23 Apr., 13:42, Robert Peirce <b...@[EMAIL PROTECTED]
>
wrote:
> Has anybody got this to pass all the tests on OS X? =A0I have one test
> that fails.
>
> BEGIN {
> =A0 print b +=3D b +=3D 1
> =A0 print b
> =A0 b =3D 6
> =A0 print b +=3D b++
> =A0 print b
> =A0 print b +=3D ++b
> =A0 print b
>
> }
>
> produces
> 1
> 1
> 12
> 12
> 25
> 25
>
> instead of
> 2
> 2
> 13
> 13
> 28
> 28
>
> If you have run into this and figured out the problem, please share. =A0
> I'm not even sure where to start to look!
First, here are examples from a WinDOS environment using MKS awk
and xgawk respectively (the latter is basically gawk)...
$ awk -f awktest
1
1
12
12
25
25
$ xgawk -f awktest
2
2
13
13
28
28
You see that it's not depending on the (Intel) platform.
Second, I'd suggest generally try to avoid writing programs with
side effects. Instead serialize such constructs, if only to make
your intention clear.
Janis
>
> awka.sourceforge.net says the package has been successfully installed on
> OS X, so somebody has it running. =A0However, one user posted the same
> error on a MacBook Pro which suggests there is some difference between
> the PPC and Intel machines.
>
> --
> Robert B. Peirce, Venetia, PA =A0724-941-6883
> bob AT peirce-family.com [Mac]
> rbp AT cooksonpeirce.com [Office]


|