bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] Feature suggestion - function abs(X)


From: Peter Brooks
Subject: Re: [bug-gawk] Feature suggestion - function abs(X)
Date: Wed, 3 Oct 2018 09:14:00 +0200

Dear Arnold,

I'm not criticising, complaining, or asking you to change your mind --
just to get that out of the way!

I've been thinking about your comment. I see the logic of keeping the
core of awk simple, and I know it's trivially easy to keep adding this
script, thank you for reminding me of the @include. I think that I
might start making my own 'mystuff.awk' and use it to include all the
standard functions.

I wondered, though, what is the guiding philosophy for the future of
gawk? Is it to be as faithful to the original awk as possible? Or
might it develop to be more versatile? For example, I know R is
wonderful if you want lots of graphics, but it's a bit clumsy if you
just want a basic statistical summary of a .csv file. Might a future
awk have an option to calculate standard stats as it loads numeric
data? just a thought.

Regards,
Peter
On Mon, 1 Oct 2018 at 20:43, <address@hidden> wrote:
>
> Hi.
>
> Thanks for the suggestion.  I agree it'd be useful, but I don't
> really wish to keep extending the gawk core. You can easily avoid
> the need to keep retyping the function by putting it in a separate
> file and setting the AWKPATH directory to include the directory
> holding it. You can then either use an additional `-f abs.awk' on the
> command line or
>
>         @include "abs.awk"
>
> in your awk programs.
>
> Thanks,
>
> Arnold
>
> Peter Brooks <address@hidden> wrote:
>
> > Please could I suggest the addition of the function abs(X) to gawk:
> >
> > function abs(X)
> >         {
> >         if ( X < 0 ) X = -X;
> >         return X;
> >         }
> >
> > It would be handy, I so often find I have to enter the above function by 
> > hand.
> > --
> > Peter Brooks
> >
> > Mobile: +27 82 717 6404
> > Skype:  Fustbariclation
> > Twitter: Fustbariclation
> > Google+: Fustbariclation
> > Author Page: amazon.com/author/peter_brooks



-- 
Peter Brooks


Mobile: +27 82 717 6404
Skype:  Fustbariclation
Twitter: Fustbariclation
Google+: Fustbariclation
Author Page: amazon.com/author/peter_brooks



reply via email to

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