bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GAWK does not like "default" as an argument name


From: Aharon Robbins
Subject: Re: GAWK does not like "default" as an argument name
Date: Mon, 31 Jul 2006 22:05:34 +0300

Andy's right; default is only a reserved word if gawk was configured
with the --enable-switch configure option.  It looks like Mr. Nielsen's
copy was built that way.

Arnold

> Date: Mon, 31 Jul 2006 10:50:53 -0400
> From: "Andrew J. Schorr" <address@hidden>
> Subject: Re: GAWK does not like "default" as an argument name
> To: Paul Jarc <address@hidden>
> Cc: "Nielsen, Dan (GE, Corporate)" <address@hidden>, address@hidden
>
> On Sun, Jul 30, 2006 at 11:58:53PM -0400, Paul Jarc wrote:
> > "Nielsen, Dan \(GE, Corporate\)" <address@hidden> wrote:
> > > # ZERROR7.AWK - GAWK doesn't like "default" in argument list
> > > # Change "default" to "Default" or "_default" and it works fine.
> > > # How to run: GAWK -f C:\AWK\ZERROR7.AWK
> > > BEGIN { x() }
> > > function x(default) { printf("ok") }
> > 
> > "default" is a keyword of the language, like "function" or "if".
> > Keywords can't be used as identifiers.
>
> I think "default" should be a keyword only if gawk was built
> with 'configure --enable-switch'.  My tests here confirm that your
> script should work fine if the "switch" statement is not enabled.
> Does that correspond with your experience?
>
> Regards,
> Andy




reply via email to

[Prev in Thread] Current Thread [Next in Thread]