develooper Front page | perl.perl5.porters | Postings from August 2022

Re: Pre-RFC: A Metaprogramming (Reflection and Introspection) API

Thread Previous | Thread Next
From:
Ovid
Date:
August 30, 2022 15:18
Subject:
Re: Pre-RFC: A Metaprogramming (Reflection and Introspection) API
Message ID:
CA+M4CHtdS5YO5wq8SwVvUakTXjoJTkTyKioiBAGWuW-R5rEiFg@mail.gmail.com
On Tue, Aug 30, 2022 at 12:24 PM Paul "LeoNerd" Evans <
leonerd@leonerd.org.uk> wrote:

>
>   sub f($x, $y = lc($x), $z = substr($y, 0, 5)) { ... }
>
> Here, it would be easy to say that:
>
>   * min arity is 1
>   * max arity is 3
>   * parameter names are qw( $x $y $z )
>
> but there isn't a simple representation for the defaults.
>

What about this?

    sub f(@array) { .... }

That's a variadic function and by definition, their arity is not defined.
Later, this will impact multi subs/methods.

Best,
Curtis "Ovid" Poe
--
CTO, All Around the World
World-class software development and consulting
https://allaroundtheworld.fr/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About