Re: Reördering SVt_* constants; "internal" SV type
[email protected] (Richard Leach) Thu, 18 Jun 2026 13:07:20 +0100
| Newsgroups | perl.perl5.porters |
|---|---|
| Message-ID | <CADWSe2dzFRbi0rbg_e15-5zqx8D5kQ8z_=K2_u7yb7j2FwbbCg@mail.gmail.com> |
On Thu, 18 Jun 2026 at 12:45, Paul "LeoNerd" Evans <[email protected]> wrote: > An SV should be treated as a Perl-visible scalar > if SvTYPE(sv) <= SVt_PVXX Yeah, this would be nice to have. > SVt_INVLIST is not a perl-visible scalar, in fact should not be > visible to any perl code anywhere for any reason, but > it sorts right after SVt_PV and before SVt_PVIV and is > thus accidentally included in the above scalar test I think it's located there because it's sort of a PV under the hood. Not sure offhand if moving it out of the "Perl-visible scalar" grouping would break anything. > I know there are some ordering constraints involved in the SvTYPE > values, but I don't believe it would be too problematic to move > SVt_PVLV to just after SVt_PVMG (and thus allow a contiguous range for > scalars). Might need to adjust the handful of places that do "type <= SVt_PVLV" and similar. Are there some code paths in which SVt_PVGV is also treated like a "Perl-visible scalar" or at least would be nice to have it covered by a "SvTYPE(sv) <= some-other-value" check?