»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
Geth ecosystem: f9440918c3 | (Tony O'Dell)++ (committed using GitHub Web editor) | META.list
(Digest::FNV) FNV hashing for the masses
00:18
lookatme o\ 00:34
Altreus oh I just discovered .elements() 00:48
lookatme What's that ? 00:49
Juerd Altreus: Do you mean .elems?
AlexDaniel probably not
Altreus oh, I was referring to my earlier query about exemel
AlexDaniel github.com/supernovus/exemel#elements
Altreus turns out it has a fairly useful search tool, but I had to read the examples to find it because I tuned out while reading the actual docs 00:50
lookatme awesome module 00:54
bazzaar \o perl6 01:08
AlexDaniel o/
bazzaar m: "1\n2\n3\n4\n".chars.say; 01:09
camelia 8
bazzaar m: "1\n2\n3\n4\n".lines[1..*].say; 01:09
camelia (2 3 4)
bazzaar If I insert a newline between the string and the method call, it works for .chars, but not for .lines 01:11
not sure why 01:12
ugexe it will work for .lines. not .lines[1..*] 01:14
lookatme How about using that unspace '\' docs.perl6.org/language/5to6-nutsh...Whitespace 01:15
bazzaar ugexe : thanks for your help 01:21
lookatme : thanks for your help also
I'm now reading up on perl6 whitespace :) 01:23
lookatme :D 01:24
timotimo bazzaar: you can put newlines into camelia strings by copy-pasting the little nl character it makes 01:45
m: "1\n2\n3\n4\n"␤.chars.say;
camelia 8
timotimo m: "1\n2\n3\n4\n"␤.lines[1..*].say;
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing infix inside []
at <tmp>:2
------> 3.lines[7⏏051..*].say;
expecting any of:
bracketed infix
infix
infix stopper
timotimo m: "1\n2\n3\n4\n"␤.lines.[1..*].say; 01:46
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed postfix call
at <tmp>:2
------> 3.lines.7⏏5[1..*].say;
timotimo interesting
lookatme m: "1\n2\n3\n4\n"\␤.lines.[1..*].say; 01:49
camelia (2 3 4)
bazzaar timotimo: thanks for the tip, it will certainly help me shorten my questions :)
Xliff s0me0n3-unkn0wn: ping 01:50
s0me0n3-unkn0wn: Why can't you just use a wrapper sub for that, and a conditional to test for OS and generate the right call to use? 01:51
s/generate/specify/ 01:52
bazzaar m: "1\n2\n3\n4\n"␤.lines␤.[1..*]␤.say; 01:57
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed postfix call (only alphabetic methods may be detached)
at <tmp>:3
------> 3.7⏏5[1..*]
bazzaar nice error message! 01:58
bazzaar m: "1\n2\n3\n4\n"␤.lines\␤.[1..*]␤.say; 02:04
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed postfix call (only alphabetic methods may be detached)
at <tmp>:3
------> 3.7⏏5[1..*]
bazzaar m: "1\n2\n3\n4\n"\␤.lines.[1..*]␤.say; 02:07
camelia (2 3 4)
bazzaar lookatme: just saw what you did there, thanks 02:10
lookatme you welcome :P 02:11
bazzaar m: "1\n2\n3\n4\n".lines\␤.[1..*]␤.say; 02:50
camelia (2 3 4)
bazzaar m: "1\n2\n3\n4\n"\␤.lines\␤.[1..*]␤.say; 02:52
camelia (2 3 4)
Herby_ o/ 03:34
lookatme o/ 04:45
Kotnuk o/
Is perl 6 faster or slower than perl 5? 04:51
ZzZombo LTA: 05:58
m: class A {has $.a where *>100};say A.new(:a<10>)
camelia Type check failed in assignment to $!a; expected <anon> but got IntStr (IntStr.new(10, "10"))
in submethod BUILDALL at <tmp> line 1
in block <unit> at <tmp> line 1
ZzZombo m: class A {has $.a where *>100};say A.new(:a<10>)
camelia Type check failed in assignment to $!a; expected <anon> but got IntStr (IntStr.new(10, "10"))
in submethod BUILDALL at <tmp> line 1
in block <unit> at <tmp> line 1
ZzZombo ?
what the hell? 05:59
A.new(a => 1001)
shit
Type check failed in assignment to $!a; expected <anon> # <- her 06:00
lookatme <10> is IntStr
lookatme I don't like <> operator 06:01
teatime I kinda love it and «» 06:01
lookatme m: say <10>.WHAT, <abc>.WHAT;
camelia (IntStr)(Str)
lookatme It's type depend on its content 06:02
ugexe m: sub foo(Int $a) { say $a }; foo(<10>)
camelia 10 06:03
teatime it's a quoting construct, IntStr's can come from other places but I'm not sure where right off
"10".WHAT
m: "10".WHAT
camelia ( no output )
teatime m: say "10".WHAT
camelia (Str)
lookatme I would rather using `a => 10` or `:a(10)` 06:04
teatime feel free :)
lookatme Yeah, I can do a choice, that's why I love Perl6 06:05
lookatme m: say {}.WHAT; say { 5 }.WHAT; 06:08
camelia (Hash)
(Block)
lookatme And I don't like those not consistent ^^^ 06:09
ZzZombo How can I in my custom `clone` method override an array attribute's value/forbid copying its value to the clone? 06:36
It's a private attribute, so I can't modify it outside the object. 06:37
lookatme m: class C { has @.a; method clone(*%_) { %_<a> = %_<a> // @!a.clone; nextwith(|%_); }; }; my C $c .= new(a => Q :w {1 2 3 4}); my $d = $c.clone(); $d.a.push(8); say $c; say $d; 06:49
camelia C.new(a => ["1", "2", "3", "4"])
C.new(a => ["1", "2", "3", "4", 8])
lookatme Do you mean this ?
wander how can I remove a given element from an Array? 07:54
my @a = [1,2,3]; @a.remove(2)
m: my @a = [1,2,3]; @a.remove(2)
camelia No such method 'remove' for invocant of type 'Array'
in block <unit> at <tmp> line 1
geekosaur to make it go away completely, you have to use splice 08:01
jast m: my @a = [1,2,3]; @a.splice(1,1); say @a 08:03
camelia [1 3]
geekosaur m: my @a = [1,2,3]; @a.splice(1, 1); say @a
camelia [1 3]
geekosaur yeh
and this is different:
m: my @a = [1,2,3]; @a[1]:delete; say @a
camelia [1 (Any) 3]
lookatme m: my @a = 1, 2, 3, 4, 5; say @a.splice(2, 3); say @a;
camelia [3 4 5]
[1 2]
lookatme m: my @a := 1, 2, 3, 4, 5; say @a.splice(2, 3); say @a; 08:04
camelia Cannot resolve caller splice(List, Int, Int); Routine does not have any candidates. Is only the proto defined?
in block <unit> at <tmp> line 1
piojo1 m: my %hsh = (a => 1, b => 2); say []; say [ %hsh ]; say [ %hsh, %hsh ]; 08:12
camelia []
[a => 1 b => 2]
[{a => 1, b => 2} {a => 1, b => 2}]
piojo1 that inconsistency is quite troublesome, but the output doesn't show it very well 08:13
m: my %hsh = (a => 1, b => 2); say [].elems; say [ %hsh ].elems; say [ %hsh, %hsh ].elems;
camelia 0
2
2
lookatme m: my %hsh = (a => 1, b => 2); say %hsh; 08:26
camelia {a => 1, b => 2}
lookatme m: my %hsh = (a => 1, b => 2); say []; say [ %hsh ].WHAT; 08:27
camelia []
(Array)
lookatme Why `[ %hsh ]` is an Array ? 08:27
m: say [1].WHAT 08:28
camelia (Array)
lookatme m: say [1]
camelia [1]
lookatme Oh, I confused () and [] :( 08:29
m: say (1).WHAT; say (1, 2).WHAT
camelia (Int)
(List)
lookatme And I think [ %hsh ] is a bug 08:30
m: my %hsh = (a => 1, b => 2); say [ %hsh ][0];
camelia a => 1
wander yes, :delete is what i want 08:34
thank you
piojo1 lookatme: it seems like a perl-5-ism 08:41
it's an automatic flattening
piojo1 I don't like it, but I'm not sure it's a bug 08:42
moritz m: my %hsh = (a => 1, b => 2); say [ %hsh, ][0];
camelia {a => 1, b => 2}
moritz it's an application of the one-argument rule
ufobat morning :) 08:44
piojo1 moritz: Is that if there's one argument in a list context, rakudo will try to interpret it as a list? 08:45
I see: docs.perl6.org/type/Signature#Sing...ule_Slurpy
Geth doc: e170c16604 | ZzZombo++ (committed using GitHub Web editor) | doc/Type/Str.pod6
Fixed wrong example

Such an obvious mistake.
08:50
synopsebot Link: doc.perl6.org/type/Str
lookatme piojo1, I don't like too 08:52
piojo1 m: sub list1 { $(1, 2) }; sub list2 { (1, 2) }; say [list1].elems; say [list2].elems; 08:54
camelia 1
2
piojo1 awkward!
lookatme That's really gild the lily . :( 08:56
tyil how to depend on a minimum version of another module in meta6.json? 09:55
buggable New CPAN upload: App-Cpan6-0.14.1.tar.gz by TYIL cpan.metacpan.org/authors/id/T/TY/...4.1.tar.gz 10:13
s0me0ne-unkn0wn Xliff: The problem is libeay32.dll is installed on Win along with OpenSSL module itself and filepaths are mangled, we don't know where the library resides at runtime, so OpenSSL::NativeLib::gen-lib is needed to find the lib 10:40
And now this behavior should be copy-pasted for another lib
It's pain in the ass but I hope core patch resolving the problem arrives soon and all those gen-* are dropped all together 10:41
ZzZombo hello 10:56
DrForr o/ 11:23
tbrowder \o DrForr 11:47
ZzZombo how can I *bind* a value to an attribute?
jnthn $!attr := $value; 11:51
Geth doc: 0c8fecfaf5 | (Jan-Olof Hendig)++ | doc/Language/traps.pod6
Even more formatting fixes
12:11
synopsebot Link: doc.perl6.org/language/traps
Geth doc: 3625f54aaa | (Jan-Olof Hendig)++ | doc/Language/traps.pod6
Fixed three broken links
12:18
Geth mu: c9b2e40fe7 | (Zoffix Znet)++ (committed using GitHub Web editor) | misc/perl6advent-2017/schedule
Fix typo
12:26
ZzZombo m: class C { has Str $.s;multi method s{return-rw $!s};multi method s(Str:D \s){$!s=s};submethod TWEAK(:$s){ self.s($s)} };my $a=C.new(:s<a>);my $s='aaaaaaaaaa';$a.s($s.substr-rw(2,3));$a.s('asd');say ($a,$s) 12:38
camelia (C.new(s => "asd") aaaaaaaaaa)
Geth mu: 2cf986e72e | (Zoffix Znet)++ (committed using GitHub Web editor) | misc/perl6advent-2017/schedule
Add new articles/restructure

  - Add "The Grinch of Perl 6: A Practical Guide to Ruining Christmas"
  - Add "A Primer to New, Readable Perl 6 Regex Syntax"
  - Move "Perl 6 Is My Drummer: Making Grammars Sing" after the primer to regexes
13:16
ZzZombo_ test 13:23
stmuk how long does Cro::HTTP testing take?
stmuk oh futex(0x55b208712054, FUTEX_WAIT_PRIVATE, 1, NULL probably isn't good 13:26
jnthn Depends on the hardware and if the tests are run in parallel
Run non-parallel and with time to compile everything, could easily run over a minute or more 13:27
timotimo stmuk: that could just be a worker waiting for work to appear?
stmuk its been waiting for several mins on an old I5 with 2 cores 13:28
jnthn 43s with -j8 with cold precomp cache here 13:29
11s warm
stmuk hmm I'll see if I can reproduce again 13:30
lucs_ Inline::Perl5 problem: gist.github.com/lucs/43aa5fa13f686...4a7b45d811 13:31
jnthn stmuk: There were some hangs in the http-client.t a while back, but I thought they were all resolved (and haven't seen any on Travis for that module since then) 13:31
Geth doc: 11fe7c48ed | (Jan-Olof Hendig)++ | doc/Language/testing.pod6
Improved code formatting
13:53
synopsebot Link: doc.perl6.org/language/testing
stmuk jnthn: can't reproduce ... I must have just been unlucky 14:04
jnthn Hmm 14:05
timotimo does not bode well ...
jnthn Maybe one of the Travis runs will eventually show it up
jnthn BTW, there's now also a #cro channel :) 14:07
DrForr Pod::To::HTML seems to call a chain of subroutines rather than instantiating an object - Is that just the author's choice, or was it by design? 14:14
I'm giving in and writing Pod::To::BlogspotHTML, and I thought I'd put an object in there that people can subclass if they don't like my HTML formatting. 14:16
I can bless the object easily enough, but I was wondering if there were any ecosystem reasons why the design decision was made. 14:17
Oh, wait. I probably can't easily get the package inside the sub, at least not in a way that'd let people override it. 14:21
ZzZombo HexChat is great. 14:26
So, I've asked a bunch of questions today, but wasn't able to hear any responses, due to a bug in my previous IRC client, I'm sorry if my interaction was needed. 14:28
stmuk it wasn't weechat was it?
ZzZombo Pidgin. 14:29
Type check failed in assignment to $!a; expected <anon> # <- I mean, what on Earth is <anon> 14:32
ZzZombo How can I in my custom `clone` method override an array attribute's value/forbid copying its value to the clone? 14:34
It's a private attribute, so I can't modify it outside the object.
jnthn, what do I do wrong here when binding the attribute? 14:36
m: m: class C { has Str $.s;multi method s{return-rw $!s};multi method s(Str:D \s){$!s:=s};submethod TWEAK(:$s){ self.s($s)} };my $a=C.new(:s<a>);my $s='aaaaaaaaaa';$a.s($s.substr-rw(2,3));$a.s('asd');say ($a,$s)
camelia (C.new(s => "asd") aaaaaaaaaa)
ZzZombo I wanna keep the reference to the substring inside the object. 14:37
And use it to modify the original string.
jnthn ZzZombo: Need to mark the first multi method s with "is rw", I think 14:46
ZzZombo m: m: class C { has Str $.s;multi method s is rw{return-rw $!s};multi method s(Str:D \s){$!s:=s};submethod TWEAK(:$s){ self.s($s)} };my $a=C.new(:s<a>);my $s='aaaaaaaaaa';$a.s($s.substr-rw(2,3));$a.s('asd');say ($a,$s) 14:48
camelia 5===SORRY!5===
Trait 'is rw' needs whitespace before block
at <tmp>:1
------> 3 $.s;multi method s is rw{return-rw $!s}7⏏5;multi method s(Str:D \s){$!s:=s};submet
Missing block (apparently claimed by 'is rw')
at <tmp>:1
------> …
ZzZombo m: m: class C { has Str $.s;multi method s is rw {return-rw $!s};multi method s(Str:D \s){$!s:=s};submethod TWEAK(:$s){ self.s($s)} };my $a=C.new(:s<a>);my $s='aaaaaaaaaa';$a.s($s.substr-rw(2,3));$a.s('asd');say ($a,$s) 14:49
camelia (C.new(s => "asd") aaaaaaaaaa)
wander m: my token x { 0 }; say "001" ~~ /$<var>=<x> $<var>/ 15:27
camelia Nil
wander m: my token x { 0 }; say "001" ~~ /$<var>=<x>/
camelia 「0」
var => 「0」
x => 「0」
wander what happens here?
m: my token x { 0 }; say "001" ~~ /$<var>=<x> {} $<var>/
camelia Nil
wander I capture a named capture, but cannot refer it later
perlpilot m: my token x { 0 }; say "001" ~~ /$<var>=(<x>) {} $<var>/ 15:29
camelia 「00」
var => 「0」
x => 「0」
perlpilot m: my token x { 0 }; say "001" ~~ /$<var>=[<x>] {} $<var>/
camelia 「00」
var => 「0」
x => 「0」
moritz wander: <var=&x> would be the correct syntax 15:30
m: my token x { 0 }; say "001" ~~ / <var=&x> {} <var> /
camelia No such method 'var' for invocant of type 'Match'
in block <unit> at <tmp> line 1
moritz m: my token x { 0 }; say "001" ~~ / <var=&x> {} $<var> /
camelia 「00」
var => 「0」
perlpilot Still ... I think wander has elucidated a trap that someone might fall into. I wonder if we can better help the poor user? 15:31
wander see 15:33
wander m: my token x { 0 }; say "001" ~~ /$<var>=[<x>] $<var>/ 15:36
camelia 「00」
var => 「0」
x => 「0」
wander I think this syntax is more elegant. 15:37
wander m: say "abc".subst(/(\w)/, "{$/[0]}0", :g) 15:54
camelia Use of Nil in string context
000
in block <unit> at <tmp> line 1
wander oops
wander m: say "abc".subst(/(\w)/, "{$/[0]}0", :g) 15:55
camelia Use of Nil in string context
000
in block <unit> at <tmp> line 1
wander it prints "c0c0c0" in my local REPL
timotimo m: say "abc".subst(/(\w)/, * ~ 0, :g) 15:56
camelia a0b0c0
timotimo better to give it a code block that takes a $/ (or whatever) argument
m: say "abc".subst(/(\w)/, *[0] ~ 0, :g) # more precisely what you had before
camelia a0b0c0
wander m: say "abc".subst(/$<var>=[\w](\w)/, *<var>~"0"~*[0], :g) 16:00
camelia Too few positionals passed; expected 2 arguments but got 1
in block <unit> at <tmp> line 1
wander hah..what if captures gone more than one 16:00
moritz use a proper code block 16:01
ilmari m: say "abc".subst(/$<var>=[\w](\w)/, { $^a<var>~"0"~$^a[0]}, :g)
camelia a0bc
ilmari m: say "abc".subst(/$<var>=[\w](\w)/, { $/<var>~"0"~$/[0]}, :g) 16:02
camelia a0bc
wander oh, i used to think subst takes a Str as the second parameter 16:04
ilmari s: Str, &subst 16:04
SourceBaby ilmari, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Undeclared routine:␤ subst used at line 6. Did you mean 'substr'?␤␤
ilmari s: Str, subst 16:05
SourceBaby ilmari, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Undeclared routine:␤ subst used at line 6. Did you mean 'substr'?␤␤
ilmari SourceBaby: help
SourceBaby ilmari, Use s: trigger with args to give to sourcery sub. e.g. s: Int, 'base'. See modules.perl6.org/dist/CoreHackers::Sourcery
ilmari s: Str, 'subst'
SourceBaby ilmari, Sauce is at github.com/rakudo/rakudo/blob/4fca...r.pm#L1134
ilmari wander: it can take a str, but it can also take a Callable 16:05
docs.perl6.org/routine/subst.html#Callable
the match object will be in $/, $_ and passed as an argument 16:06
raschipi Debian is thinking about enabling automatic uploads on upstream release. 16:25
DrForr Is the API for how the --doc option works specified somewhere? 16:40
Pod::To::HTML exports pod2html and a few other subroutines, and while I could look at the code to see what's actually being run, an official place would be nice.
chsanch Hi, I've just compiled Rakudo on Windows 10, but I don't know if I have to do something else besides execute: 'chcp 65001' to handle utf8 characteres in cmd.exe or powershell, this what I'm getting if I use an "ñ" inside a string variable: ibb.co/e24nV6 16:50
[Coke] m: my $s = "eñe"; $s.encode('utf8').say 16:53
camelia utf8:0x<65 c3 b1 65>
[Coke] OOC, does that work?
chsanch > my $s = "eñe"; $s.encode('utf8').say 16:54
utf8:0x<65 00 65> 16:55
[Coke] huh 16:56
ugexe what if you dont use the repl 16:59
ugexe if i try to use that in the repl i get '> Decoder may not be used concurrently' on repeat 17:01
chsanch perl6 .test.p6 17:03
utf8:0x<65 c3 b1 65>
it seems it works if I execute it in a script
ugexe what if you do perl6 -e "my $s = 'eñe'; $s.encode('utf8').say" 17:05
chsanch C:\>perl6 -e "my $s = 'eñe'; $s.encode('utf8').say" 17:09
utf8:0x<65 c3 b1 65>
chsanch but, in powershell I'm getting an error: gist.github.com/anonymous/df47676a...f146857199 17:11
jnthn Powershell is probably interpreting the $ as a shell variable 17:11
Zoffix chsanch: the REPL problem was recently mentioned on a ticket. It's bustitude in prompt (which the REPL uses): rt.perl.org/Public/Bug/Display.htm...xn-1508132 17:12
chsanch Oh ok, I see 17:13
I need to go now, I'll check this later. Thanks!!!
Zoffix looks to be a problem in moarvm. perl6 -e "say $*IN.read-internal(1000)" gives an empty buf (Buf[uint8]:0x<>) if the input got fancypants chars 17:17
jnthn wat, the bytes even come out wrong? 17:20
Zoffix yea
jnthn We...just call read: github.com/MoarVM/MoarVM/blob/mast...ile.c#L144 17:21
Zoffix _read msdn.microsoft.com/en-us/library/wyssk1bs.aspx 17:22
It's redefined by a macro
jnthn Right, to _read
Zoffix tries with a file
jnthn We're putting the thing in binary mode too: github.com/MoarVM/MoarVM/blob/mast...ile.c#L496 17:23
Zoffix Works with a file. My guess it's the not-a-proper-filehandle thing so it returns 0 bytes read.
jnthn So shouldn't be any weirdness from text mode
But only for certain input? 17:24
Zoffix Oh right... Weird :)
lizmat clickbaits p6weekly.wordpress.com/2017/11/20/...ia-videos/ 17:25
jnthn Very weird. But I already have one workaround for _read doing weird things with a console
(If you ask for more than 16KB it dies)
So it wouldn't surprise me in the least if there's yet more weird, though at least that case gave an error, not an empty buffer... 17:26
timotimo m(
jnthn wanders home 17:28
perlpilot That question on SO about hashes having an update method ... sounds like that's something Perl 6 could borrow. 17:31
stackoverflow.com/questions/474073...dictionary
The answers that are there are all awkward IMHO 17:32
lizmat likes "%hash ,= %u;" 17:35
ilmari ooh, nice 17:36
perlpilot aye, that's my favorite but in the spirit of timtowtdi, could we not have .update() as well?
ilmari or .merge() ? 17:41
moritz .merge sounds to me like it'd handle multiple levels of hashes 17:43
ilmari point
timotimo javascript has Object.assign which allows you to merge multiple objects i believe 17:44
buggable New CPAN upload: SemVer-0.1.0.tar.gz by TYIL cpan.metacpan.org/authors/id/T/TY/...1.0.tar.gz 18:43
Geth doc: 2cc35cb228 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/operators.pod6
Document `does` can take non-composable :Ds on RHS

Rakudo impl: github.com/rakudo/rakudo/commit/575d31e251 Spec: github.com/perl6/roast/commit/344d6d50a0
18:57
synopsebot Link: doc.perl6.org/language/operators
Geth doc: 2cd2a4fe3f | (Jan-Olof Hendig)++ | doc/Language/grammar_tutorial.pod6
Add missing =SUBTITLE
19:28
synopsebot Link: doc.perl6.org/language/grammar_tutorial
buggable New CPAN upload: App-Cpan6-0.17.2.tar.gz by TYIL cpan.metacpan.org/authors/id/T/TY/...7.2.tar.gz 21:33
Altreus If class Y is X, can I change an object of type X into type Y? 22:56
I'd like to extend XML::Document, and also have its routines return typed nodes 22:57
its methods
gfldex m: class B { method m { return self } }; class A is B {}; say A.new.m.^name; 22:58
camelia A
gfldex Altreus: ^^^
Altreus gfldex: sure, but XML::Document.lookfor returns an array of XML::Element objects 22:59
And I want to extend XML::Element with several new types
gfldex Altreus: I can't see why that should be a problem. 23:00
Altreus So is there a better way than doing «MyElementType.new($_) for (get some elements)» ?
gfldex Altreus: you will have to overload the method that is doing the parsing 23:01
Altreus but surely I'd just be doing the above in that method/ 23:02
Otherwise I'd have to reimplement its entire behaviour just to change the type of object it returns
gfldex Altreus: this might help: gfldex.wordpress.com/2017/10/08/it...-way-down/ 23:03
timotimo Altreus: perhaps what you want can be done by just mixing in roles 23:09
Altreus I was thinking along those lines
timotimo otherwise, rebless could work, but it's internalsy (use nqp; nqp::rebless(NewType, $object) or the other way around)
Altreus but then I thought, now it's a role 23:10
So it doesn't have to go on an XML::Element
So *then* I thought, how do I provide a different version of the method depending on what I mix it into?
It doesn't matter, but academically...
🤔 Can I overload the method based on the type of $self? 23:11
jnthn m: role R { multi method m(Int:) { "Int!" }; multi method m(Str:) { "Str!" } }; say (1 but R).m; say ("foo" but R).m 23:13
camelia Int!
Str!
jnthn Something like that?
Altreus yeah :D
hey that's what I expected
thanks ^-^
jnthn Wasn't quite sure what you were after; glad I guessed right :)
AlexDaniel jnthn: any progress with whateverable segv? Any assistance I can provide? 23:25
Altreus I seem to have invented an infinite loop 23:26
jnthn AlexDaniel: Not yet; today I thought I'd try and quickly finish up a spesh change I was working on last week, and the *one* failing spectest uncovered a tricky issue that I then spent the rest of the day trying to work out how to try and solve... 23:30
AlexDaniel awesome 23:31
AlexDaniel loves progress
jnthn Aye, just not on the whateverable segv, alas.
AlexDaniel someone's bug today is whateverable's bug tomorrow, so I'm happy with any progress :) 23:32
hmm fwiw that seems to be the golfed version of #1262: gist.github.com/AlexDaniel/f7e4379...fdf2453506 23:34
Altreus gosh, I spent all this time putting together a github thingy with an example XML file to ask why I have an infinite loop, and the example file I found on the internet doesn't give me an infinite loop D: 23:46
I can't tell you how pleasing it is to use the word 'but' in a program