»ö« 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. |
|||
00:04
kyan left
00:05
mcmillhj joined
00:10
mcmillhj left,
Cabanossi left
00:12
_28_ria joined
00:13
Cabanossi joined
00:14
markong left
00:18
mcmillhj joined,
llfourn joined
|
|||
Geth | ecosystem: f9440918c3 | (Tony O'Dell)++ (committed using GitHub Web editor) | META.list (Digest::FNV) FNV hashing for the masses |
00:18 | |
00:23
mcmillhj left
00:27
MasterDuke left
00:32
mcmillhj joined
00:34
lookatme joined
|
|||
lookatme | o\ | 00:34 | |
00:37
mcmillhj left
00:38
mcmillhj joined
00:41
wamba left
00:43
mcmillhj left
|
|||
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 | ||
00:50
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
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 | |
00:51
ZzZombo joined
00:54
mcmillhj joined
|
|||
lookatme | awesome module | 00:54 | |
00:59
mcmillhj left
01:02
cdg joined
01:04
mcmillhj joined
01:06
cdg left
01:07
bazzaar joined
|
|||
bazzaar | \o perl6 | 01:08 | |
AlexDaniel | o/ | ||
bazzaar | m: "1\n2\n3\n4\n".chars.say; | 01:09 | |
camelia | 8 | ||
01:09
mcmillhj left
|
|||
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 | |
01:20
mcmillhj joined
|
|||
bazzaar | ugexe : thanks for your help | 01:21 | |
lookatme : thanks for your help also | |||
I'm now reading up on perl6 whitespace :) | 01:23 | ||
01:23
a3r0 joined
|
|||
lookatme | :D | 01:24 | |
01:25
mcmillhj left
01:29
mcmillhj joined
01:30
Aaronepower left
01:33
itaylor57 left
01:37
klapperl_ left,
klapperl joined,
itaylor57 joined
01:44
MasterDuke joined
|
|||
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 :) | ||
01:50
comborico1611 left
|
|||
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 | |
01:58
troys is now known as troys_
02:04
itaipu left
|
|||
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) | ||
02:08
cdg joined
|
|||
bazzaar | lookatme: just saw what you did there, thanks | 02:10 | |
lookatme | you welcome :P | 02:11 | |
02:20
R0b0t1_ left
02:23
R0b0t1_ joined
02:25
ZzZombo left
02:33
llfourn_ joined
02:36
eliasr left
02:37
llfourn left
02:39
mcmillhj left
02:40
cdg left
02:44
ilbot3 left
|
|||
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) | ||
02:52
kaare_ left,
kaare__ joined
02:55
ilbot3 joined,
ChanServ sets mode: +v ilbot3
03:06
noganex_ joined
03:07
mson left
03:09
noganex left
03:11
mcmillhj joined
03:14
ufobat___ joined
03:16
bazzaar left,
mcmillhj left
03:17
ufobat_ left,
ufobat left
03:18
ufobat joined
03:24
pilne left
03:34
Herby_ joined
|
|||
Herby_ | o/ | 03:34 | |
03:44
troys_ is now known as troys
03:49
mcmillhj joined
03:53
mson joined
03:54
mcmillhj left
03:57
kaare__ left,
kaare__ joined
04:05
xtreak joined,
ZzZombo joined
04:06
aborazmeh left
04:16
troys is now known as troys_,
Herby_ left
04:19
mcmillhj joined
04:24
HoboWithAShotgun left,
mcmillhj left
04:26
mcmillhj joined,
Cabanossi left,
Cabanossi joined
04:31
mcmillhj left
04:44
Kotnuk joined
|
|||
lookatme | o/ | 04:45 | |
Kotnuk | o/ | ||
Is perl 6 faster or slower than perl 5? | 04:51 | ||
04:55
Cabanossi left
04:56
khw left,
Cabanossi joined
04:57
mcmillhj joined
05:01
Kotnuk left
05:02
mcmillhj left
05:20
snapsisy joined
05:27
mcmillhj joined
05:31
xtreak left
05:32
mcmillhj left
05:34
xtreak joined
05:37
mcmillhj joined
05:48
mcmillhj left
05:50
kaare__ left,
kaare__ joined
05:54
snapsisy left
|
|||
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 | ||
06:00
piojo1 left
|
|||
lookatme | I don't like <> operator | 06:01 | |
06:01
piojo joined
|
|||
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 | |
06:07
mson left
|
|||
lookatme | m: say {}.WHAT; say { 5 }.WHAT; | 06:08 | |
camelia | (Hash) (Block) |
||
06:08
troys_ is now known as troys
|
|||
lookatme | And I don't like those not consistent ^^^ | 06:09 | |
06:12
darutoko joined
06:20
s0me0ne-unkn0wn joined,
wamba joined
06:21
mson joined
06:22
Xliff left,
Xliff joined
06:23
s0me0n3-unkn0wn left
06:25
evalable6 left,
evalable6 joined
06:26
Geth_ left,
releasable6 left,
unicodable6 left,
bisectable6 left,
bisectable6 joined,
unicodable6 joined,
releasable6 joined,
Geth__ joined
06:30
parv joined
06:36
ivans left,
ivans joined
|
|||
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 ? | ||
06:54
rindolf joined
06:55
xtreak left
06:57
xtreak_ joined
06:58
mcmillhj joined
07:02
mcmillhj left
07:13
troys left
07:14
Khisanth left,
domidumont joined
07:18
llfourn_ left
07:19
domidumont left
07:20
domidumont joined
07:26
Khisanth joined
07:27
Brumbazz joined
07:32
mcmillhj joined
07:38
mcmillhj left
07:40
Cabanossi left
07:41
Cabanossi joined
07:44
wamba left
07:45
piojo1 joined,
piojo left
07:50
parv left
07:53
wander joined
|
|||
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 | |
08:02
domidumont left
|
|||
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 |
||
08:05
domidumont joined
08:06
mcmillhj joined
08:12
mcmillhj left
|
|||
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 |
||
08:18
kaare__ left
08:19
kaare__ joined
08:21
kaare__ is now known as kaare_
08:25
abraxxa joined,
regreg left
08:26
kaare_ left
|
|||
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) |
||
08:27
mson left,
kaare_ joined
|
|||
lookatme | Why `[ %hsh ]` is an Array ? | 08:27 | |
m: say [1].WHAT | 08:28 | ||
camelia | (Array) | ||
lookatme | m: say [1] | ||
camelia | [1] | ||
08:29
dakkar joined
|
|||
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 | ||
08:31
wamba joined
|
|||
wander | yes, :delete is what i want | 08:34 | |
thank you | |||
08:39
Cabanossi left
08:40
xtreak_ left
|
|||
piojo1 | lookatme: it seems like a perl-5-ism | 08:41 | |
it's an automatic flattening | |||
08:42
Cabanossi joined
|
|||
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 | ||
08:43
xtreak joined
08:44
mcmillhj joined
|
|||
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 | |||
08:49
mcmillhj left
|
|||
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 | |
08:57
xtreak left
09:01
lowbro joined,
lowbro left,
lowbro joined
09:03
zakharyas joined
09:11
kaare_ left,
lookatme left,
kaare_ joined
09:14
mcmillhj joined
09:19
mcmillhj left
09:21
lowbro left
09:22
lowbro joined,
lowbro left,
lowbro joined,
xtreak joined
09:27
ZzZombo left,
ZzZombo joined,
rindolf left
09:29
zakharyas left
09:32
kaare_ left,
kaare_ joined
09:33
zakharyas joined
09:38
scimon joined
09:39
Cabanossi left
09:40
domidumont1 joined
09:41
Cabanossi joined
09:42
ZzZombo left,
domidumont left
09:45
itaipu joined
09:50
ZzZombo joined,
wamba left
09:51
wander left
|
|||
tyil | how to depend on a minimum version of another module in meta6.json? | 09:55 | |
10:04
HaraldJoerg joined
10:08
zakharyas1 joined,
xtreak_ joined,
xtreak left
10:09
zakharyas left
10:13
geospeck joined
|
|||
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 | |
10:14
zakharyas1 left
10:17
sena_kun joined
10:26
robertle joined
10:33
mcmillhj joined
10:38
mcmillhj left
|
|||
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 | ||
10:43
Sgeo left
10:48
kaare__ joined,
kaare_ left
10:50
piojo1 left
10:51
domidumont1 left
10:54
Cabanossi left
10:55
kaare__ left
10:56
kaare__ joined,
zakharyas joined
|
|||
ZzZombo | hello | 10:56 | |
10:56
Cabanossi joined
11:11
mcmillhj joined
11:14
xtreak_ left
11:17
mcmillhj left
11:18
xtreak joined
11:23
TEttinger left
|
|||
DrForr | o/ | 11:23 | |
11:27
xtreak left
11:34
invalid_nickname joined
11:35
invalid_nickname left
11:36
HoboWithAShotgun joined
11:43
mcmillhj joined
|
|||
tbrowder | \o DrForr | 11:47 | |
ZzZombo | how can I *bind* a value to an attribute? | ||
11:48
mcmillhj left
|
|||
jnthn | $!attr := $value; | 11:51 | |
11:54
Cabanossi left
11:57
Cabanossi joined
11:59
llfourn joined
12:00
domidumont joined
12:10
Sgeo joined
|
|||
Geth | doc: 0c8fecfaf5 | (Jan-Olof Hendig)++ | doc/Language/traps.pod6 Even more formatting fixes |
12:11 | |
synopsebot | Link: doc.perl6.org/language/traps | ||
12:11
domidumont left
|
|||
Geth | doc: 3625f54aaa | (Jan-Olof Hendig)++ | doc/Language/traps.pod6 Fixed three broken links |
12:18 | |
12:21
mcmillhj joined
12:26
rindolf joined,
mcmillhj left
|
|||
Geth | mu: c9b2e40fe7 | (Zoffix Znet)++ (committed using GitHub Web editor) | misc/perl6advent-2017/schedule Fix typo |
12:26 | |
12:27
xtreak joined
12:28
geospeck left
12:32
xtreak left
|
|||
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) | ||
12:42
_28_ria left
12:43
_28_ria joined
12:51
domidumont joined
12:54
eliasr joined
12:55
mcmillhj joined
13:00
mcmillhj left
13:02
_28_ria left
13:06
mcmillhj joined
13:07
geospeck joined
13:11
mcmillhj left
|
|||
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 | |
13:21
stmuk joined
13:23
stmuk left,
stmuk joined,
ZzZombo_ joined
|
|||
ZzZombo_ | test | 13:23 | |
stmuk | how long does Cro::HTTP testing take? | ||
13:24
ZzZombo left
|
|||
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 | |||
13:30
piojo joined
|
|||
stmuk | hmm I'll see if I can reproduce again | 13:30 | |
lucs_ | Inline::Perl5 problem: gist.github.com/lucs/43aa5fa13f686...4a7b45d811 | 13:31 | |
13:31
Brumbazz left,
lucs_ is now known as lucs
|
|||
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 | |
13:39
mcmillhj joined
13:41
wamba joined
13:48
holyghost joined
13:52
geospeck left
|
|||
Geth | doc: 11fe7c48ed | (Jan-Olof Hendig)++ | doc/Language/testing.pod6 Improved code formatting |
13:53 | |
synopsebot | Link: doc.perl6.org/language/testing | ||
13:56
Cabanossi left
13:57
Cabanossi joined
13:58
Brumbazz joined
14:01
holyghost left
14:03
HoboWithAShotgun left
|
|||
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 | ||
14:06
setty1 joined
|
|||
jnthn | BTW, there's now also a #cro channel :) | 14:07 | |
14:08
cdg joined
14:12
kaare__ left,
kaare__ joined
14:13
cdg left
|
|||
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 | ||
14:21
HaraldJoerg left
14:25
ZzZombo_ left
14:26
ZzZombo joined
|
|||
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 | ||
14:32
mson joined
|
|||
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. | |||
14:38
robertle left
14:41
cdg joined
14:43
kaare__ left,
kaare__ joined
14:46
cdg left
|
|||
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) | ||
14:51
comborico1611 joined
14:54
dakkar left
14:55
dakkar joined,
markmont joined,
ZzZombo left
14:56
ZzZombo joined,
ZzZombo left,
ZzZombo joined
14:59
ZzZombo left
15:00
ZzZombo joined
15:05
zakharyas left,
zakharyas joined
15:10
zakharyas left
15:12
khw joined
15:15
wamba left
15:26
wander joined
|
|||
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 | |
15:31
ZzZombo left
15:32
ZzZombo joined,
ZzZombo left,
ZzZombo joined
|
|||
wander | see | 15:33 | |
15:34
mcmillhj left
|
|||
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 | |
15:41
ZzZombo left,
ZzZombo joined
15:44
bdmatatu joined
15:46
mcmillhj joined
15:50
robertle joined
15:52
mcmillhj left
|
|||
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 | ||
15:55
Cabanossi left
|
|||
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 | ||
15:57
Cabanossi joined
|
|||
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 |
||
16:00
mcmillhj joined
|
|||
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 | |
16:04
Brumbazz left
|
|||
ilmari | s: Str, &subst | 16:04 | |
SourceBaby | ilmari, Something's wrong: ERR: ===SORRY!=== Error while compiling -eUndeclared 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 -eUndeclared 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 | ||
16:05
mcmillhj left
|
|||
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 | ||
16:07
geospeck joined
16:11
zakharyas joined
16:15
troys joined
16:16
mcmillhj joined
16:19
raschipi joined
16:20
squashable6 joined,
ChanServ sets mode: +v squashable6
16:21
mcmillhj left
|
|||
raschipi | Debian is thinking about enabling automatic uploads on upstream release. | 16:25 | |
16:26
zakharyas left,
kaare__ left
16:27
mcmillhj joined
16:29
lowbro left
16:30
kaare__ joined
16:32
khw left,
mcmillhj left
16:34
Brumbazz joined
16:37
itaipu left
|
|||
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. | |||
16:40
st_elmo joined
16:42
chsanch joined
16:43
Brumbazz left,
callyalater joined
16:44
mcmillhj joined
16:49
itaipu joined
16:50
wamba joined
|
|||
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 | |
16:52
mcmillhj left
|
|||
[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 | ||
16:55
mcmillhj joined,
raschipi left,
abraxxa left
|
|||
[Coke] | huh | 16:56 | |
ugexe | what if you dont use the repl | 16:59 | |
17:00
mcmillhj left
|
|||
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 | |||
17:04
zakharyas joined
17:05
Brumbazz joined
|
|||
ugexe | what if you do perl6 -e "my $s = 'eñe'; $s.encode('utf8').say" | 17:05 | |
17:09
mcmillhj joined
|
|||
chsanch | C:\>perl6 -e "my $s = 'eñe'; $s.encode('utf8').say" | 17:09 | |
utf8:0x<65 c3 b1 65> | |||
17:10
khw joined
|
|||
chsanch | but, in powershell I'm getting an error: gist.github.com/anonymous/df47676a...f146857199 | 17:11 | |
17:11
domidumont left,
Zoffix joined
|
|||
jnthn | Powershell is probably interpreting the $ as a shell variable | 17:11 | |
17:12
scimon left,
troys is now known as troys_
|
|||
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!!! | |||
17:14
chsanch left
17:15
itaipu left
17:16
mcmillhj left
|
|||
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 | ||
17:20
zakharyas left
|
|||
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 | |||
17:23
zakharyas joined
|
|||
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( | ||
17:27
itaipu joined
17:28
konsolebox left
|
|||
jnthn wanders home | 17:28 | ||
17:29
mcmillhj joined,
domidumont joined
|
|||
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 | ||
17:32
konsolebox joined
17:33
mcmillhj left
17:35
troys_ is now known as troys
|
|||
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? | ||
17:40
Zoffix left,
Khisanth left,
itaipu left
17:41
mcmillhj joined
|
|||
ilmari | or .merge() ? | 17:41 | |
17:42
itaipu joined
|
|||
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 | |
17:44
zakharyas left,
dakkar left
17:46
mcmillhj left
17:48
mcmillhj joined
17:49
konsolebox_ joined
17:51
konsolebox left
17:53
mcmillhj left
17:55
Cabanossi left
17:56
ChoHag left,
Cabanossi joined
17:58
mcmillhj joined
17:59
cdg joined
18:03
mcmillhj left
18:05
robertle left
18:09
Khisanth joined
18:14
mcmillhj joined
18:17
sftp left
18:20
mcmillhj left
18:22
telex joined
18:30
mcmillhj joined
18:43
mcmillhj left
|
|||
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 | |
18:51
zacts left,
wander left
|
|||
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 | ||
19:08
mcmillhj joined
19:10
Cabanossi left
19:12
Cabanossi joined
19:14
itaipu left
19:17
darutoko left
|
|||
Geth | doc: 2cd2a4fe3f | (Jan-Olof Hendig)++ | doc/Language/grammar_tutorial.pod6 Add missing =SUBTITLE |
19:28 | |
synopsebot | Link: doc.perl6.org/language/grammar_tutorial | ||
19:47
evalable6 left,
evalable6 joined
19:48
cdg left
19:50
perlpilot left
19:57
wamba left
20:02
mson left
20:03
raiph joined
20:08
Brumbazz left,
domidumont left
20:11
zakharyas joined
20:16
troys is now known as troys_
20:17
Brumbazz joined
20:27
bdmatatu left
20:28
troys_ is now known as troys
20:31
ChoHag joined
20:34
Brumbazz left
20:44
ufobat___ left
20:48
st_elmo left
20:49
TEttinger joined
20:56
geospeck left,
geospeck joined
21:01
geospeck left
21:04
troys is now known as troys_
21:10
Cabanossi left
21:11
Cabanossi joined
21:20
Brumbazz joined
21:26
kyan joined
21:33
zakharyas left
|
|||
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 | |
21:36
kitsunenokenja joined
21:38
cdg joined
21:44
xi- joined
21:45
setty1 left
21:48
mson joined
22:00
mcmillhj left,
xi- left
22:03
xi- joined
22:10
b2gills left
22:12
mcmillhj joined
22:14
TEttinger left
22:19
cdg left
22:21
mcmillhj left
22:24
b2gills joined
22:25
markmont left,
itaipu joined
22:26
markong joined
22:27
mcmillhj joined
22:30
comborico1611 left
22:31
comborico1611 joined,
mcmillhj left
22:37
mcmillhj joined
22:39
Cabanossi left
22:40
cdg joined
22:42
Cabanossi joined,
mcmillhj left
22:44
cdg left
22:48
troys_ is now known as troys
22:51
mcmillhj joined
22:53
rindolf left,
markmont joined
22:56
mcmillhj left
|
|||
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 | |
23:04
xi- left
23:05
ChoHag left
23:06
xi- joined
|
|||
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 | ||
23:11
mcmillhj joined
|
|||
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 :) | ||
23:15
mcmillhj left
23:17
Brumbazz left,
ChoHag joined
23:24
mcmillhj joined,
Cabanossi left
|
|||
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 | |
23:26
Cabanossi joined
23:29
mcmillhj left
|
|||
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. | ||
23:32
raiph left
|
|||
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 | ||
23:36
astronav_ joined
23:38
raschipi joined
23:39
astronav_ left,
itaipu left
23:43
mcmillhj joined
|
|||
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 | |||
23:48
mcmillhj left,
ivans_ joined
23:51
ivans left
23:53
markong left
23:55
markong joined
23:57
mcmillhj joined
|