develooper Front page | perl.perl6.users | Postings from September 2018

How to shield users from side effects of applying an attribute traitfor a Moo like trigger

Thread Next
From:
Ralph Mellor
Date:
September 5, 2018 16:55
Subject:
How to shield users from side effects of applying an attribute traitfor a Moo like trigger
Message ID:
CAPLR5Sdqu-JZ1O3HMqK=xtVSqgjwgYoiaRAPu6AsOna3PMWj+w@mail.gmail.com
In Vadim's recent post about his AttrX::Moo module he describes his P6
solution for bringing functionality he was used to having in P5 via Moo.

(In another post I've asked about the option and relevance of using
Moo:from<Perl5> in P6. If you reply to this post please consider also
replying to that one. Thanks.)

In discussing it he motivated his use of a Proxy as part of his `is Mooish`
trait for attributes. Aiui his reason for using it was that it seemed like
a simple and natural way to eliminate or reduce unwanted side-effects of
using a trait in the first place. But in so doing he's having to take on
manually driving type checking and has encountered semantic complexity that
seems to me to be a consequence of using Proxys. In addition, several of us
have suggested some generic weaknesses of Proxys, most notably performance.
I've started another thread for discussing Proxy's general strengths and
weaknesses.

This thread is for discussing alternatives for implementing what Vadim has
implemented, in particular an attribute trait that does what a Moo trigger
does. What are the pros and cons of available P6 techniques that allow
someone to create an attribute trait for a Moo like trigger?

--
raiph

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