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

Re: G_ARRAY should be called G_LIST

Thread Previous | Thread Next
Paul "LeoNerd" Evans
May 31, 2021 22:52
Re: G_ARRAY should be called G_LIST
Message ID:
On Mon, 31 May 2021 15:07:36 +0100
"Paul \"LeoNerd\" Evans" <> 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:

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";
-            case G_ARRAY:
+            case G_LIST:
                 gimme_text = "LIST";

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

  * 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

    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      |  |

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About