develooper Front page | perl.perl5.porters | Postings from May 2023

Re: Limitations of Attributes

Thread Previous
May 3, 2023 15:39
Re: Limitations of Attributes
Message ID:
On Wed, May 3, 2023 at 9:30 AM Branislav Zahradník <>

> just repeating my previous idea - what about `extends` for functions? eg:
> package Foo {
>     sub SEARCH (... signature ...);
> }
> sub function :extends(&Foo::SEARCH) { ... }
> later extended signature support for setting fixed value (in opposite to
> default value) of parameter, eg:
> sub function :extends(&Foo::SEARCH) ($search_key := value = q (fixed
> value)) { ... }

I have similar thoughts about this as I mentioned to Ruud. Rather than
adding a specific-attribute for a particular use case, more generalized
behavior in attributes seems to be welcome. If we do that, something like
:extends could be built on top of it (though your signature syntax wouldn't
be valid and I think that would need to be a separate proposal.

Curtis "Ovid" Poe
CTO, All Around the World
World-class software development and consulting

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About