[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: built-in functions are missed in non-awk namespaces
From: |
Andrew J. Schorr |
Subject: |
Re: built-in functions are missed in non-awk namespaces |
Date: |
Tue, 30 Jul 2024 11:41:52 -0400 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hi Denis,
Please keep all conversations on the mailing list.
Gawk extension functions are not part of official POSIX awk, and in view
of that, a reasonable decision was made that they would not be reserved words
in other namespaces. Certainly people can disagree about this, but this
is the way it works.
The documentation has been updated to include a reference there to the
list of functions that need awk:: in a non-default namespace.
Regards,
Andy
On Tue, Jul 30, 2024 at 06:21:27PM +0300, Denis Shirokov wrote:
> "Outside the awk namespace, the names of the additional gawk built-in
> functions (such as gensub() or strftime()) may be used as component names. The
> same set of names may be used as namespace names, although this has the
> potential to be confusing."
>
>
> This is more than I can handle. Are you serious? You're afraid of a conflict
> with the functions and() or or()!?
>
> These are basic built-in functions that have been part of the language for a
> very long time, and you're worried that someone will declare a function and()
> differently than it's described in AWK?
>
> This is just ridiculous. I'm serious. And funny. I just can't believe it. Over
> the years of using this language, I've gotten used to all sorts of things and
> seen strange decisions, some of which I came to appreciate long after they
> appeared—I admit. But this?
>
> I just don't know what to say about this. It's a VERY strange decision :)
>
> I can explain why I'm so surprised. The thing is, namespace capabilities
> appeared relatively recently. If I'm not mistaken, they came with gawk 5+. So
> how can name conflicts arise if we're not talking about compatibility with
> some
> old code that users might start running on gawk 5+?
>
> Old code will run in the main namespace as it should, and if we're talking
> about new code that users wrote after the appearance of namespaces—how would
> it
> even occur to them to name some functions with names that have long been part
> of the language? What reason could there be to allow users to declare such
> functions in a separate namespace?
>
> Why is patsplit worse than split?
>
> Because the patsplit appeared later than split? But it appeared earlier than
> namespace capabilities—just like Typeof(). Then why don't I understand?
>
> thanx
> Denis
>
>
>
> пн, 29 июл. 2024 г. в 19:08, Andrew J. Schorr <
> aschorr@telemetry-investments.com>:
>
> On Mon, Jul 29, 2024 at 11:49:16AM -0400, Andrew J. Schorr wrote:
> > I can't readily find a list of such functions in the manual, but I think
> this
> > hack may work:
>
> Oops, I do now see a list here:
>
> https://www.gnu.org/software/gawk/manual/html_node/POSIX_002fGNU.html
> #:~:text=Additional%20functions%20only,awk%20Programs)
>
> But I fear it's missing a few.
>
> Regards,
> Andy
- built-in functions are missed in non-awk namespaces, Denis Shirokov, 2024/07/29
- Re: built-in functions are missed in non-awk namespaces, Andrew J. Schorr, 2024/07/29
- Re: built-in functions are missed in non-awk namespaces, Andrew J. Schorr, 2024/07/29
- Message not available
- Re: built-in functions are missed in non-awk namespaces,
Andrew J. Schorr <=
- Message not available
- Re: built-in functions are missed in non-awk namespaces, Denis Shirokov, 2024/07/30
- Re: built-in functions are missed in non-awk namespaces, Denis Shirokov, 2024/07/30
- Re: built-in functions are missed in non-awk namespaces, Denis Shirokov, 2024/07/30
- Re: built-in functions are missed in non-awk namespaces, arnold, 2024/07/30
Re: built-in functions are missed in non-awk namespaces, arnold, 2024/07/29