Mailing List Archive

Priority of "class" todo list (was Re: Having a :writer ...)
On 2024-02-28 7:23 a.m., Paul "LeoNerd" Evans wrote:
> On Tue, 27 Feb 2024 12:44:05 -0800 Darren Duncan wrote:
>> Are we expecting to have some kind of :writer as well so that Perl
>> 5.40 has them as a pair?
>
> Nope.

Thank you for the responses.

So for what I want, there are a number of other "class" features that I consider
much more critical and beneficial to implement first, versus the :writer
syntactic sugar that one could easily write a method for instead to get what
they want.

I have a new question...

At this point, given the existing todo list for the "class" feature, is it
intended to prioritize some other items over :writer given that they should be
more useful in practice and not have such easy workarounds?

A key thing that I would like to see the most and would definitely support is
basic support for defining and composing roles. More specifically, the ability
to declare a role that includes both regular methods and virtual methods that
composers must implement, and the regular ones may invoke the virtual ones, and
the ability for a class or role to compose multiple roles. The roles would NOT
declare fields, only methods.

Or as a minimum-most useful version, no virtual methods since Perl just checks
stuff at runtime anyway, but the ability to define roles with just regular
methods (that don't see fields/state) and one can compose multiple roles. The
ability to compose multiple is significant as something that doesn't have easy
workarounds in the form of using class single inheritance instead.

There may be other todo items I consider the most important, but that is one I
can point to right now.

In theory, a number of aspects of roles as I described them may be considerably
easier to implement than a lot of other features, such as :writer, as there is
no direct involvement in fields or state or contructors at all.

So what are thoughts of current priority for "class" todo features?

Thank you.

-- Darren Duncan