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

Re: Limitations of Attributes

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
May 3, 2023 20:57
Subject:
Re: Limitations of Attributes
Message ID:
20230503215703.6ec95792@shy.leonerd.org.uk
On Tue, 2 May 2023 14:33:04 -0500
Ovid <curtis.poe@gmail.com> wrote:

> Hi all,
> 
> Attributes could really use a rethink in a number of ways and I'm
> curious if anyone has put any thought into this?
> 
> For example, attributes in signatures are a syntax error:
> 
> sub foo ($bar :some_attr) { ... }

Indeed - part of the next steps of signatures is to think about
attributes on them. Already folks have mentioned ideas like

  sub f ($x :const) { ... }   # assignments are forbidden
  sub f ($x :alias) { ... }   # assignments are visible to caller

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

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