Re: extending built-in classes

2018-09-24 Thread Joseph Brenner
Thanks, yes that's one of the first approaches I looked at, but there's still that extra "does" step before you can say $x.tellall; On Sat, Sep 22, 2018 at 2:39 PM, Curt Tilmes wrote: > On Sat, Sep 22, 2018 at 5:30 PM Larry Wall wrote: > >> On Sat, Sep 22, 2018 at 11:40:13AM -0700, Joseph Bre

Re: extending built-in classes

2018-09-24 Thread Brandon Allbery
There's a certain aspect of "there is nothing so permanent as a temporary hack" here. On Tue, Sep 25, 2018 at 12:19 AM Joseph Brenner wrote: > Larry Wall wrote: > > > Joseph Brenner wrote: > >> Sounds good, thanks. > > > Well, yes, *sounds* good. :-) > > Monkey patching is allowed but disc

Re: extending built-in classes

2018-09-24 Thread Joseph Brenner
Larry Wall wrote: > Joseph Brenner wrote: >> Sounds good, thanks. > Well, yes, *sounds* good. :-) > Monkey patching is allowed but discouraged in Perl 6, because Ruby. But I *like* being evil. But as I was trying to make clear, it's not something I'm planning on using in production (unlik

Re: extending built-in classes

2018-09-22 Thread Curt Tilmes
On Sat, Sep 22, 2018 at 5:30 PM Larry Wall wrote: > On Sat, Sep 22, 2018 at 11:40:13AM -0700, Joseph Brenner wrote: > : Sounds good, thanks. > > Well, yes, *sounds* good. :-) > > Monkey patching is allowed but discouraged in Perl 6, because Ruby. > Mixed in roles: https://docs.perl6.org/lan

Re: extending built-in classes

2018-09-22 Thread Larry Wall
On Sat, Sep 22, 2018 at 11:40:13AM -0700, Joseph Brenner wrote: : Sounds good, thanks. Well, yes, *sounds* good. :-) Monkey patching is allowed but discouraged in Perl 6, because Ruby. Larry

Re: extending built-in classes

2018-09-22 Thread Joseph Brenner
Sounds good, thanks. (I see the term is "augment"-- someone told me it was "extend", and I couldn't find that anywhere.) On Sat, Sep 22, 2018 at 11:35 AM, Brandon Allbery wrote: > "use MONKEY-TYPING;" and then you have "augment" https://docs.perl6. > org/syntax/augment.html > > On Sat, Sep 22,

Re: extending built-in classes

2018-09-22 Thread Brandon Allbery
"use MONKEY-TYPING;" and then you have "augment" https://docs.perl6.org/syntax/augment.html On Sat, Sep 22, 2018 at 2:33 PM Joseph Brenner wrote: > I was just wondering if there's any way to extend an existing > class in perl 6. I'd like to be able to do things like drop > a custom debugging me

extending built-in classes

2018-09-22 Thread Joseph Brenner
I was just wondering if there's any way to extend an existing class in perl 6. I'd like to be able to do things like drop a custom debugging method in Any that would then be available on everything. Note: I'm talking about adding something to an existing class ("monkeypatching") as opposed to sub