Re: use Moo:from;

2018-09-05 Thread Vadim Belman
Looking forward to see what you come up with. I do mix in a role into both Attribute and ClassHOW. But delving into the core didn't help to find a better approach than the one I finally took. Two subtle aspects are to be kept in mind: support for roles; and knowing the object attribute is

Re: Is Proxy a first class part of P6 or not?

2018-09-05 Thread Vadim Belman
> The M in Moose is for Metamodel, and if I wanted custom object behavior in > Perl6, I would subclass it's standard metamodel and then override what needs > changing eg STORE/FETCH. > > No idea how to do that, or it's feasiblity. Just have the impression that the > point of having a

Re: How to shield users from side effects of applying an attribute trait for a Moo like trigger

2018-09-05 Thread Vadim Belman
> 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 in P6. If you reply to this post please consider also >

Re: Introducing P6 into a P5 user environment

2018-09-05 Thread Vadim Belman
Let me correct you in one aspect. It's not my company which is using Perl. It's me. My department is nothing about programming but VoIP and whatever else around it. Use of Perl for supportive tasks is my own choice. Yet, mixing of languages is definitely something I'm trying to avoid at least

Re: use Moo:from;

2018-09-05 Thread Elizabeth Mattijsen
FWIW, I have been trying to get https://modules.perl6.org/dist/Object::Trampoline to work with lazy attributes: so far this has gotten me into an infiniloop . Perhaps you can find out why :-) > On 5 Sep 2018, at 23:10, Simon Proctor wrote: > > So I have a thought for how to do lazy

Re: DefiniteHOW and SubsetHOW don't support named parameters

2018-09-05 Thread Vadim Belman
I have currently worked around the issue by changing the order of conditions in my code so just testing for DefiniteHOW and SubsetHOW first. But generally it arose from a need to determine base type of a typed attribute. Because there is common method for this each particular case must be

Re: WATs (Array[Str] vs Array and list vs scalar assignment)

2018-09-05 Thread Vadim Belman
I agree to the most of your writing. Just a couple of notes. > > my Array[Str] $a = ["a", "b", "c"]; > > my Str @a = ["a", "b", "c"]; > > > First, there's co/contra variance of sub-typing. The first paragraph of > wikipedia page is >

Re: Is Proxy a first class part of P6 or not?

2018-09-05 Thread yary
The M in Moose is for Metamodel, and if I wanted custom object behavior in Perl6, I would subclass it's standard metamodel and then override what needs changing eg STORE/FETCH. No idea how to do that, or it's feasiblity. Just have the impression that the point of having a metamodel is for this

Re: Is Proxy a first class part of P6 or not?

2018-09-05 Thread Vadim Belman
Lets take the question of 'do I really need AttrX::Mooish' out of the scope and postulate for now that I do need it; and no, I don't want to use any of Perl5 solutions. Just to focus more on Proxy itself. What other approaches to implement laziness in Perl6? Method based. It could either be

Re: use Moo:from;

2018-09-05 Thread Vadim Belman
This one is easy to explain. My primary selling point of using Perl6 is its multithreading capabilities. The final code would have to deal with a really big number of devices and parallel processing is of a great help here. Resource-vise it's way more reasonable to have a single process with

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

2018-09-05 Thread Ralph Mellor
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 in P6. If you reply to this post please consider also replying to that one.

DefiniteHOW and SubsetHOW don't support named parameters

2018-09-05 Thread Ralph Mellor
Vadim wrote: > BTW, while researching the core sources I discovered a potential problem with DefiniteHOW and SubsetHOW. They both define their own find_method() which is re-delegating to their base type HOW.find_method. But they don't support named parameters. Combined with classes with FALLBACK

WATs (Array[Str] vs Array and list vs scalar assignment)

2018-09-05 Thread Ralph Mellor
Hi Vadim, This is for you and anyone else interested in a little bit about tricky aspects of sub-types, of P6, of my perspective on learning in response to WTF? moments, and P6 strengths and weaknesses in relation to the foregoing. Vadim wrote: > my Array[Str] $a = ["a", "b", "c"]; > my Str @a

Re: Is Proxy a first class part of P6 or not?

2018-09-05 Thread Brandon Allbery
The real problem is that, in the absence of Proxy, rakudo can optimize a bunch of things away because it knows it has full control of the value. But if it encounters a Proxy, it has to assume that the Proxy might be manipulating state outside of the current thread, or even outside of rakudo, that

Is Proxy a first class part of P6 or not?

2018-09-05 Thread Ralph Mellor
This is the first in a series of a half dozen responses to Vadim's AttrX::Moo post that replace a couple earlier failed attempts to post here. I apologize if there end up being repeats or my following up with several responses is inappropriate. Hi Vadim. I'm making this my first post because it