🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
00:08 aborazmeh joined, aborazmeh left, aborazmeh joined 00:19 silug left 00:21 silug joined 00:24 wildtrees left
rbt Can slurps be prevented from flattening arrays? 00:50
sub f (*@params) { }
f([1,2,3], [4,5,6]);
I'd like @params to have 2 elements, both arrays. 00:51
I'd rather not have to wrap them in Captures at the caller level.
Nevermind. A reference is sufficient. 00:53
f(\[1,2,3],\[4,5,6]);
MasterDuke m: sub f(+@a) { .say for @a }; f([1,2], [4,5]) 00:55
camelia [1 2]
[4 5]
rbt Ahh. That's better. 00:58
Thanks MasterDuke
MasterDuke np
rbt wildtrees DBIish above may be a single character fix :) 01:01
plus a few tests...
01:25 chacewells joined, Altai-man_ joined 01:27 sena_kun left 01:51 vike left 01:53 Redfoxmoon left, chacewells left 01:54 Redfoxmoon joined 01:55 vike joined 02:06 molaf left 02:15 mtj_ joined, Itaipu_ left 02:19 molaf joined 02:35 aborazmeh left 02:54 xinming_ left, xinming_ joined 03:04 Doc_Holliwood joined 03:26 sena_kun joined 03:27 orinthe left 03:28 Altai-man_ left, orinthe joined
xinming_ When run vim with syntax highlighter, The cursor moves slow. Is there a way to fix this? 03:33
I know it's ahrd to parse perl6 soruce code, But is there a way to make the matching faster, even without some highlighting 03:34
03:35 vike left
xinming_ Ignore me, Seems with vim --clean speed things a lot 03:38
03:53 guifa left
xinming_ Still slow when I try to open a new line. 03:55
The bundled vim is already loaded, even with newest vim 8.2, It still uses the syntax highligher from 2013. >_< 04:06
04:25 wamba joined 04:40 ensamvarg joined 04:48 Doc_Holliwood left 04:58 pilne left 05:02 Sgeo__ left 05:03 pilne joined 05:05 Sgeo joined 05:15 hungrydonkey joined 05:25 Altai-man_ joined 05:28 sena_kun left 05:31 sena_kun joined 05:32 Altai-man_ left 05:50 wamba left 06:19 hungrydonkey left 06:45 xelxebar joined
synthmeat xinming_: try installing github.com/Raku/vim-raku 06:48
xinming_ synthmeat: I need to set re=1 06:57
synthmeat yeah, re=1 is still faster (though, ime, more frequently incorrect) 06:58
07:08 rindolf joined 07:10 Redfoxmoon left, Redfoxmoon joined 07:30 Altai-man_ joined 07:33 sena_kun left 07:52 wamba joined 07:56 wamba left 07:57 wamba joined 08:01 hungrydonkey joined 08:05 Doc_Holliwood joined 08:26 huf joined 08:27 sftp left 08:42 ribasushi joined 08:49 sauvin left 08:50 Black_Ribbon left 09:06 wamba left 09:08 hungrydonkey left 09:10 sjm_uk joined, upupbb-user1 joined 09:14 sauvin joined 09:19 kst`` joined 09:21 kst` left 09:24 wamba joined 09:30 xinming_ left 09:31 sena_kun joined 09:33 Altai-man_ left 09:34 xinming_ joined 09:35 chloekek joined 09:47 xinming_ left, xinming_ joined
Doc_Holliwood yo jnthn. does comma support a "one file mode" somehow? 10:00
you know, sometimes you just wanna quick edit a file
and if i do "comma filename" on the shell it opens the file in a random window (given there are some projects open= 10:01
so something like comma -s filename and it opens the file into its own window without all the clutter (project tree etc) would be nice 10:02
m: class Human {}; class Computer {}; 10:18
subset Player where * ~~ any(Human, Computer);
sub add( Player $x ) { $x.say };
add(Human.new);
camelia ( no output )
Doc_Holliwood oops 10:19
m: class Human {}; class Computer {}; subset Player where * ~~ any(Human, Computer); sub add( Player $x ) { $x.say }; add(Human.new);
camelia Human.new
Doc_Holliwood is there any other language you can do that with? 10:20
MasterDuke class Human {}; class Computer {}; subset Player where Human|Computer; sub add( Player $x ) { $x.say }; add(Human.new); # slightly shorter version
evalable6 Human.new
Doc_Holliwood =) 10:21
sena_kun Doc_Holliwood, no, I don't think it is really supported. I mean, if it works, then lucky, but if it's not it's because nobody has worked on this particular bit. 10:23
10:23 wamba left 10:24 __jrjsmrtn__ left, __jrjsmrtn__ joined
Doc_Holliwood m: class Human {}; class Computer {}; enum Player(Human, Computer); 10:28
camelia Use of uninitialized value of type Human in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
in any type_declarator at /home/camelia/rakudo-m-inst-1/share/perl6/lib/Perl6/Grammar.moarvm l…
Doc_Holliwood If you had the ability to group types into other other types at compile time, wouldn't that potentially be able to solve some inheritance problems? 10:30
sena_kun isn't subset for this? 10:33
Doc_Holliwood late bound
sena_kun m: class Human {}; class Computer {}; subset Player where Human|Computer;
camelia ( no output )
sena_kun ah
d'oh
10:36 upupbb-user1 left
MasterDuke if you define the subset in a BEGIN block? 10:37
sena_kun MasterDuke, I think the issue specified is that `where` clause will execute on runtime and won't be zero cost. 10:48
Though those are my assumptions, because I honestly have no idea how costly are types here. 10:49
Doc_Holliwood m: class Human {}; class Computer {}; class Rasperry is Computer {}; subset Player where * ~~ Human|Computer; sub add( Player $x ) { $x.say }; add(Human.new); add(Rasperry.new); add("Rasperry"); 10:50
camelia Human.new
Constraint type check failed in binding to parameter '$x'; expected Player but got Str ("Rasperry")
in sub add at <tmp> line 1
in block <unit> at <tmp> line 1

Rasperry.new
Doc_Holliwood yes, runtime check
sena_kun m: class A {}; class B is A {}; sub a(A $a) { $a }; for ^10_000_000 { a(A.new) }; say now - INIT now 10:51
10:51 rbt left
camelia 0.1549698 10:51
sena_kun m: class A {}; class B {}; subset P where A|B; sub a(P $a) { $a }; for ^1_000_000 { a(A.new) }; say now - INIT now 10:52
camelia 3.4070221
10:52 rbt joined
Doc_Holliwood quite expensive 10:52
sena_kun m: class A {}; class B is A {}; sub a(A $a) { $a }; for ^10_000_000 { a(B.new) }; say now - INIT now
camelia 0.1499671
sena_kun m: class A {}; class B is A {}; sub a(A $a) { $a }; for ^10_000_000 { a(rand > 0.5 ?? B.new !! A.new) }; say now - INIT now 10:53
camelia 2.6079168
sena_kun m: class A {}; class B {}; subset P where A|B; sub a(P $a) { $a }; for ^10_000_000 { a(rand > 0.5 ?? B.new !! A.new) }; say now - INIT now
oops
that'll timeout
m: class A {}; class B {}; subset P where A|B; sub a(P $a) { $a }; for ^1_000_000 { a(rand > 0.5 ?? B.new !! A.new) }; say now - INIT now
camelia (timeout) 10:54
6.7706391
Doc_Holliwood i can understand why the subset check is costly, but why the rand? 10:55
sena_kun m: say 6.7706391 * 10 / 2.6079168;
camelia 25.96186773
sena_kun so like 25x the difference
Doc_Holliwood, I think without rand spesh possibly can do optimization throwing out costly checks, because it sees that `a` is called with the same type 100% of the time. 10:56
once again, I might be wrong about all this, of course 10:57
Doc_Holliwood m: class A {}; class B is A {}; sub a(A $a) { $a }; for ^10_000_000 { a(rand > 0.5 ?? A.new !! A.new) }; say now - INIT now
camelia 0.816861
Doc_Holliwood huh
m: class A {}; class B is A {}; sub a(A $a) { $a }; for ^10_000_000 { a(rand > 0.5 ?? A.new !! B.new) }; say now - INIT now
camelia 2.561565
Doc_Holliwood blinks
sena_kun spesh++ jnthn++
Doc_Holliwood m: class A {}; class B is A {}; sub a(A $a) { $a }; for ^10_000_000 { a( (A.new, B.new).pick }; say now - INIT now 10:58
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> 3or ^10_000_000 { a( (A.new, B.new).pick 7⏏5}; say now - INIT now
Doc_Holliwood m: class A {}; class B is A {}; sub a(A $a) { $a }; for ^10_000_000 { a( (A.new, B.new).pick ) }; say now - INIT now
sena_kun Doc_Holliwood, it's actually a very nice optimization, because most of the routines are called with the same types 95% of the time.
camelia 10.441438
Doc_Holliwood m: class A {}; class B is A {}; sub a(A $a) { $a }; for ^10_000_000 { a( new (A, B).pick ) }; say now - INIT now 10:59
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
new used at line 1 (in Raku please use method call syntax instead)
Doc_Holliwood m: class A {}; class B is A {}; sub a(A $a) { $a }; for ^10_000_000 { a( ((A, B).pick).new ) }; say now - INIT now
sena_kun m: class A {}; class B is A {}; sub a(A $a) { $a }; constant Types := A.new, B.new; for ^10_000_000 { a( Types.pick ) ); say now - INIT now;
camelia 6.00729146 11:00
5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3.new; for ^10_000_000 { a( Types.pick ) 7⏏5); say now - INIT now;
expecting any of:
statement end
statement modifier
state…
sena_kun m: class A {}; class B is A {}; sub a(A $a) { $a }; constant Types := (A.new, B.new); for ^10_000_000 { a(Types.pick) }; say now - INIT now; 11:01
camelia 3.354583
sena_kun m: class A {}; class B is A {}; sub a(A $a) { $a }; constant Types := (A.new, B.new); for ^10_000_000 { a(Types.pick) }; say now - INIT now;
camelia 2.839015
sena_kun d'uh
m: class A {}; class B is A {}; sub a(A $a) { $a }; for ^10_000_000 { a( (A.new, B.new).pick ) }; say now - INIT now
camelia 10.55703439
sena_kun so around 3-4x difference between when you have a single list to choose from and every time construct and throw away a new one 11:02
11:08 pecastro joined 11:15 wamba joined 11:26 aborazmeh joined, aborazmeh left, aborazmeh joined 11:30 Altai-man_ joined 11:33 sena_kun left, natrys joined
Geth doc: c976684978 | (JJ Merelo)++ | README.md
Adds info about updates, closes #3271
11:43
linkable6 DOC#3271 [closed]: github.com/Raku/doc/issues/3271 [build] docs.raku.org update
11:51 upupbb-user1 joined 12:00 aborazmeh_ joined, aborazmeh_ left, aborazmeh_ joined 12:01 aborazmeh left, aborazmeh_ is now known as aborazmeh 12:14 epony left, epony joined 12:21 kst`` left 12:26 upupbb-user1 left 12:30 upupbb-user1 joined
cpan-raku New module released to CPAN! Kind (0.1.1) by 03KAIEPI 12:31
12:34 mowcat joined
Voldenet m: (^3 X ^3).flat.map(* + *).say 12:35
camelia (0 1 2 1 2 3 2 3 4)
Voldenet Is there some more friendly syntax for this?
m: (^3 X ^3).map( -> ($a, $b) { $a + $b }).say 12:36
camelia (0 1 2 1 2 3 2 3 4)
12:36 aborazmeh left
Voldenet the above looks a lot more verbose 12:36
12:37 hungrydonkey joined, cpan-raku left, cpan-raku joined, cpan-raku left, cpan-raku joined, veesh_ joined 12:39 veesh left, veesh_ is now known as veesh
lizmat sometimes I wish we had an infix op that would flatten its operands 12:39
m: sub infix:<foo>(\a,\b) { (a,b).flat }; dd (1,2,3) foo (5,6,7) 12:42
camelia (1, 2, 3, 5, 6, 7).Seq
Kaiepi m: say (^3 X ^3)>>.sum
camelia (0 1 2 1 2 3 2 3 4)
Kaiepi does this work Voldenet ? 12:43
MasterDuke lizmat: i would use _ as the op. it's only other use is as a type smiley, right?
lizmat I was more thinking &infix:<flat> maybe
MasterDuke hm, would it make sense as (pre|post)fix also? 12:45
moritz flat as a function and .flat as a method (postfix on an expression) already exist 12:48
Voldenet Kaiepi: kind of works, but i have a lot of elements (closer to ^1184 X ^74, but I didn't want to abuse the bot), so it's about 12:51
uh, 4 times slower
12:52 sftp joined
Kaiepi hm 12:52
MasterDuke that's why i suggested _, it's three chars shorter than flat 12:53
12:54 aborazmeh joined, aborazmeh left, aborazmeh joined
lizmat MasterDuke: they feels *way* too linenoisy 12:55
Voldenet also, I probably should've read the operators page more carefully:
m: (^3 X+ ^3).say
camelia (0 1 2 1 2 3 2 3 4)
Voldenet silly me
Kaiepi ahh yeah that works lol
13:00 huf left 13:08 mowcat left 13:13 huf joined
tbrowder hi, #raku 13:15
13:16 upupbb-user1 left
tbrowder need a bit of advice: i'm trying to port a cpan perl module and it uses in several places setting a var to undef. should i use Any in its place? or Nil? 13:17
m: my $a = Any; say $a 13:19
camelia (Any)
tbrowder m: my $a=Nil; say $a
camelia (Any)
13:19 huf left
tbrowder m: my $a = Any; say $a.defined 13:20
camelia False
lizmat tbrowder: is the Perl code in the form of $a = undef ?
jnthn tbrowder: Probably Nil, since then if you also type constrain the variable it is reset to the correct thing
lizmat then $a = Nil would be the best solution
tbrowder hm, seems 13:21
yes, code typically; $a = undef
the code is mostly untyped as i see it 13:22
but i will use Nil. thanks lizmat & jnthn 13:23
er, now for porting regex another question, since i'm trying to use P5 for the first time. 13:27
lizmat if the P5 code is relatively old, then P5 should work 13:28
tbrowder given a p5 regex: s/blah//msg, should the trailing adverbs still be moved to the front like s:msgP5/blah// 13:30
13:31 sena_kun joined
tbrowder docs don't show such an example, but i haven't tried that yet... 13:32
13:33 Altai-man_ left
tbrowder m: my $a = "ab"; $a ~~ s:P5/ab/msg; say $a; 13:33
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed replacement part; couldn't find final /
at <tmp>:1
------> 3my $a = "ab"; $a ~~ s:P5/ab/msg; say $a;7⏏5<EOL>
expecting any of:
postfix
tbrowder m: my $a="ab";$a~~s:msgP5/ab/b/; say $a 13:35
camelia 5===SORRY!5=== Error while compiling <tmp>
Adverb msgP5 not allowed on substitution
at <tmp>:1
------> 3my $a="ab";$a~~s:msgP5/ab/b/7⏏5; say $a
tbrowder got to go for a while...will keep experimenting with my repl--thnx and bye 13:36
13:37 vike joined, lucasb joined 13:42 oneeggeach joined 13:43 oneeggeach left 14:00 aborazmeh left 14:12 pilne_ joined 14:14 sjm_uk left, wamba left, pilne left 14:19 sjm_uk joined
Kaiepi huh, i finally found a use for the S metaoperator 14:20
i was using a junction as the refinement of a subset and needed one typecheck to always happen before the other 14:21
lizmat example?
14:21 molaf left
Kaiepi i'm not sure this makes a good example, i needed one to happen before the other because the other was throwing sometimes when it shouldn't be 14:23
14:23 caterfxo left, October25 joined
Kaiepi here it is anyway though gist.github.com/Kaiepi/f121eed99a3...7d49b1d188 14:24
the exception being thrown seems like something going wonky with mixins again, i'll try to golf it 14:29
lizmat I'm pretty sure S is a noop at the moment, as Junctions are evaluated in order at the moment 14:30
14:38 pilne_ left
Kaiepi weird 14:38
tbrowder ok, think i have the proper syntax... given p5: s/ab//msg 14:39
m: my $a="abcabc"; $a ~~ s:P5:m:s:g/ab//; say $a 14:40
camelia cc
tbrowder \o/ field goal 14:41
Kaiepi ohhh it seemed like it was working because nothing was typechecking against that subset lol
tbrowder ??
Kaiepi the typecheck's in a weird spot in my code i don't have fully tested yet 14:42
14:42 pilne joined
tbrowder m: my $a="abcabc"; $a ~~ s:P5:m:s/ab//; say $a 14:43
camelia cabc
14:46 wamba joined 14:54 pilne left
Kaiepi oh i golfed the error 14:56
m: say {foo => 'bar'}.HOW ~~ Metamodel::ClassHOW
camelia Cannot resolve caller ACCEPTS(Perl6::Metamodel::ClassHOW:U: Perl6::Metamodel::ClassHOW+{<anon>}); none of these signatures match:
(Mu:U: \topic, *%_)
(Mu:U: Mu:U \topic, *%_)
(Any:D: Mu:D \a, *%_)
(Any:D: Mu:U, *%_ --> Bool::Fa
14:58 pilne joined 15:15 caterfxo joined 15:18 pilne_ joined, pilne left 15:19 Altai-man_ joined 15:20 pilne_ left 15:21 sena_kun left 15:27 pilne joined 15:35 pilne left 15:37 pilne joined
Geth doc: tinmarino++ created pull request #3272:
Change the perl6 command line to raku
15:41
16:01 stux|RC-only left 16:07 mojca left 16:09 mojca joined 16:24 sauvin_ joined 16:25 hungrydonkey left 16:26 sauvin left 16:27 sauvin_ is now known as sauvin 16:45 October25 left, stoned75 joined 16:50 sjm_uk left, stoned75_ joined
jjatria In the bindings I'm writing for Termbox I have a weird issue: I have a CStruct with a uint16 field that will under some circumstances get populated with a value of eg. -1 when I expect it to be 0xFFFF 16:53
16:53 xinming joined
jjatria Now, in a sense, these are the same 16:53
m: my uint16 $x = -1; say $x ~~ 0xFFFF
camelia True
jjatria For now I have a dirty workaround where I do $x += 0xFFFF + 1, but what am I doing wrong to need this in the first place? 16:54
jdv79 anyone know if there have been any attempts to gauge how easy it is to pickup raku with no prior knowledge?
16:55 xinming_ left
jjatria jdv79: jjmerelo made a couple of conference talks about his daughters picking it up 16:56
jdv79 any idea where those are? 16:57
jjatria See this for example: www.youtube.com/watch?v=oUGUgt-_0DA
Not sure if it's what you're after, but that's the first think I can think of
jdv79 its a start - thanks
16:58 [Sno] left 17:00 [Sno] joined
jdv79 just curious in general - the context is in the last few weeks i've been trying to dig into some of my raku projects again after not doing much for a while and im seemingly constantly running into stuff 17:00
its very frustrating. just curious if it is, or will be, a common deal... 17:01
its probably just me 17:02
17:12 Guest16 joined, Guest16 is now known as PacoLinux 17:16 sjm_uk joined 17:20 sena_kun joined 17:22 Altai-man_ left
sena_kun jdv79, you mean the infrastructure type of issues or the language itself? 17:26
Doc_Holliwood yeah, "stuff" in not really descriptive 17:36
17:38 molaf joined 17:56 stux|RC-only joined 17:57 aborazmeh joined, aborazmeh left, aborazmeh joined 18:01 stoned75 left 18:02 stoned75_ left 18:09 mowcat joined
pilne there have been some changes from vC to vD that might be impacting your code? 18:18
18:23 cpup joined 18:29 ensamvarg left 18:34 cognominal joined 18:38 cognomin_ left
jdv79 sena_kun: the lang. what do you mean by infra? 18:43
18:44 aborazmeh left
jdv79 its mostly about containers and glr/single arg rule for me lately 18:46
sena_kun jdv79, by infra I mean occasional bugs, possible hardships with installation, batteries not always included and things like that, which can be better with enough hands. 18:47
18:47 xi left 18:48 xi joined
lizmat jdv79: if your code was pre-GLR, yes, then you will have some adjusting to do 18:49
18:50 wamba left
jdv79 sena_kun: no, not really that stuff - in the past the segvs were too much for me but that seems to be mostly over 18:51
lizmat: nope. its all post GLR.
Geth doc: tinmarino++ created pull request #3273:
Change Perl 5 to Perl (1/6)
18:52
doc: tinmarino++ created pull request #3274:
Rename: Perl 5 -> Perl (README) (2/6)
18:55
18:55 sjm_uk left
Geth doc: tinmarino++ created pull request #3275:
Rename: Perl 5 -> Perl (util) (3/6)
18:55
doc: tinmarino++ created pull request #3276:
Rename: Perl 5 -> Perl (doc/Type) (4/6)
18:56
18:57 wamba joined
Geth doc: tinmarino++ created pull request #3277:
Rename: Perl 5 -> Perl (about) (5/6)
18:57
sena_kun doesn't have too much troubles with containers despite not really remembering all this internal "how it really works explanation for beginners" 18:58
jdv79 i'll try to document it i guess 18:59
Geth doc: tinmarino++ created pull request #3278:
Rename: Perl 5 -> Perl (Language) (6/6)
19:00 stoned75 joined, stoned75_ joined 19:06 mowcat left
Geth doc: e0f4a0075a | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/5to6-nutshell.pod6
Add P5 regex notes, add Jeff's status :-(
19:13
linkable6 Link: docs.raku.org/language/5to6-nutshell
tbrowder lizmat: had to handle pack/unpack in p5 port and yr P5pack module was put to use--thanks! 19:15
whew!
lizmat tbrowder: glad to hear someone is actually using it 19:16
19:16 orinthe left, orinthe joined
tbrowder worked like a charm. how did you get the original documentation 19:17
19:19 Altai-man_ joined
tbrowder into the readme? i didn't actually look at the file, but i will. the doc for PostScript s very large and I'm not sure I want to do anything but showna link to it and just note differences. 19:19
*PostScript::File
19:21 sena_kun left
Geth doc: 2451e9e709 | Tinmarino++ | 7 files
Rename: Perl 5 -> Perl (README)
19:23
doc: 4fcd21b8c3 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | 7 files
Merge pull request #3274 from tinmarino/merge_perl5_2

Rename: Perl 5 -> Perl (README) (2/6)
19:24 stoned75_ left, stux|RC joined 19:25 stoned75 left
tbrowder ok, i see the source is markdown. 19:26
uzl[m] m: augment class Str { method hi { "Hi, " ~ self.Str ~ '!' } }; "Paul".hi.say 19:27
camelia 5===SORRY!5=== Error while compiling <tmp>
augment not allowed without 'use MONKEY-TYPING'
at <tmp>:1
------> 3augment class Str7⏏5 { method hi { "Hi, " ~ self.Str ~ '!' }
expecting any of:
generic role
uzl[m] use MONKEY-TYPING; augment class Str { method hi { "Hi, " ~ self.Str ~ '!' } }; "Paul".hi.say 19:28
evalable6 Hi, Paul!
uzl[m] use MONKEY-TYPING; role Greetable { method hi { "Hi, " ~ self.Str ~ '!' } }; augment class Str { also does Greetable; }; "Paul".hi.say
evalable6 Hi, Paul!
tbrowder is there any interest in having the P5 regex syntax updated to incorporate later features like uniprops? 19:29
probably a waste of resources at thisnpoint in the game... 19:30
19:30 mniip joined
uzl[m] m: use MONKEY-TYPING; role Greetable { submethod BUILD { self.^add_method('hi', method () { $_.tc ~ ", {self.Str}." }) } }; augment class Str { also does Greetable; }; "Paul".hi.say 19:30
camelia No such method 'hi' for invocant of type 'Str'
in block <unit> at <tmp> line 1
uzl[m] ^ Is it possible to compose a role that metaprogram its methods into an augmented class? 19:32
When I say compose, I mean 'fully composed' as in its methods are mixed into the class and can later be invoked on the composed class. 19:35
Geth doc: f8eb33e103 | Tinmarino++ | 3 files
Rename: Perl 5 -> Perl (util)
19:40
doc: 9ba24606b0 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | 3 files
Merge pull request #3275 from tinmarino/merge_perl5_3

Rename: Perl 5 -> Perl (util) (3/6)
19:43 mniip left
Geth doc: 3480a762b2 | Tinmarino++ | 3 files
Rename: Perl 5 -> Perl (doc/Type)
19:45
doc: d925c0d554 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | 3 files
Merge pull request #3276 from tinmarino/merge_perl5_4

Rename: Perl 5 -> Perl (doc/Type) (4/6)
doc: 0cc4923ff2 | Tinmarino++ | 6 files
Rename: Perl 5 -> Perl (Language)
19:49
doc: fcdec798af | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | 6 files
Merge pull request #3278 from tinmarino/merge_perl5_6

Rename: Perl 5 -> Perl (Language) (6/6)
19:51 mniip joined 19:53 cpup left
rypervenche What is the difference between \x and 0x? I see that they work differently. 19:54
19:55 cpup joined 20:16 stoned75 joined, stoned75_ joined 20:17 ofperfection joined 20:18 ofperfection left 20:19 foo222 joined 20:22 foo222 left
chloekek \x is an escape sequence for use in string literals. 0x is a prefix for hexadecimal number literals. 20:32
tellable6 2020-03-21T10:13:09Z #raku-dev <tyil> chloekek of course, I'm @tyil@soc.fglt.nl
chloekek p6: say "\x41"; say 0x41 20:33
camelia A
65
20:59 newline21 joined
newline21 hello 20:59
just started reading about raku 21:00
moritz hi newline21 21:02
can we help you with anything?
[Coke]_ .
21:02 [Coke]_ is now known as [Coke]
[Coke] . 21:02
21:04 Kaiepi left 21:05 Kaiepi joined
cpan-raku New module released to CPAN! P5pack (0.0.10) by 03ELIZABETH 21:10
21:13 molaf left 21:14 aborazmeh joined, aborazmeh left, aborazmeh joined
rypervenche chloekek: Ahhh, thanks. 21:14
I'm having trouble getting my grammar to match a line of json by using \N+. It seems to stop midway though the json. Any ideas why this is? gist.github.com/rypervenche/37c4c9...f96cacb5ea 21:15
21:19 Kaiepi left 21:20 sena_kun joined 21:21 Altai-man_ left, Kaiepi joined
moritz rypervenche: it seems to have trouble matching the <.eo>, not just the \N+ 21:32
... and I know why 21:34
it's because line is a rule
and thus there's an implicit `<.ws>` wherever there is whitespace in rule
and <.ws> eats the newlines as well 21:35
rypervenche moritz: Would that do it? I did it as a rule on purpose, because I'm expecting a whitespace in between each of those three items in <line>
oh
21:35 newline21 left
moritz when you use rule / <.ws>, you have to redefine ws to only match the whitespace that's not significant in your input file format 21:35
and it seems that linebreaks are significant
rypervenche Didn't know <.ws> matches newlines. I feel like I have seen that before. Thanks. I'll either redefine <ws> or use a token. Thank hyou. 21:36
moritz so try token ws { <!ww> \h* }
yep, seems to work
I've added a more detailed comment in the gist
tbrowder lizmat: you saved me again thanks to P5shift! it helps with those variable but invisible args in @_ for sure.
rypervenche That did it :)
moritz there's an even simpler solution 21:38
use the lines() function to break up the input into lines
and feed each line separately into your grammar
and simplify the grammar to only match a single line
(unless the file format gets more complicated)
I guess this would be the right time to plug my book on grammars, but I'm too tired 21:41
21:41 natrys left
Geth ecosystem: 6b8e619676 | (Roman Baumer)++ (committed using GitHub Web editor) | server/updatelist.pl
Improve error handling in updatelist.pl

  - Verifiy if $name is empty
  - Enforce $@->stringify if autodie::exception has added a blessed reference to make sure it can be converted to JSON later on
21:46
lizmat www.amazon.com/Parsing-Perl-Regexe...1484232275
lizmat plugs again: www.amazon.com/Parsing-Perl-Regexe...1484232275
21:47 wamba left 21:49 Xliff joined
rba jnthn: ecosystem-api.p6c.org/errors.json is created and updated again... 21:50
21:52 aborazmeh left 22:08 upupbb-user2 joined 22:10 Kaiepi left 22:11 Kaiepi joined 22:12 Kaiepi left 22:13 upupbb-user2 left 22:14 upupbb-user2 joined, Kaiepi joined 22:22 aborazmeh joined, aborazmeh left, aborazmeh joined 22:28 rindolf left
stoned75 I'm confused by what I'm seeing with Supply.comb(..., :match!): it seems to always behave as if match => False 22:30
22:44 mowcat joined
Xliff Where is the "is built" trait documented? 22:47
MasterDuke Xliff: it might not be yet, it's pretty new 22:51
Xliff MasterDuke: Can you tell me how it works? 22:53
MasterDuke heh. i couldn't. but lizmat can
Xliff I will have to search the source for this. 22:54
lizmat .comb(Regex, :match) will give you the underlying Match objects, instead of stringifying the result 22:55
m: dd "abcde".comb(/./, :match)
camelia (Match.new(:orig("abcde"), :from(0), :pos(1)), Match.new(:orig("abcde"), :from(1), :pos(2)), Match.new(:orig("abcde"), :from(2), :pos(3)), Match.new(:orig("abcde"), :from(3), :pos(4)), Match.new(:orig("abcde"), :from(4), :pos(5))).Seq
lizmat m: dd "abcde".comb(/./)
camelia ("a", "b", "c", "d", "e").Seq
22:55 lucasb left
MasterDuke Xliff: looks like da9929c89c61300cc152ccc6335ac91e985c36f6 might have it 22:55
linkable6 (2020-01-14) github.com/rakudo/rakudo/commit/da9929c89c Merge pull request #3423 from rakudo/is-built
Xliff lizmat: Can you explain "is built" please? 23:01
tellable6 2020-03-22T23:00:23Z #raku-dev <lizmat> Xliff URL of your changes? I guess I missed that? :-(
lizmat it's a attribute trait that allows you to speciify: a. whether you can specify it as a parameter in .new (even if it is a private attribute) 23:02
and b. whether any (implicit) value should be bound rather than assigned on creation of the object 23:03
23:10 caterfxo left 23:14 chloekek left 23:15 aborazmeh left 23:19 Altai-man_ joined 23:22 sena_kun left, pecastro left
uzl[m] m: say "Hello, World".contains('Hello') 23:25
camelia True
uzl[m] m: say "Hello, World".contains('Hello', 0)
camelia True
uzl[m] m: say <Hello, World>.contains('Hello')
camelia Calling '.contains' on a List, did you mean 'needle (elem) list'?
True
in block <unit> at <tmp> line 1
uzl[m] m: say <Hello, World>.contains('Hello', 0)
camelia True
rypervenche moritz: Ahhh, I think I'm going to have to do that. I can't parse the whole file since it uses up all my RAM and crashes my little laptop :P .lines() it is. 23:26
uzl[m] m: say <Hello, World>.contains('Hello')
camelia Calling '.contains' on a List, did you mean 'needle (elem) list'?
True
in block <unit> at <tmp> line 1
uzl[m] ^ Is this some sort of bug? A listy invocant is coerced only when the optional `$pos` parameter is supplied. 23:27
jnthn It's coerced in either case, it only warns on the one path.
And yes, probably it should warn on both
AlexDaniel I'm surprised to see a warning 23:29
is it new? :)
uzl[m] Oh, that's right. I focused only on the warning and didn't notice the return value.
AlexDaniel 6c: say <Hello, World>.contains('Hello')
committable6 AlexDaniel, gist.github.com/005ce3713172fc7309...64160689ae 23:30
AlexDaniel wow
that's amazing. Finally
bisect: say <Hello, World>.contains('Hello')
bisectable6 AlexDaniel, Bisecting by output (old=2015.12 new=439b860) because on both starting points the exit code is 0
AlexDaniel, bisect log: gist.github.com/6a07a117e4280c91be...26f7fa93be 23:31
AlexDaniel, (2020-01-23) github.com/rakudo/rakudo/commit/c9...2a4885d149
uzl[m] m: class A { method Str { 'class A' }}; say "This is class A".contains(A.new); 23:32
camelia Cannot resolve caller contains(Str:D: A:D); none of these signatures match:
(List:D: Cool:D \needle, *%_)
(Cool:D: Cool:D $needle, :i(:$ignorecase)!, :m(:$ignoremark), *%_ --> Bool)
(Cool:D: Cool:D $needle, :m(:$ignoremark)!, *%_ -->…
uzl[m] class A { method Str { 'class A' }}; say "This is class A".contains(A.new.Str);
evalable6 True
AlexDaniel lizmat: ♥ 23:33
uzl[m] BTW, the docs mention that `contains` coerces (to Str) both the invocant and the first argument but that doesn't seems to be the case. 23:34
I might be misunderstanding something though ;-) 23:35
link: docs.raku.org/type/Str#method_contains
23:40 aborazmeh joined, aborazmeh left, aborazmeh joined 23:51 caterfxo joined 23:57 aborazmeh left