In perl.git, the branch smoke-me/arc/signature-introspection has been created

<http://perl5.git.perl.org/perl.git/commitdiff/43943e927202a0c6debeef561d08196b2f119438?hp=0000000000000000000000000000000000000000>

        at  43943e927202a0c6debeef561d08196b2f119438 (commit)

- Log -----------------------------------------------------------------
commit 43943e927202a0c6debeef561d08196b2f119438
Author: Aaron Crane <[email protected]>
Date:   Sun Nov 13 14:07:35 2016 +0100

    Initial implementation of subroutine signature introspection
    
    This commit provides a minimal form of introspection for core subroutine
    signatures. It makes available three new functions in the Internals::
    namespace, each of which takes a coderef as an argument:
    
    * cv_min_arity($coderef) - returns the minimum number of arguments accepted
      by $coderef. If the coderef has no signature, it returns 0.
    
    * cv_max_arity($coderef) - returns the maximum number of arguments accepted
      by $coderef. If the coderef has no signature, or it ends in a slurpy
      argument, it returns a numeric infinity (0+'Inf')
    
    * cv_slurpy($coderef) - returns a string indicating the nature of the
      trailing slurpy argument for $coderef. If the coderef has a signature but
      no slurpy argument, it returns Perl's canonical false value. If the
      coderef has a signature with a slurpy hash argument, it returns a string
      containing '%'. Otherwise (no signature, or a signature with a slurpy
      array argument), it returns a string containing '@'.
    
    This commit is still considered a work-in-progress, and not ready for
    merging.
-----------------------------------------------------------------------

--
Perl5 Master Repository

Reply via email to