Skip to content

Commit 5b7224a

Browse files
committed
perlapi: Reword sv_numeq entry
This is more compact and, I believe, readable than before
1 parent 5b6ac61 commit 5b7224a

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

sv.c

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8708,19 +8708,23 @@ Perl_sv_streq_flags(pTHX_ SV *sv1, SV *sv2, const U32 flags)
87088708
=for apidoc sv_numeq
87098709
=for apidoc_item sv_numeq_flags
87108710

8711-
These each return a boolean indicating whether the numbers in the two SV
8712-
arguments are identical. Those arguments will be coerced to numbers if
8713-
necessary. A C<NULL> SV is treated as C<undef>.
8711+
These each return a boolean indicating if the numbers in the two SV arguments
8712+
are identical, coercing them to numbers if necessary, basically behaving like
8713+
the Perl code S<C<$sv1 == $sv2>>.
87148714

8715-
In C<sv_numeq_flags>, if C<flags> has the C<SV_GMAGIC> bit set, 'get' magic is
8716-
handled.
8715+
A NULL SV is treated as C<undef>.
87178716

8718-
And unless C<flags> has the C<SV_SKIP_OVERLOAD> bit set, an attempt to use
8719-
C<==> overloading will be made. If such overloading does not exist or the flag
8720-
is set, then regular numerical comparison will be used instead.
8717+
C<sv_numeq> always performs 'get' magic. C<sv_numeq_flags> performs 'get'
8718+
magic only if C<flags> has the C<SV_GMAGIC> bit set.
87218719

8722-
C<sv_numeq> merely calls C<sv_numeq_flags> with just the C<SV_GMAGIC> bit set.
8723-
This function basically behaves like the Perl code C<$sv1 == $sv2>.
8720+
C<sv_numeq> always checks for, and if present, handles C<==> overloading. If
8721+
not present, regular numerical comparison will be used instead.
8722+
C<sv_numeq_flags> normally does the same, but setting the C<SV_SKIP_OVERLOAD>
8723+
bit set in C<flags> causes it to use regular numerical comparison.
8724+
8725+
Otherwise, the functions behave identically.
8726+
8727+
=for apidoc Amnh||SV_SKIP_OVERLOAD
87248728

87258729
=cut
87268730
*/

0 commit comments

Comments
 (0)