»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
Xliff How can I do signature decomp? 00:31
m: sub a (*@a:($a, $b, $c) ) { @a.gist.say }; a(1, 2, 3) 00:32
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '@a' is not declared. Did you mean '$a'?
at <tmp>:1
------> 3sub a (*@a:($a, $b, $c) ) { 7⏏5@a.gist.say }; a(1, 2, 3)
Xliff m: sub a (*@a ($a, $b, $c) ) { @a.gist.say }; a(1, 2, 3) 00:37
camelia [1 2 3]
Xliff Aha!~
vrurg Xliff: I'm trying to realize what difference does it make with positional parameters? 00:44
Xliff vrurg: You can access the parameters either via @a or via the aliases ($a, $b, $c) 00:45
m: sub a (*@a ($a, $b, $c); say $a, $b, $c ) { @a.gist.say }; a(1, 2, 3) 00:46
camelia 5===SORRY!5=== Error while compiling <tmp>
Invalid typename 'say' in parameter declaration.
at <tmp>:1
------> 3sub a (*@a ($a, $b, $c); say7⏏5 $a, $b, $c ) { @a.gist.say }; a(1, 2, 3
Xliff m: sub a (*@a ($a, $b, $c); say $a, $b, $c } { @a.gist.say }; a(1, 2, 3)
camelia 5===SORRY!5=== Error while compiling <tmp>
Invalid typename 'say' in parameter declaration.
at <tmp>:1
------> 3sub a (*@a ($a, $b, $c); say7⏏5 $a, $b, $c } { @a.gist.say }; a(1, 2, 3
Xliff m: sub a (*@a ($a, $b, $c); say $a, $b, $c }; { @a.gist.say }; a(1, 2, 3)
camelia 5===SORRY!5=== Error while compiling <tmp>
Invalid typename 'say' in parameter declaration.
at <tmp>:1
------> 3sub a (*@a ($a, $b, $c); say7⏏5 $a, $b, $c }; { @a.gist.say }; a(1, 2,
Xliff m: sub a (*@a ($a, $b, $c) ) { @a.gist.say; say $a; say $b; say $c }; a(1, 2, 3)
camelia [1 2 3]
1
2
3
Xliff ^^
vrurg Hm, interesting approach. Thanks! 00:47
vrurg re-read signatures documentation. Got some information refreshed in memory...
Xliff It's especially useful if, in this example, you want to do something with @a, while still having separate parameters.
Like passing @a. To other subs that take the same argument, or a subset. 00:48
Because you can always force @a to be passed as positionals ala |@a.
vrurg This is clear. One more degree of freedom. 00:49
Perl6 is beatiful. 00:50
Xliff m: sub a ( *@a ($a, $b, $c, $d, $e) ) { b(|@a[2..*]) }; sub b ( *@b ($a, $b, $c) ) { say $a, $b, $c; say @b.join(',') }; a(|<1 2 3 4 5>)
camelia 345
3,4,5
Xliff vrurg: Yes! It! Is!
vrurg just have finished extedning the core grammar. 00:54
Can't remember any other lang allowing this kind of trick.
Xliff vrurg: Nice! Have any examples? 01:02
vrurg Not yet. I'll publish the module when it's done. 01:07
Geth doc: bbe979f897 | cfa++ | doc/Type/Buf.pod6
space after comma
02:44
synopsebot Link: doc.perl6.org/type/Buf
Xliff m: my rule usewhat { 'a' ('bb') }; my $a = 'abba'; $a ~~ &usewhat; say $/.gist 03:40
camelia Nil
Xliff m: my rule usewhat { ^ 'a' ('bb') }; my $a = 'abba'; $a ~~ &usewhat; say $/.gist
camelia Nil
Xliff m: my rule usewhat { ^ 'a' ('bb') }; my $a = 'abba'; $a ~~ /<usewhat>/; say $/.gist
camelia Nil
Xliff m: my rule usewhat { ^ 'a' ('bb') }; my $a = 'abba'; if $a ~~ /<usewhat>/ { say $/.gist } 03:41
camelia ( no output )
Xliff m: my rule usewhat { 'a' ('bb') }; my $a = 'abba'; if $a ~~ /^ <usewhat>/ { say $/.gist }
camelia ( no output )
Xliff m: my rule usewhat { 'a' ('bb') }; my $a = 'abba'; if $a ~~ /^ 'a' / { say $/.gist }
camelia 「a」
Xliff m: my rule usewhat { 'a' ('bb') }; my $a = 'abba'; if $a ~~ /^ 'a' ('bb') / { say $/.gist }
camelia 「abb」
0 => 「bb」
03:42
Xliff m: my rule usewhat { 'a' ('bb') }; my $a = 'a bba'; if $a ~~ /^ <usewhat>/ { say $/.gist }
camelia ( no output )
Xliff m: my rule usewhat { 'a' ('bb') }; my $a = 'a bba'; if $a ~~ /<usewhat>/ { say $/.gist }
camelia ( no output )
Xliff m: my rule usewhat { 'abb' }; my $a = 'a bba'; if $a ~~ /<usewhat>/ { say $/.gist } 03:43
camelia ( no output )
Xliff m: my rule usewhat { 'abb' }; my $a = 'abba'; if $a ~~ /<usewhat>/ { say $/.gist }
camelia ( no output )
Xliff m: my rule usewhat { 'abb' }; my $a = 'abba'; if $a ~~ /'abb'/ { say $/.gist }
camelia 「abb」
Xliff m: rule usewhat { 'abb' }; my $a = 'abba'; if $a ~~ /'abb'/ { say $/.gist }
camelia Potential difficulties:
Useless declaration of a has-scoped method in mainline (did you mean 'my rule usewhat'?)
at <tmp>:1
------> 3rule 7⏏5usewhat { 'abb' }; my $a = 'abba'; if $a
「abb」
03:44
holyghost Xliff : the mind boggles :-) 03:48
yoleaux 27 Dec 2018 08:30Z <jmerelo> holyghost: you can check out my Perl6 advent calendar entry perl6advent.wordpress.com/2018/12/02/
Geth ecosystem: cc3e46da78 | (JJ Merelo)++ | .travis/testpackagemeta.pl
Trying to fix #422
06:58
ecosystem: a68096f7cf | (JJ Merelo)++ | META.list
Test-adding mini-sat for #423
ecosystem: 45fb6b6031 | (JJ Merelo)++ | .travis/testpackagemeta.pl
Adds SAT::Solver::MiniSAT and comments for local testing

In the process, solves #423. Please check that everything is correct, and reopne if it's not.
doc: 4deabe55c2 | (JJ Merelo)++ | Dockerfile
Fixes build problem, refs #2525
07:03
jmerelo Hi, AlexDaniel 07:19
AlexDaniel jmerelo: hello! 07:21
jmerelo squashable6: status
squashable6 jmerelo, Next SQUASHathon in 7 days and ≈2 hours (2019-01-05 UTC-12⌁UTC+14). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day 07:22
jmerelo ^^^ We should kind of get ready for this...
AlexDaniel testneeded is a relatively easy topic for the bot 07:23
just plug roast into the bot and that's almost it
jmerelo AlexDaniel: I was thinking more about the human side...
AlexDaniel many times tests should be added to rakudo too, so rakudo repo is also in, usually
jmerelo AlexDaniel: re: hype and difussion and getting people to actually _know_ about it 07:24
AlexDaniel jmerelo: right, right :)
I don't do social media, so I don't know if I can help with that…
jmerelo AlexDaniel: (and I'm going to be on holidays and in London... )
AlexDaniel: Is there some landing page that people have used before for that? 07:25
AlexDaniel well, there's twitter.com/perl6org/, I think people follow that 07:25
AlexDaniel then there's facebook, reddit… 07:25
also p6weekly 07:26
jmerelo AlexDaniel: I mean, some guide like the one that we wrote for unbitrot
AlexDaniel weekly: Squashathon time again! Help us by writing some tests and win plush camelia! github.com/rakudo/rakudo/wiki/Mont...Squash-Day 07:26
notable6 AlexDaniel, Noted!
jmerelo AlexDaniel: see what I mean? You will land people directly on the Squashathon page. They'll be lost before they find the pizza 07:27
AlexDaniel I know, I understand, I agree
but there's no guide for testneeded squashathon 07:28
jmerelo AlexDaniel: That's the thing
AlexDaniel maybe we need a squashathon for squashathons 07:29
jmerelo AlexDaniel: there's this thing: github.com/rakudo/rakudo/wiki/Raku...thon-Guide with a small section for testneeded. We could fork that. 07:30
AlexDaniel yeah, I'm all for that 07:31
though right now I'm of no help… focused on something else :S
jmerelo AlexDaniel: here you go: github.com/rakudo/rakudo/wiki/Test...athon-page 07:32
AlexDaniel ok that's a wonderful start actually 07:33
“Reviewing older tickets” section should go
jmerelo AlexDaniel: It's a copy/paste of relevant sections of the Rakudo Squashathon page
AlexDaniel: you gotcha
AlexDaniel hmm that's a good start for sure 07:34
jmerelo AlexDaniel: actually, some things need updating. I'll check.
AlexDaniel yeah
jmerelo AlexDaniel: OK, it looks a bit better now github.com/rakudo/rakudo/wiki/Test...athon-page 07:43
nine masak: there's something really wrong with the text of your advent blog post: perl6advent.wordpress.com/2018/12/...happiness/ Seems like a large chunk is repeated over and over 08:30
jmerelo nine: right... 08:55
nine: send a .tell 08:56
nine .tell masak there's something really wrong with the text of your advent blog post: perl6advent.wordpress.com/2018/12/...happiness/ Seems like a large chunk is repeated over and over 09:01
yoleaux nine: I'll pass your message to masak.
Xliff Perl6 GTK Initiative has now passed 100KLOC between p6-GtkPlus and p6-Pango. Thanks to everyone here for your support! 10:17
G'night
Xliff Is this the right code from masak's advent post: "\w) \h* ‘<-‘ \h* (\d+ \h* ‘..’ \h* \d+) ‘;’ $/ { say indent, “for $1 -> int $0 \{“; $indent++; } when /^ guard \h+ (‘" 10:34
That just doesn't seem right.
Oh no. The that piece of code in the conclusion is borking up the post. And someone has already noticed this! Yes, Xliff. It is time to go to bed! 10:36
lizmat weekly: opensource.com/article/18/12/calli...ing-perl-6 11:21
notable6 lizmat, Noted!
moritz lizmat: tweeted 12:16
lizmat thanks!
SmokeMachine would some one mind to help me with this discussion? github.com/FCO/Red/issues/75 16:10
lizmat commented just now 16:14
SmokeMachine Thanks lizmat ! 16:23
I haven’t published perl6 module on CPAN yet...
lizmat SmokeMachine: do you have a CPAN id ?
if not, that would be the first step :-) 16:24
SmokeMachine lizmat: yes... I have several perl5 modules on CPAN
lizmat it makes my life a lot easier wrt tracking updates for the P6W, as updates are tweeted
then App::Mi6's "mi6 release" is your friend
SmokeMachine Several means a few, right?! 16:25
lizmat well, it is to me... :-)
> 1 I would say ?
dictionary says "more than 2 but not many"
SmokeMachine So my English isn’t as bad as I thought! :) 16:26
SmokeMachine metacpan.org/author/FCO 16:28
lizmat time to upload some new stuff :-) 16:29
lizmat although your submissions won't show there 16:29
*Perl 6
El_Che reminder: there is a Perl 6 related grant request: news.perlfoundation.org/2018/12/gra...rl-6-.html 16:32
Xliff SmokeMachine: I've commented on your issue. Good luck! 16:40
SmokeMachine Xliff: thanks! 16:54
Xliff: do you think the current test suit isn’t enough? 16:56
Xliff SmokeMachine: I don't know. I haven't tried RED, yet.
I am working on something, ATM. I will give it a look later. OK? 16:57
SmokeMachine Sure! Thanks!!!
Geth doc: 7cc85a7b1d | (Elizabeth Mattijsen)++ | doc/Type/Int.pod6
Explain the reason for "lsb" and "msb"
17:10
synopsebot Link: doc.perl6.org/type/Int
Xliff SmokeMachine: Do you have any plans on adding support for MySQL/MariaDB? 17:28
SmokeMachine Xliff: sure! and I don't think it will be that difficult...
Xliff: github.com/FCO/Red/issues/33 17:29
Xliff Isn't that just Red::Driver::CommonSQL? :) 17:31
SmokeMachine: Nice work! 17:32
SmokeMachine Xliff: probably something very close to that... 17:33
:)
Xliff Cool deal! I'll contribute what I can. This looks neat. 17:34
I'm a little busy at the moment, tho....
github.com/Xliff/p6-GtkPlus.git :)
.oO( I am not to proud to shamelessly plug )
github.com/Xliff/p6-GtkPlus/ -- Better link 17:35
SmokeMachine looking... 17:38
Xliff: looks good! 17:45
Xliff Thanks! Feel free to play around. I'm still trying to polish certain things. 17:46
If you find any bugs, let me know! 17:47
SmokeMachine Xliff: sure!
MasterDuke Xliff: is there any convenient subset of your stuff that can be used to profile compiling? i.e., profiling a 40m build wouldn't work 17:56
Xliff MasterDuke: You can pull things out of BuildList if you don't want to do it all. 17:57
And I'll be doing regular compiles. If you want me to run a profile of the whole package, I don't mind. I'm doing it anyways. 17:58
MasterDuke: Plus latest rakudo has brought that time way down. 17:59
MasterDuke: If you prune the BuildList file at GTK::Raw::WindowGroup, I think that will make good profiling test. 18:01
(So include GTK::Raw::WindowGroup and delete the rest)
MasterDuke Xliff: cool, i'll give that a try 18:02
Xliff MasterDuke: Unfortunately, I think the latest commits have kind of tied my projects together. 18:03
MasterDuke: You should be fine on whatever you have, but 4ffb99f0c2a53126fc20eca758dbffda9e9405e8 is the last "safe" commit. 18:05
At least for now.
MasterDuke k, good to know
Xliff I hope to release p6-Pango, soon. I still have some issues with Pango/Cairo integration that I need to solve first.
Plus, I'm hoping that when I get done, timotimo can merge the PRs I've been submitting. ;) 18:06
SmokeMachine does any one know how to fix this? github.com/FCO/Red/issues/72 18:20
timotimo SmokeMachine: if it helps, the error that's being attempted to serialize is an X::NoSuchSymbol 18:33
called from a compose method 18:35
inside of /home/timo/perl6/ecosystem/Red/lib/.precomp/CE43128101351974707BF65575A9896FBC8FED1B/1B/1B59E7FCD19AECF1CB70B19B29D072489D23DF52 18:38
which .. how do i best figure out what the source of that is?
timotimo one of the first strings is /home/timo/perl6/ecosystem/Red/lib/MetamodelX/Red/Model.pm6 18:39
SmokeMachine timotimo: had you applied the jonathan's patch? 18:41
timotimo no 18:42
SmokeMachine with his patch, the error changes... 18:43
timotimo i wasn't sure what the last sentence in gravy's last comment was supposed to mean
it's fix for the first one and then the second one?
SmokeMachine timotimo: a better example www.irccloud.com/pastebin/tORQbD3I/
its a fix for the first one (this is how I understood) 18:44
is .^ rakudo only??? 18:47
lizmat SmokeMachine: yes, Foo.^method is short for self.HOW.method(self) 18:48
s/self/Foo 18:49
SmokeMachine lizmat: yes, but is it this way on Rakudo, or on any perl6 implementation?
lizmat aaah eh... good question 18:50
docs.perl6.org/routine/.$CIRCUMFLEX_ACCENT.html # seems to be Perl 6, but I'm not 100% sure 18:51
sena_kun o/
timotimo stable in question is called Red::Column 18:52
that should totally go in the original message,t oo
sena_kun I am "writing" a grammar looking at some yacc/bison one in the next window, and the neat thing is that one can say "I don't mind newlines(and spaces too), please ignore it for me" in yacc/bison. Is there a way to do it neatly with Perl 6 grammar? As I have to put `\n` near every possible thing and it is kind of LTA. 18:54
yes, I know a separate lexer/parser is different from how regex engine does stuff. 18:55
One can get on with white space using `rule` instead of `token` afaik(or was it `regex` again?), but not for newlines it seems. :S 18:56
SmokeMachine timotimo: yes, it should! 18:57
SmokeMachine what do you guys think about this? twitter.com/raiph_mellor/status/10...2358957056 18:58
SmokeMachine isn't a good idea use .^ on Red? 18:58
timotimo i thought it was cool 18:59
at the very least .^name is used all over in the spec tests
SmokeMachine I like it a lot...
timotimo and there's a test for exporthow that puts a .^tryit method on classes and expects it to be there 19:00
timotimo i replied on twitter 19:01
timotimo hum. does my reply sound kind of rude? 19:01
sena_kun it's not 19:02
imho. :)
timotimo it's well known to everybody that twitter's message length limit doesn't let you express nuance very well 19:03
SmokeMachine timotimo: thanks 19:03
timotimo but i'd still like to be on the safe side 19:04
SmokeMachine timotimo: how do you know the error come from Red::Column? 19:08
SmokeMachine timotimo: I think the problem is here: github.com/FCO/Red/blob/master/lib/Red.pm6#L12 19:11
Xliff sena_kun: Whitespace should be covered by rule, not regex 19:13
lizmat SmokeMachine: perhaps prefix line 12 with BEGIN ? 19:14
sena_kun Xliff, yes, thanks. Though I am still thinking about newline thingy.
lizmat actually run line 12 and 13 inside a BEGIN block ?
Xliff sena_kun: Here's how I handled newlines in one of my scripts. 19:15
github.com/Xliff/p6-GtkPlus/blob/m...ta.pl6#L13
SmokeMachine lizmat: in a begin block that worked... 19:16
im getting another error...
lizmat: thanks 19:17
timotimo gist.github.com/timo/fea5d736aa6e9...286a07675c - SmokeMachine, this is how i debugged it 19:18
SmokeMachine timotimo: gdb with moar? I should learn how to use that... 19:22
timotimo i wish navigating data structures wasn't such a huge PITA
Xliff timotimo++ # Niiice!
timotimo but that's a gdb thing, and we could totally have more debughelper functions, too 19:23
and i'm wishing for some way to get the debugserver and gdb to cooperate
gdb has a "suspend only some threads" mode, which i've used in the past to have both the debugserver and gdb at the same time
but it's fiddly 19:24
SmokeMachine now Im getting this: www.irccloud.com/pastebin/WeSpYBEL/ 19:26
timotimo i gotta go afk for a little 19:27
SmokeMachine timotimo: thank you for your help! 19:28
Xliff SmokeMachine: Are you sure .author-id exists? 19:36
Xliff has Int $!author-id is referencing{ Person.id }; 19:36
^^ Implies that the helper method .author-id is not created, yes?
SmokeMachine Xliff: it should... 19:37
SmokeMachine the accessor isn't, but the column is... 19:37
Xliff gist.github.com/Xliff/3c19fad3e02b...7fc7a7b540 19:42
uzl lizmat: great article as always. There seems to be an extra 'a' in "When you call a subroutine in a Perl 5..." 19:43
Xliff Only thing I did was change $!author-id to $.author-id
So you may need to create another way to access private attributes.
Deleting post test didn't work, but I didn't get a VMNull crash. 19:44
lizmat uzl: thanks, good spot, unfortunately I cannot make changes to that anymore :-( 19:45
dinner&
SmokeMachine Xliff: had you removed the `no precompilation` from Red::Operators? 19:48
Xliff No.
Will try that next.
SmokeMachine so no... that's not solved... 19:49
and that works with the $!author-id too...
Xliff Still works without "no precompilation" 19:50
SmokeMachine ok... try the examples/blob2/index.p6, please
Xliff Trying. 19:51
Missing serialize REPR function for REPR VMException (BOOTException) 19:52
SmokeMachine yes... that was our first error... 19:53
SmokeMachine Xliff: take a look at this: github.com/FCO/Red/issues/72#issue...-450413775 19:54
Xliff OK. With patches, the error shows up. 19:56
Xliff SmokeMachine: Looks like any attempt to access $attr in that loop will cause the error. 20:03
jmerelo Hi 20:04
SmokeMachine Xliff: Yes..
Xliff SmokeMachine: Yeah. I can push it down to the nextsame call, but it still ends up as a VMNull crash. 20:20
That's rakudo internal. 20:21
The only other thing I can think of is that add_method doesn't specifically cover submethods, and that's why you are hitting a VMNull when you get to nextsame. 20:25
Good luck! I think you are close to getting it.
SmokeMachine Xliff: but that was working with the no precompilation... 20:34
Xliff Yeah. You will have to see if it's a bug that shows up with precomp. 20:36
lucasb m: my $x = 10; { my $x = 20; say $x }; say $x 21:05
camelia 20
10
lucasb m: my $x = 10; { say $x; my $x = 20; say $x }; say $x 21:06
camelia 5===SORRY!5=== Error while compiling <tmp>
Lexical symbol '$x' is already bound to an outer symbol;
the implicit outer binding must be rewritten as OUTER::<$x>
before you can unambiguously declare a new '$x' in this scope
at <tmp>:1
----…
lucasb m: my $x = 10; { say OUTER::<$x>; my $x = 20; say $x }; say $x 21:06
camelia 10
20
10
lucasb m: my $x = 10; { say $x; my ($x) = 20; say $x }; say $x 21:07
camelia (Any)
20
10
lizmat just received word that perlpilot (Jonathan Scott Duff) peacefully passed away at the age of 47 early this morning 21:18
may you RIP, perlpilot
El_Che oh, that's sad 21:19
lizmat github.com/perlpilot
lizmat (and thanks for all the fish ) 21:20
Xliff :(
Xliff RIP, perlpilot. 21:20
Same age I am. 21:21
lizmat
.oO( so much younger than I am )
21:21
timotimo SmokeMachine: do you think we ought to employ someone with "mirror" in the name to work on red with you so we can properly call it magic? 21:22
SmokeMachine timotimo: sorry, I didn’t get it... 21:25
timotimo: Is magic made of mirror and smoke? 21:30
Xliff Smoke and Mirrors, yes.
SmokeMachine timotimo: what do you think of use anyone to help me while we look for the mirror? 21:33
timotimo use DadJoke 21:34
use Joke:from<Dad>
sorry i don't understand that question
buggable New CPAN upload: Hash-Timeout-0.0.1.tar.gz by FRITH cpan.metacpan.org/authors/id/F/FR/...0.1.tar.gz 22:15
Xliff Will .sqrt of num64 use native hints? 22:24
vrurg Anybody knows how to check if a variable contains NQPMu in a .pm6? Actually, I just can't import the symbol into the namespace.
lizmat vrurg: Match.pm6 uses nqp::istype(...,Mu): if it doesn't match, it's NQPMu 22:32
vrurg lizmat: I do the same. But thought it would be safer to do exact match. 22:33
Ok, will leave it as is.
Xliff Does anyone know if you can wrap submethod BUILD via .^add_method? 22:34
ie: Are submethods handled the same as methods, internally?
lizmat Xliff: good question, jnthn would know 22:35
Xliff .tell jnthn Can you wrap submethod BUILD via .^add_method? ie: Are submethods handled the same as methods, internally? 22:39
yoleaux Xliff: I'll pass your message to jnthn.
Xliff Thanks, (liz x 2) ~ (mat x 2)
lizmat :=_ 22:48
aka :-)
timotimo wrapping happens at the callable level i think? so it ought to work 22:49
er, with .wrap i mean
m: class test { submethod meth { say "method called" } }; test.^find_method("meth").wrap(-> | { say "before"; {*}; say "after" }); test.meth
camelia 5===SORRY!5=== Error while compiling <tmp>
{*} may only appear in proto
at <tmp>:1
------> 3od("meth").wrap(-> | { say "before"; {*}7⏏5; say "after" }); test.meth
expecting any of:
horizontal whitespace
term
timotimo m: class test { submethod meth { say "method called" } }; test.^find_method("meth").wrap(-> | { say "before"; callsame; say "after" }); test.meth 22:50
camelia before
method called
after
Xliff m: class test { method bless(*%a) { self.^find_method("BUILD").wrap(-> | { say "before"; nextsame; }); self.CREATE.BUILDALL(Empty, %attrinit)}; 22:54
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '%attrinit' is not declared
at <tmp>:1
------> 3xtsame; }); self.CREATE.BUILDALL(Empty, 7⏏5%attrinit)};
Xliff m: class test { method bless(*%a) { self.^find_method("BUILD").wrap(-> | { say "before"; nextsame; }); self.CREATE.BUILDALL(Empty, %a)};
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3e; }); self.CREATE.BUILDALL(Empty, %a)};7⏏5<EOL>
Xliff m: class test { method bless(*%a) { self.^find_method("BUILD").wrap(-> | { say "before"; nextsame; }); self.CREATE.BUILDALL(Empty, %a)}; };
camelia ( no output )
Xliff m: class test { method bless(*%a) { self.^find_method("BUILD").wrap(-> | { say "before"; nextsame; }); self.CREATE.BUILDALL(Empty, %a)}; submethod BUILD { say "Hi!" }; }; test.new
camelia before
Hi!
Xliff *sigh* 22:55
buggable New CPAN upload: Archive-Libarchive-Raw-0.0.8.tar.gz by FRITH modules.perl6.org/dist/Archive::Lib...cpan:FRITH
Xliff OK... that looks to work.
Actually... not quite.
m: class test { method bless(*%a) { self.^find_method('BUILD', :no-fallback).wrap(-> | { say "before"; nextsame; }); self.CREATE.BUILDALL(Empty, %a)}; submethod BUILD { say "Hi!" }; }; test.new 22:57
camelia before
Hi!
Xliff m: class test { method bless(*%a) { self.^find_method('BUILD', :no_fallback).wrap(-> | { say "before"; nextsame; }); self.CREATE.BUILDALL(Empty, %a)}; submethod BUILD { say "Hi!" }; }; test.new
camelia before
Hi!
vrurg Xliff: I was away, didn't see your question on BUILD. In theory – you can, but in practice you'll have a lot of side effects – especially related to inheritance. 23:14
In AttrX::Mooish I override DESTROY by intercepting .^add_method. 23:15
timotimo should still be able to get at the original method, but i'm not sure how to spell that when you have the class as an object, or its name as a string
oh 23:24
if you have the original object, you can obviously look it up with .^find_method first
buggable New CPAN upload: Archive-Libarchive-Raw-0.0.9.tar.gz by FRITH modules.perl6.org/dist/Archive::Lib...cpan:FRITH 23:35