perl5 icon indicating copy to clipboard operation
perl5 copied to clipboard

perlapi: Combine all forms of pad_findmy()

Open khwilliamson opened this issue 1 year ago • 3 comments

Having one group containing the descriptions of all closely related functions makes the pod more compact and makes maintenance easier; fixes only need to be applied in one place. And it encourages the documentation authors to compare and contrast the variants, paying closer attention to the subtle differences between them.

And it is easier for the reader to choose the variant that is best for their current purpose, rather than hopping around the file, unsure if the current text is identical to that found elsewhere, or if there is a subtle nuance (or three).

khwilliamson avatar Jun 29 '24 20:06 khwilliamson

@khwilliamson, when I build this branch and call perldoc/pod/perlapi.pod, I get this (trimmed):

    "pad_findmy_pv"
    "pad_findmy_pvn"
    "pad_findmy_pvs"
    "pad_findmy_sv"
        Given the name of a lexical variable, including its leading sigil,
        find its position in the currently-compiling pad.

...
        In "pad_add_name_sv", the input name is taken from the SV parameter
        using ""SvPVutf8"()".

        "flags" is reserved and must be zero.

            PADOFFSET  pad_findmy_pv (const char *name, U32 flags)
            PADOFFSET  pad_findmy_pvn(const char *namepv, STRLEN namelen,
                                      U32 flags)
            PADOFFSET  pad_findmy_pvs("name", U32 flags)
            PADOFFSET  pad_findmy_sv (SV *name, U32 flags)

That paragraph mentioning pad_add_name_sv seems completely out of place? Can you investigate? Thanks.

jkeenan avatar Jun 29 '24 21:06 jkeenan

When I build the branch in this p.r. up through make test_prep, I observe the following at the end of the terminal output:

...
./miniperl -Ilib autodoc.pl
Using embed.fnc entry for STRLEN len at autodoc.pl line 546, <$fh> line 130.
Using embed.fnc entry for STRLEN len at autodoc.pl line 546, <$fh> line 131.
no docs for STRLEN len
./miniperl -Ilib pod/perlmodlib.PL -q
./perl -Ilib -I. -f pod/buildtoc -q
cd t && (rm -f perl; /usr/bin/ln -s ../perl perl)

The 3 lines beginning at Using embed.fnc entry seem to suggest that there are some undefined values which autodoc.pl expects to find defined. Can this be checked? Thanks.

jkeenan avatar Jun 29 '24 21:06 jkeenan

Fixed the wrong name. I believe that another PR fixes those embed.fnc lines

khwilliamson avatar Jun 30 '24 00:06 khwilliamson