Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > Re: awka on Mac...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 8 Topic 2225 of 2241
Post > Topic >>

Re: awka on Mac OS X 10.4.11 [Intel]

by Thomas Weidenfeller <nobody@[EMAIL PROTECTED] > Apr 23, 2008 at 03:48 PM

Robert Peirce wrote:
> Has anybody got this to pass all the tests on OS X?  I have one test 
> that fails.
> 
> BEGIN {
>   print b += b += 1
>   print b
>   b = 6
>   print b += b++
>   print b
>   print b += ++b
>   print b
> }

Just some more data points. All on the same machine under Solaris 10:

Solaris xpg4 awk:

1
1
12
12
25
25

Solaris old /usr/bin/awk:

2
2
13
13
28
28

Solaris nawk:

2
2
13
13
28
28

A very old GNU awk 3.0.3:

1
1
12
12
25
25

A very old GNU awk 3.0.6:

2
2
13
13
28
28


An old GNU awk 3.1.3:

2
2
13
13
28
28


I think the conclusion is obvious. Don't use such constructs. These are 
anyhow constructs a sane programmer wouldn't have used at all :-)

> awka.sourceforge.net says the package has been successfully installed on

> OS X, so somebody has it running.  However, one user posted the same 
> error on a MacBook Pro which suggests there is some difference between 
> the PPC and Intel machines.

It is up to the language and standards lawyer to argue which of the two 
results is right under which conditions. IMHO for practical purposes it 
doesn't matter. Both behavior can apparently be found "in the wild". So 
again, I would completely avoid such twisted constructs in real-world 
awk programs.

/Thomas




 8 Posts in Topic:
awka on Mac OS X 10.4.11 [Intel]
Robert Peirce <bob@[EM  2008-04-23 11:42:55 
Re: awka on Mac OS X 10.4.11 [Intel]
Janis <janis_papanagno  2008-04-23 05:48:55 
Re: awka on Mac OS X 10.4.11 [Intel]
Thomas Weidenfeller <n  2008-04-23 15:48:54 
Re: awka on Mac OS X 10.4.11 [Intel]
Robert Peirce <bob@[EM  2008-04-23 14:55:05 
Re: awka on Mac OS X 10.4.11 [Intel]
Janis Papanagnou <Jani  2008-04-23 17:29:46 
Re: awka on Mac OS X 10.4.11 [Intel]
Robert Peirce <bob@[EM  2008-04-24 12:46:46 
Re: awka on Mac OS X 10.4.11 [Intel]
Janis <janis_papanagno  2008-04-24 06:28:43 
Re: awka on Mac OS X 10.4.11 [Intel]
pk <pk@[EMAIL PROTECTE  2008-04-24 15:42:22 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 4:08:26 CDT 2008.