-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sv.h: SvPVx now equivalent to SvPV, et.al #22960
base: blead
Are you sure you want to change the base?
Conversation
These macros suffixed with 'x' are guaranteed to evaluate their arguments just once. Prior to this commit, they used PL_Sv to accomplish that. But since 1ef9039 in 5.37, the macros they call only evaluate their arguments once, so the PL_Sv is superfluous.
If this were a perldoc comment (seen by CPAN XS authors), I'd strongly vocalize a note mentioning that this remark can not be used outside of blead perl/core only code, b/c compat with old perls. Out of paranoia for future edits, I'd change a word or 2 in "/* The macros these now expand to no longer evaluate their arguments multiple times */" to somehow suggest this comment is NA for CPAN. |
@bulk88 - I'm unclear on why XS authors would have to be copying definitions out of sv.h? They surely should use the API and that hasn't changed. I could see that changing the definitions in @khwilliamson - apart from the above concern, LTGM. |
ppport.h doesnt have any public api documentation content AFAIK, I've never seen any content or ever used it as a reference for CPAN code. only ref info ppport.h provides is API/macro add/drop timeline history. I did note above
this is a C comment that will not be seen by 90% of XS authors. There is a small risk of future doc edits, which are "improvements" elevating obfuscated/UB legalese to metacpan/perldocs visibility, Those doc edits will NEVER be done by the same person who named the fn/macro/token/var, Most likely a doc/comment edit, is the 1st C/XS/core commit ever by that person, who might be college aged or younger (GSOC/interns/etc, bkgnd high tech skills or beginner irrelevant), I'd rather duplicate crit info docs wise in multiple places in core vs a wheres waldo hunt with grep, The original phrasing/wording DOES say "used to be multi eval" but it took me 3 passes of the sentence to realize "used to be multi eval" fact was included. 2-3 words can be moved/changed so that fact is understood on eyeball pass 1 not 3. IDC, but adding a period at the end would be nice since rest of the comment is long and looks like a sentence. I wouldn't have written a PR reply just for the missing period. |
I'm not clear what the best wording would be in that case.
|
my proposed wording below. To keep it short by text length, I'm not adding the fact that these macros are 100% identical to certain other macros in ultra new perls. The end reader can put 1+1 together, phrase "anti-multi-eval" describes former/current/cpan/old-perl-safe purpose of these exact tokens. Changing public API is very alarming to some people with personality disorders. Certain Comm/Foss SDKs with public APIs, just do a big red "REMOVED" or a big red "EOL" stamp, on deprecated/EOL scheduled func calls. And not saying in src comments, HTML comments, git comments or public facing bug trackers, why the func got a future removal in ~1 to ~5 years.
Basically a project admin group should note to 3P End Users the following, DO ABSOLUTELY NOTHING with your prior private/CPAN XS code. DO NOT EDIT or grep+replace all your CPAN XS libs, either slowly or quickly. Changelogs like My proposed wording.
|
These macros suffixed with 'x' are guaranteed to evaluate their arguments just once. Prior to this commit, they used PL_Sv to accomplish that. But since 1ef9039 in 5.37, the macros they call only evaluate their arguments once, so the PL_Sv is superfluous.