Skip to content

Conversation

@happy-barney
Copy link

@happy-barney happy-barney commented Oct 12, 2025

Internal changes - move duplicated code into dedicated functions.

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

embed.fnc Outdated
Comment on lines 2489 to 2490
p |void |package_v544 |NN OP *o \
|NULLOK OP *v
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably be called "package2()" if you're going for a non-descriptive new name.

Otherwise package_with_version() or package_and_version() seem more reasonable then either.

Copy link
Author

Choose a reason for hiding this comment

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

oh, that's what I forgot in PR message ... updated.

Honestly, I prefer API version in another version of function - it clearly says when it was added without need to consult additional tools (which in fact are not aware of semantics)

Copy link
Author

Choose a reason for hiding this comment

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

@tonycoz Perl_package changed, original functions are now static and new function remains package

Copy link
Contributor

Choose a reason for hiding this comment

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

Please rename S_package (maybe S_package_named) to keep the base name distinct from Perl_package.

@tonycoz
Copy link
Contributor

tonycoz commented Oct 19, 2025

Documentation build warnings:

'new_block_statement' missing 'd' flag at embed.fnc, line 2292 at autodoc.pl line 2784.
'package' missing 'd' flag at embed.fnc, line 2562 at autodoc.pl line 2784.

@happy-barney
Copy link
Author

@tonycoz done

Copy link
Contributor

@leonerd leonerd left a comment

Choose a reason for hiding this comment

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

Code looks fine but I'd like to see a slight addition to the docs.

op.c Outdated
Comment on lines 8276 to 8277
Function combines former C<package> and C<package_version> into single call.

Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than say "this does what something else that's now been deleted used to do", I'd just explain what this function actually does. Perhaps keep this note as a footnote in the bottom, but it needs explaining in its own terms first.

op.c Outdated
Comment on lines 8276 to 8278
package ($name, $version)

Function sets current stash name and if not NULL, sets its C<$VERSION>.
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to put the synopsis part; perldoc does that automatically.

Also missing the word "version"; as

... and if I<version> is not NULL, sets its C<$VERSION>.

Copy link
Author

Choose a reason for hiding this comment

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

updated

@leonerd
Copy link
Contributor

leonerd commented Oct 21, 2025

Your tests are all currently failing, due to the mismatch in parameter names between embed.fnc and the actual names in the code. As the PERL_ARGS_ASSERT... macro is generated from embed.fnc, it expects the names to match.

You probably want to go fix the names in embed.fnc so they match the (better) names in the code.

op.c Outdated
/*
=for apidoc package

package ($name, $version)
Copy link
Contributor

Choose a reason for hiding this comment

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

This line isn't necessary. The perldoc generator will create that sort of thing for you.

Copy link
Author

Choose a reason for hiding this comment

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

removed

Branislav Zahradník added 2 commits October 21, 2025 17:54
Function combines call of original `package` and `package_version` when
new namespace statement is detected.

Instead of required three statements usage now consists of single function call.
Copy link
Contributor

@leonerd leonerd left a comment

Choose a reason for hiding this comment

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

LGTM

@leonerd leonerd merged commit 147d5f1 into Perl:blead Oct 22, 2025
33 checks passed
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.

3 participants