develooper Front page | perl.perl5.porters | Postings from May 2021

Re: G_ARRAY should be called G_LIST

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
May 31, 2021 22:52
Subject:
Re: G_ARRAY should be called G_LIST
Message ID:
20210531235229.6d78cc32@shy.leonerd.org.uk
On Mon, 31 May 2021 15:07:36 +0100
"Paul \"LeoNerd\" Evans" <leonerd@leonerd.org.uk> wrote:

> I propose to add a new G_LIST constant with the same value as the
> current G_ARRAY, and perform a simple s/G_ARRAY/G_LIST/ across our
> codebase to fix up this little cognitive roadbump.

Update: I've begun on this branch:

  https://github.com/leonerd/perl5/tree/rename-g-array-to-g-list

Of all the change, I think the most pleasing one is:

--- a/scope.c
+++ b/scope.c
@@ -1519,7 +1519,7 @@ Perl_cx_dump(pTHX_ PERL_CONTEXT *cx)
             case G_SCALAR:
                 gimme_text = "SCALAR";
                 break;
-            case G_ARRAY:
+            case G_LIST:
                 gimme_text = "LIST";
                 break;
             default:


Most of the remaining hits for G_ARRAY are in the dist/ and cpan/
directories.

  * For dist/ I imagine these would be tidied up in a later commit,
    perhaps after someone (khw?) has had a poke of Devel::PPPort to add
    some back-compat magics there.

  * For cpan/ I note about half the hits are from my own
    Scalar-List-Utils, so I can easily fix those up. Since they're all
    macros I imagine a simple

      #ifndef G_LIST
      #  define G_LIST  G_ARRAY
      #endif

    would make easy work of these.

In any case, none of those are particularly problematic. Due to how
much code there will be around CPAN using the previous G_ARRAY name I
highly doubt that we'll be in a position to remove that name for a long
time yet, so it will remain around for a good long while.

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About