From efa8f708cd0da7c71bb71920a47b545bd07bc28a Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Wed, 14 Sep 2022 13:51:15 +0100 Subject: [PATCH] pod/perlmroapi.pod - document linear MRO function return type. Small docs clarification to point out that the linear MRO function returns a list of strings --- ext/mro/mro.pm | 2 +- ext/mro/mro.xs | 3 ++- mro_core.c | 5 +++-- pod/perlmroapi.pod | 8 ++++---- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ext/mro/mro.pm b/ext/mro/mro.pm index 39ade22efe..d95733bd41 100644 --- a/ext/mro/mro.pm +++ b/ext/mro/mro.pm @@ -12,7 +12,7 @@ use warnings; # mro.pm versions < 1.00 reserved for MRO::Compat # for partial back-compat to 5.[68].x -our $VERSION = '1.26'; +our $VERSION = '1.27'; require XSLoader; XSLoader::load('mro'); diff --git a/ext/mro/mro.xs b/ext/mro/mro.xs index 6bedd039a1..79293c035a 100644 --- a/ext/mro/mro.xs +++ b/ext/mro/mro.xs @@ -14,7 +14,8 @@ static const struct mro_alg c3_alg = =for apidoc mro_get_linear_isa_c3 Returns the C3 linearization of C<@ISA> -the given stash. The return value is a read-only AV*. +the given stash. The return value is a read-only AV* +whose values are string SVs giving class names. C should be 0 (it is used internally in this function's recursion). diff --git a/mro_core.c b/mro_core.c index 8284fb10a8..f1068314e8 100644 --- a/mro_core.c +++ b/mro_core.c @@ -216,7 +216,8 @@ Perl_mro_meta_dup(pTHX_ struct mro_meta* smeta, CLONE_PARAMS* param) =for apidoc mro_get_linear_isa_dfs Returns the Depth-First Search linearization of C<@ISA> -the given stash. The return value is a read-only AV*. +the given stash. The return value is a read-only AV* +whose elements are string SVs giving class names. C should be 0 (it is used internally in this function's recursion). @@ -399,7 +400,7 @@ S_mro_get_linear_isa_dfs(pTHX_ HV *stash, U32 level) Returns the mro linearisation for the given stash. By default, this will be whatever C returns unless some other MRO is in effect for the stash. The return value is a -read-only AV*. +read-only AV* whose values are string SVs giving class names. You are responsible for C on the return value if you plan to store it anywhere diff --git a/pod/perlmroapi.pod b/pod/perlmroapi.pod index ad6d1e3eb1..2345ca30a0 100644 --- a/pod/perlmroapi.pod +++ b/pod/perlmroapi.pod @@ -57,10 +57,10 @@ a I of 0. The core always sets I to 0 when it calls your function - the parameter is provided to allow your implementation to track depth if it needs to recurse. -The function should return a reference to an array containing the parent -classes in order. The names of the classes should be the result of calling -C on the stash. In those cases where C returns null, -C should be used instead. +The function should return a reference to an array containing string SVs +giving the names of parent classes in order. The names of the classes should +be the result of calling C on the stash. In those cases where +C returns null, C should be used instead. The caller is responsible for incrementing the reference count of the array returned if it wants to keep the structure. Hence, if you have created a