Skip to content

Conversation

@khwilliamson
Copy link
Contributor

This makes perlapi more compact, and at the same time, easier for readers to compare these forms and decide which is best suited for their purposes.

  • This set of changes does not require a perldelta entry.

sv_inline.h Outdated
Comment on lines 782 to 783
conversions. Only use when you are sure C<SvIOK> is true.
C<SvIVXx> is a deprecated synonym for C<SvIVX>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are and when were the x suffix names deprecated? (and was that perldeltaed?)

They still the right thing in older perls and harmlessly do the right thing in newer perls.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears that only SvUVXx had been deprecated, contrary to my recollection. And it happened in

commit b7822a6
Author: Karl Williamson khw@cpan.org
Date: Sun Aug 4 18:03:03 2019 -0600

I don't remember why. But they certainly don't have to be deprecated. It turns out they were added in

commit 463ee0b
Author: Larry Wall larry@wall.org
Date: Wed Nov 10 00:00:00 1993 +0000

 perl 5.0 alpha 4

and remained pretty much untouched since.

I've never seen them used. Not that these are not the same as SvIVx, which was the form that untill 5.37 was the only one that guaranteed single evaluation

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never seen them used. Not that these are not the same as SvIVx, which was the form that untill 5.37 was the only one that guaranteed single evaluation

grepping CPAN finds several uses of SvNVx, SvIVx, SvUVx though I didn't see any uses that take advantage of the "single-use" property of these alternative macros.

I looked at the code, and SvUVX looks at the UV slot; so this is a typo
This makes perlapi more compact, and at the same time, easier for
readers to compare them and decide which form is best suited for their
purposes.
@tonycoz
Copy link
Contributor

tonycoz commented Oct 19, 2025

Thinking about it, I don't think the big X forms (SvNVX* etc) should be combined with the non-X forms.

The non-X forms are the typical use forms, if you want an integer or NV you call these.

The X forms are for low-level structure access and shouldn't be used unless you have a certain level of knowledge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants