diff options
author | Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> | 2021-05-31 22:35:40 +0100 |
---|---|---|
committer | Paul Evans <leonerd@leonerd.org.uk> | 2021-06-02 00:29:54 +0100 |
commit | eb7e169eaa8ff0e7e9a629f87889b08c355568e1 (patch) | |
tree | 50b61983fb3eb7854cb0b1933fc41007a37f95d2 /pod | |
parent | 499aa13271ff03425a8258615a0702c5b830be8b (diff) | |
download | perl-eb7e169eaa8ff0e7e9a629f87889b08c355568e1.tar.gz |
Rename G_ARRAY to G_LIST; provide back-compat when not(PERL_CORE)
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perlcall.pod | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/pod/perlcall.pod b/pod/perlcall.pod index 44203e5fa8..b20bbdf4d9 100644 --- a/pod/perlcall.pod +++ b/pod/perlcall.pod @@ -122,7 +122,7 @@ been warned. =head1 FLAG VALUES The C<flags> parameter in all the I<call_*> functions is one of C<G_VOID>, -C<G_SCALAR>, or C<G_ARRAY>, which indicate the call context, OR'ed together +C<G_SCALAR>, or C<G_LIST>, which indicate the call context, OR'ed together with a bit mask of any combination of the other G_* symbols defined below. =head2 G_VOID @@ -194,11 +194,12 @@ I<call_*> function. The section L</Returning a List in Scalar Context> shows an example of this behavior. -=head2 G_ARRAY +=head2 G_LIST -=for apidoc AmnUh||G_ARRAY +=for apidoc AmnUh||G_LIST -Calls the Perl subroutine in a list context. +Calls the Perl subroutine in a list context. Prior to Perl version +5.35.1 this was called C<G_ARRAY>. As with G_SCALAR, this flag has 2 effects: @@ -224,7 +225,7 @@ If 0, then you have specified the G_DISCARD flag. If not 0, then it will be a count of the number of items returned by the subroutine. These items will be stored on the Perl stack. The section L</Returning a List of Values> gives an example of using the -G_ARRAY flag and the mechanics of accessing the returned items from the +G_LIST flag and the mechanics of accessing the returned items from the Perl stack. =head2 G_DISCARD @@ -235,7 +236,7 @@ By default, the I<call_*> functions place the items returned from by the Perl subroutine on the stack. If you are not interested in these items, then setting this flag will make Perl get rid of them automatically for you. Note that it is still possible to indicate a -context to the Perl subroutine by using either G_SCALAR or G_ARRAY. +context to the Perl subroutine by using either G_SCALAR or G_LIST. If you do not set this flag then it is I<very> important that you make sure that any temporaries (i.e., parameters passed to the Perl @@ -314,7 +315,7 @@ If G_DISCARD is specified, the return value will always be 0. =item * -If G_ARRAY is specified I<and> an error has occurred, the return value +If G_LIST is specified I<and> an error has occurred, the return value will always be 0. =item * @@ -372,7 +373,7 @@ use of this flag. As mentioned above, you can determine the context of the currently executing subroutine in Perl with I<wantarray>. The equivalent test can be made in C by using the C<GIMME_V> macro, which returns -C<G_ARRAY> if you have been called in a list context, C<G_SCALAR> if +C<G_LIST> if you have been called in a list context, C<G_SCALAR> if in a scalar context, or C<G_VOID> if in a void context (i.e., the return value will not be used). An older version of this macro is called C<GIMME>; in a void context it returns C<G_SCALAR> instead of @@ -750,7 +751,7 @@ and this is the C function PUSHs(sv_2mortal(newSViv(b))); PUTBACK; - count = call_pv("AddSubtract", G_ARRAY); + count = call_pv("AddSubtract", G_LIST); SPAGAIN; @@ -780,7 +781,7 @@ Notes =item 1. -We wanted list context, so G_ARRAY was used. +We wanted list context, so G_LIST was used. =item 2. @@ -1867,7 +1868,7 @@ of Values> recoded to use C<ST> instead of C<POP*>. PUSHs(sv_2mortal(newSViv(b))); PUTBACK; - count = call_pv("AddSubtract", G_ARRAY); + count = call_pv("AddSubtract", G_LIST); SPAGAIN; SP -= count; @@ -1963,7 +1964,7 @@ The pattern of macro calls is like this: dMULTICALL; /* Declare local variables */ U8 gimme = G_SCALAR; /* context of the call: G_SCALAR, - * G_ARRAY, or G_VOID */ + * G_LIST, or G_VOID */ PUSH_MULTICALL(cv); /* Set up the context for calling cv, and set local vars appropriately */ |