Work-in-progress on attributes-v2
[email protected] ("Paul \"LeoNerd\" Evans")
| Newsgroups | perl.perl5.porters |
|---|---|
| Message-ID | <[email protected]> |
It's a little over two years since I first suggested the idea [1], and a year since I wrote the PPC [2], but I've fiiiiinally got around to actually writing some real code. So far all I've really done is tidy up a bunch of internals. There's now a new `attributes.c` file that is overall responsible for the low-level mechanism, and maintains a table of known built-in attribute names. Those built-in ones are the existing sub, class, or field attributes. As it stands, I don't think there's much point merging it yet as it's mostly building a base for the next stages. My next plans are to carry on working on the ideas of the PPC doc; namely, to create some kind of mechanism that out-of-core modules (i.e. XS modules) can provide new lexically-scoped attribute definitions. Since the entire point of that is to permit such additions from outside of core, there won't really be much point using it in core. In order to get a better feel for it and test it out, I am thinking I'll make another "XS::Parse..." module, in similar theme to XS::Parse::Keyword and XS::Parse::Infix. Another part of the plan, which is mentioned briefly in the PPC doc as a possible extension, is to think about how we can add attributes in new locations, such as subroutine signature parameters. I think this would be a good fit along with the other things I've been doing in signatures, so there could be some good combinations there. While I'm working on that, if people want to take a look at what I have so far and give any comments ahead of an actual PR time, my work-in-progress branch is sitting at: https://github.com/leonerd/perl5/tree/attributes-v2 [1]: https://www.nntp.perl.org/group/perl.perl5.porters/2023/11/msg267303.html [2]: https://github.com/Perl/PPCs/blob/main/ppcs/ppc0029-attributes-v2.md -- Paul "LeoNerd" Evans [email protected] http://www.leonerd.org.uk/ | https://metacpan.org/author/PEVANS