🦋 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:00 xelxebar joined 00:04 pecastro left 00:35 ensamvarg joined 00:51 Altai-man_ joined 00:53 sena_kun left 00:55 markoong left 01:12 aborazmeh joined, aborazmeh left, aborazmeh joined 01:21 kst` left
jdv79 Segmentation fault (core dumped) :( 01:28
that'll take a while to golf... 01:29
oh - double free or corruption (!prev)\nborted (core dumped) 01:30
more run
*fun
01:31 lichtkind left 02:08 molaf left 02:20 molaf joined 02:22 ZzZombo left 02:27 vike left 02:31 vike joined 02:38 epony left 02:40 epony joined 02:45 Kaiepi left 02:46 Kaiepi joined 02:52 sena_kun joined 02:54 Altai-man_ left 03:06 vike left 03:07 leont left 03:17 camelCaser joined 03:18 ccamel left 03:19 vike joined
xinming How do we apply roles which is contained in var? 03:21
Something like, my $role = ::("RoleName"); class T does $role { }; 03:22
m: role T { method t { "t".say; } }; class C { method t { "c".say } }; C.^add_role(T); C.^compose; C.new.t; 03:25
camelia c
xinming This doesn't return t
timotimo m: role T { method t { "t".say; } }; my \C = Metamodel::ClassHOW.new_type("C"); C.^add_method(my method t { "c".say }); C.^add_role(T); C.^compose; C.new.t 04:03
camelia Too many positionals passed; expected 1 argument but got 2
in block <unit> at <tmp> line 1
timotimo m: role T { method t { "t".say; } }; my \C = Metamodel::ClassHOW.new_type(); C.^add_method(my method t { "c".say }); C.^add_role(T); C.^compose; C.new.t
camelia Too few positionals passed; expected 4 arguments but got 3
in block <unit> at <tmp> line 1
timotimo m: role T { method t { "t".say; } }; my \C = Metamodel::ClassHOW.new_type("C"); C.^add_method("t", my method t { "c".say }); C.^add_role(T); C.^compose; C.new.t
camelia Too many positionals passed; expected 1 argument but got 2
in block <unit> at <tmp> line 1
timotimo m: role T { method t { "t".say; } }; my \C = Metamodel::ClassHOW.new_type(); C.^add_method("t", my method t { "c".say }); C.^add_role(T); C.^compose; C.new.t
camelia c
jdv79 timotimo: sup. did you go to gpw or spw or whatever just happened? 04:04
timotimo m: role T { method t { "t".say; } }; my \C = Metamodel::ClassHOW.new_type(); C.^add_method("t", my method t { "c".say }); C.^add_role(T); C.^compose; C.new.t; C.^methods.say
camelia c
(t)
timotimo no, i didn't attend
i got sick on my own accord, lol
jdv79 corona?
timotimo nah, regular flu, or maybe even just a cold 04:05
jdv79 super 04:06
04:07 molaf left
timotimo how's you, apart from the crashing you wrote about a couple hours back? 04:08
04:11 aborazmeh left 04:19 vike left 04:25 vike joined 04:30 camelCaser left 04:32 camelCaser joined 04:51 Altai-man_ joined 04:54 sena_kun left 05:16 wamba joined 05:20 Doc_Holliwood joined 06:13 ufobat left 06:26 sno left 06:52 sena_kun joined 06:53 Altai-man_ left 07:01 sno joined 07:05 wamba left 07:11 camelCaser left 07:17 camelCaser joined 07:28 aluaces left 07:29 rindolf joined, Doc_Holliwood left 07:33 agentzh left 07:35 agentzh joined, agentzh left, agentzh joined 07:41 finanalyst_mobil joined 07:45 finanalyst left 07:51 camelCaser left 07:52 camelCaser joined 08:03 finanalyst_mobil left 08:05 Kaiepi left 08:06 Kaiepi joined 08:07 Kaiepi left 08:10 Kaiepi joined 08:19 aluaces joined 08:36 abraxxa joined 08:41 Kaiepi left 08:42 Kaiepi joined 08:45 Kaiepi left 08:48 abraxxa left 08:50 Kaiepi joined 08:51 abraxxa joined, Altai-man_ joined 08:52 ensamvarg left 08:54 sena_kun left 09:38 wamba joined 09:46 pecastro joined
abraxxa what's the preferred way to handle the warning 'Use of uninitialized value element of type Any in string context.' when you know that it's ok for a var to be undefined? 09:54
09:57 kktt007 joined 09:59 wamba left
jnthn abraxxa: If it's just one element I tend to just `// ''` it; if it's an expression where there could be various I use `quietly` 10:01
10:03 wamba joined 10:06 finanalyst joined 10:07 finanalyst left 10:08 finanalyst joined
abraxxa jnthn: thanks 10:37
didn't know quietly and the warning message doesn't show up in the docs, all should be added
jnthn Please make docs issues if you have a moment to do so 10:42
10:50 markoong joined 10:52 sena_kun joined 10:53 ensamvarg joined 10:54 Altai-man_ left 10:59 finanalyst_mobil joined 11:02 molaf joined, molaf left 11:03 finanalyst left 11:12 finanalyst_mobil left 11:14 finanalyst joined, lichtkind joined 11:22 samebchase-2 is now known as samebchase- 11:29 mowcat joined 11:46 wamba left 11:47 skyheights joined 11:48 skyheights left 11:51 wamba joined
Altreus m: use JSON::Fast; my @arr = 1,2,3; (to-json @arr).say 11:56
camelia 5===SORRY!5=== Error while compiling <tmp>
Could not find JSON::Fast in:
inst#/home/camelia/.raku
inst#/home/camelia/rakudo-m-inst-2/share/perl6/site
inst#/home/camelia/rakudo-m-inst-2/share/perl6/vendor
inst#/home/cameli…
Altreus m: use JSON::FastTiny; my @arr = 1,2,3; (to-json @arr).say
camelia 5===SORRY!5=== Error while compiling <tmp>
Could not find JSON::FastTiny in:
inst#/home/camelia/.raku
inst#/home/camelia/rakudo-m-inst-2/share/perl6/site
inst#/home/camelia/rakudo-m-inst-2/share/perl6/vendor
inst#/home/ca…
Altreus oops
m: use JSON::Tiny; my @arr = 1,2,3; (to-json @arr).say
camelia 5===SORRY!5=== Error while compiling <tmp>
Could not find JSON::Tiny in:
inst#/home/camelia/.raku
inst#/home/camelia/rakudo-m-inst-2/share/perl6/site
inst#/home/camelia/rakudo-m-inst-2/share/perl6/vendor
inst#/home/cameli…
Altreus ok
11:57 aborazmeh joined, aborazmeh left, aborazmeh joined 11:58 mowcat left
Altreus The asymmetry of a json round-trip is displeasing to me: gist.github.com/Altreus/6aa5a48ea3...a6469bee87 11:58
11:58 chloekek joined
Altreus But my question really is, how do I get this round-trip to actually be round? 11:59
11:59 leont joined
lizmat Altreus: the result of from-json is an item, even if it is an array 12:07
if you know for sure that you'll get a top level array back from your JSON, you could bind
my @arr2 := from-json $json; 12:08
this would also be more performant :-)
12:09 markong joined
lizmat m: my $a = [1,2,3]; my @b = $a; dd @b # what happens 12:09
camelia Array @b = [[1, 2, 3],]
lizmat m: my $a = [1,2,3]; my @b := $a; dd @b # fix
camelia Array element = [1, 2, 3]
12:13 markoong left 12:24 pochi_ left
tbrowder hi, all 12:32
12:33 margeas joined 12:34 markong left
tbrowder i've been looking at numerics and discovering cool things using allomorphs. in the process i wonder if there is any interest in adding a number function to split a fractional number into its integer and fractions parts. 12:34
in some languages that funcion is called "modf" although i think another name would be better. we already have "truncate" for the integral. 12:35
use "frac*" for the fraction part (where 12:36
m: my $a=2.3; my $b = <<$a >>: 12:37
camelia 5===SORRY!5=== Error while compiling <tmp>
Confused
at <tmp>:1
------> 3my $a=2.3; my $b = <<$a >>:7⏏5<EOL>
expecting any of:
colon pair
tbrowder m: my $a = 2.3;my $b=<<$a>>;say $b.split('.'); 12:38
camelia (2 3)
chloekek m: my $a = 2.3e100;my $b=<<$a>>;say $b.split('.'); 12:40
camelia (2 3e+100)
tbrowder my $a=2.3;my $b=<<$a>>;my $c=<<$b>>;say $c.split('.');
evalable6 (2 3) 12:41
tbrowder chloekek: o/ 12:42
chloekek p6: my $a = 2.3; say $a.Int, ($a - $a.Int)
camelia 20.3
tbrowder strange!
chloekek Too difficult.
p6: my $a = 2.3; say $a.Int; say ($a - $a.Int) 12:43
camelia 2
0.3
12:43 pochi joined
chloekek p6: my $a = -2.3; say $a.Int; say ($a - $a.Int) 12:43
camelia -2
-0.3
chloekek p6: my $a = -2.3; say $a.Int; say ($a - $a.Int).abs
camelia -2
0.3
chloekek p6: my $a = -2.3e100; say $a.Int; say ($a - $a.Int).abs
camelia -22999999999999999005898270966467765433606524920610912546812266046322364299723189622637981323824726016
0
tbrowder actually i would like to get the fractional part without the radic point so it would be an integer, hence the use of the allomorph to split on the period 12:47
*radix
m: <2.3>.split('.').unshift; 12:49
camelia Cannot resolve caller unshift(Seq:D: ); none of these signatures match:
(Any:U \SELF: |values)
in block <unit> at <tmp> line 1
tbrowder pop? 12:50
m: <2.3>.split('.').pop
camelia No such method 'pop' for invocant of type 'Seq'
in block <unit> at <tmp> line 1
12:51 Altai-man_ joined
tbrowder m: <2.3>.split('.') 12:52
camelia ( no output )
tbrowder m: <2.3>.split('.'); 12:53
camelia ( no output )
tbrowder m: say <2.3>.split('.')
camelia (2 3)
12:53 sena_kun left
chloekek What if the number is a rational with an infinite number of decimal digits? 12:54
lizmat 1/3 comes to mind :-)
tbrowder not sure, but i think the numerics page shows how to deal with that 12:55
m: say <1/3 >.split('.') 12:56
camelia (1/3)
12:57 wamba left
tbrowder m: say <4/3 >.split('.') 12:57
camelia (4/3)
tbrowder m: say <4/3>.split('.') 12:58
camelia (1 333333)
tbrowder \o/
13:01 wamba joined
tbrowder m: sub frac($n) {my $a=<<$n>>.split('.'); $a[1]}; say frac(1,4); 13:03
camelia 5===SORRY!5===
Cannot use variable $a in declaration to initialize itself
at <tmp>:1
------> 3sub frac($n) {my $a=<<$n>>.split('.'); $7⏏5a[1]}; say frac(1,4);
expecting any of:
term
Other potential difficulties:
tbrowder stupid keyboard...
Altreus lizmat: Alas! In fact I want to pass it to a constructor (I updated the gist) gist.github.com/Altreus/6aa5a48ea3...a6469bee87 13:04
Can I do something to $item<arr> to make it behave?
13:05 kktt007 left
lizmat has $.arr ? 13:06
m: class A { has $.a }; my $a = A.new( a => [1,2,3] ); dd $a.a 13:07
camelia Array element = [1, 2, 3]
Altreus I feel like it's more correct to have the correct object structure and make the passed-in data work right
lizmat m: class A { has @.a }; my $a = A.new( a => [1,2,3] ); dd $a.a
camelia Array @!a = [1, 2, 3]
Altreus Than to amend the object structure just because the current source of data happens to be JSON
lizmat m: class A { has @.a }; my $a = A.new( a => $[1,2,3] ); dd $a.a
camelia Array @!a = [[1, 2, 3],]
Altreus oh is it just too many containers?
no 13:08
:)
lizmat m: my @a = $[1,2,3]; dd @a
camelia Array @a = [[1, 2, 3],]
lizmat that's the issue... JSON returns everything as an item
tbrowder m: sub frac($n) {my $a=<<$n>>.split('.'); $a[1]}; say frac(2.3);
camelia 5===SORRY!5===
Cannot use variable $a in declaration to initialize itself
at <tmp>:1
------> 3sub frac($n) {my $a=<<$n>>.split('.'); $7⏏5a[1]}; say frac(2.3);
expecting any of:
term
Other potential difficulties:
tbrowder m: sub frac($n) {my $a=<<$n>>; my @b = $a.split('.'); $b[1]}; say frac(2.3); 13:09
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$b' is not declared. Did you mean '@b'?
at <tmp>:1
------> 3) {my $a=<<$n>>; my @b = $a.split('.'); 7⏏5$b[1]}; say frac(2.3);
Altreus I cannot figure out how to replace it with not-an-item. This is at the edges of my raku knowledge :)
tbrowder m: sub frac($n) {my $a=<<$n>>; my @b = $a.split('.'); @b[1]}; say frac(2.3);
camelia 3
tbrowder \o/ 13:10
that's the routine i would like to see added to Raku (improved of course) 13:11
13:11 lucasb joined
Altreus in fact I can't figure out how to *create* a hash I can use as a constructor 13:11
even if I don't use JSON
lizmat you can easily 13:12
m: class A { has @.a; method TWEAK() { @!a := @!a[0] } }; my %h = a => [1,2,3]; dd A.new(|%h) 13:14
camelia A.new(a => [1, 2, 3])
13:14 Doc_Holliwood joined
Altreus Which will break if someone does A.new(a => [1,2,3]) :/ 13:15
Whereas presumably with $.arr it will always work as expected...
lizmat m: class A { has @.a; method BUILD(:@!a) { } }; my %h = a => [1,2,3]; dd A.new(|%h)
camelia A.new(a => [1, 2, 3])
lizmat this will bind 13:16
xinming timotimo: So, We can't apply role to already composed class. Is there other way to create a class is open? Something like class C is open { ... }; and user needs to do C.^compose before init the object.
Altreus Does it require me to list every property or will the rest be handled by default behaviour?
lizmat m: class A { has @.a; method TWEAK(:@!a) { } }; my %h = a => [1,2,3]; dd A.new(|%h) 13:17
camelia A.new(a => [1, 2, 3])
lizmat better to use TWEAK, it will take care of all of the other attributes for you
Altreus splendid! :D
I will try it!
I am a fool and have been using IDs where I should be using objects 13:28
13:39 ZzZombo joined 13:42 xelxebar left 13:45 xelxebar joined 14:07 regreg joined 14:15 aborazmeh left 14:24 rindolf left 14:36 lichtkind left 14:41 Actualeyes joined 14:42 wamba left
kawaii Hi! I have a subroutine containing a react whenever loop, is there an easy way (using Promises or not) to make that loop last for a set period of time? 14:51
14:52 sena_kun joined
jnthn `whenever Promise.in($the-amount-of-time) { done }` ? 14:52
If you want something inside of the react, anyway
Well, and it's a react so that's all you could want, I guess :) 14:53
14:54 Altai-man_ left
kawaii doesn't `.in()` define the amount of time to wait before starting the promise (and in this case, the loop), not define how long it lasts for jnthn? 14:54
Altreus How long before *keeping* the promise 14:55
14:56 finanalyst left
jnthn kawaii: Promise.in returns a Promise that will be kept after that amount of time; the whenever block runs when the Promise is kept. 14:56
14:56 wamba joined, finanalyst joined
jnthn And thus the `done` (which terminates the `react`) will run after that amount of time, which I think is what you want. 14:56
lizmat kawaii: if you want to have the promise kept at a certain time, you can use Promise.at() 14:57
15:00 rindolf joined 15:13 reach_satori left, reach_satori joined 15:20 domidumont joined
kawaii jnthn: can I substitute that `done` with a `return`? 15:28
if I need to pass a value back to whatever called this routine 15:29
jnthn No 15:30
You'll need to assign it to some variable and then return that
(Reason: the `whenever` could be running on any thread, and `return` looks for the handler lexically to decide which thing to return from, but then needs it to be in dynamic scope also, which it won't be.) 15:31
Altreus complex reason he didn't understand
I'm not 100% sure I did
jnthn It *may* be possible to do a bunch of magic to make it work, but it's certainly not trivial. :) 15:32
So for now the answer is that no, you can't do that
(Folks ask often enough that I sometimes think we should make it Just Work.)
chloekek Allow an argument to done and return that from the react statement. 15:33
Altreus if we have the «start react» paradigm going on here, can we cause the 60-second timeout to break that promise instead of keeping it? Is that just a die?
jnthn Yes 15:34
Altreus right thank :) 15:52
15:58 wamba left 16:05 wamba joined
rypervenche So I thought about rewriting one of my scripts that uses Text::CSV to convert an array of hashes into a CSV file, which works very easily. Does anyone know how to create a CSV from an array of objects? I haven't been able to figure it out from the documentation. 16:06
Doc_Holliwood m: (1,2,3,0,4,5,6,7,8).reduce( -> $a, $b { $a.print; $a + 1 == $b ?? $b !! 0 }).first( * == 0 ) 16:10
camelia 12300000
Doc_Holliwood not lazy
can i have a lazy reduce? 16:11
m: (1,2,3,0,4,5,6,7,8).reduce( -> $a, $b { $a.print; $a + 1 == $b ?? $b !! last }).first( * == 0 )
camelia 123
Doc_Holliwood oooh
chloekek m: (1,2,3,0,4,5,6,7,8).reduce( -> $a, $b { $a.print; $a + 1 == $b ?? $b !! last })
camelia 123
Doc_Holliwood ok 16:12
16:15 wamba left, wamba joined
Geth doc: sztanyi++ created pull request #3256:
correct output in comment
16:16
Doc_Holliwood what's the opposite of ===? 16:17
chloekek p6: say 1 !=== 1 16:18
camelia False
leont You can prepend a ! before any operator returning a Bool to negate it :-) 16:19
chloekek You can put ! in front of most infix operator, e.g. ne is the same as !eq.
Doc_Holliwood yeah, that much i know ;) 16:20
m: my sub consecutive( @n ) { !( @n.reduce({ $^a + 1 == $^b ?? $^b !! return }) === Nil ) }; say consecutive(1,2,3);
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling consecutive(Int, Int, Int) will never work with declared signature (@n)
at <tmp>:1
------> 3^b ?? $^b !! return }) === Nil ) }; say 7⏏5consecutive(1,2,3);
Doc_Holliwood m: my sub consecutive( @n ) { !( @n.reduce({ $^a + 1 == $^b ?? $^b !! return }) === Nil ) }; say consecutive( (1,2,3) );
camelia True
chloekek p6: .say for (0, 1) X!&& (0, 1)
Doc_Holliwood m: my sub consecutive( @n ) { !( @n.reduce({ $^a + 1 == $^b ?? $^b !! return }) === Nil ) }; say consecutive( (1,2,3,5) );
camelia True
True
True
False
Nil
Doc_Holliwood m: my sub consecutive( @n ) { !( @n.reduce({ $^a + 1 == $^b ?? $^b !! return }) === Nil ) }; say consecutive( (1,2,3,4) ); 16:21
camelia True
Doc_Holliwood m: my sub consecutive( @n ) { !( @n.reduce({ $^a + 1 == $^b ?? $^b !! return }) === Nil ) }; say consecutive( (1,2,0,3,4) );
camelia Nil
Doc_Holliwood huh? why not False?
chloekek return returns from the sub. 16:22
Doc_Holliwood True, but why isn't it Any then? 16:23
chloekek p6: sub f { return }; say f
camelia Nil
Doc_Holliwood m: my sub consecutive( @n ) { !( @n.reduce({ $^a + 1 == $^b ?? $^b !! return }); True ) }; say consecutive( (1,2,0,3,4) );
camelia Nil
Doc_Holliwood m: my sub consecutive( @n ) { !( @n.reduce({ $^a + 1 == $^b ?? $^b !! return 999 }); True ) }; say consecutive( (1,2,0,3,4) ); 16:24
camelia 999
Doc_Holliwood m: my sub consecutive( @n ) { !( @n.reduce({ $^a + 1 == $^b ?? $^b !! last }) ?? True !! False ) }; say consecutive( (1,2,0,3,4) ); 16:26
camelia False
Doc_Holliwood m: my sub consecutive( @n ) { @n.reduce({ $^a + 1 == $^b ?? $^b !! last } ?? True !! False ) }; say consecutive( (1,2,0,3,4) );
camelia Cannot resolve caller reduce(List:D: Bool:D); none of these signatures match:
(Any:U: &, *%_ --> Nil)
(Any:D: &with, *%_)
in sub consecutive at <tmp> line 1
in block <unit> at <tmp> line 1
16:27 chloekek left
Doc_Holliwood m: my sub consecutive( @n ) { @n.reduce({ $^a + 1 == $^b ?? $^b !! last }) ?? True !! False }; say consecutive( (1,2,0,3,4) ); 16:27
camelia True
Geth doc: uzluisf++ created pull request #3257:
Add small section about delegation
16:28
16:29 molaf joined 16:30 cpan-raku left, cpan-raku joined, cpan-raku left, cpan-raku joined
sena_kun bisectable6, my %intervals{Instant}; my $first-instant = now; %intervals{ $first-instant } = 1; sleep 1; my $second-instant = now; %intervals{ $second-instant } = 2; say ($first-instant, $second-instant) ~~ %intervals.keys.sort; 16:30
bisectable6 sena_kun, On both starting points (old=2015.12 new=3583254) the exit code is 0 and the output is identical as well
sena_kun, Output on both points: «True␤»
Geth doc: 321f1fd6bc | sztanyi++ (committed using GitHub Web editor) | doc/Language/hashmap.pod6
Update hashmap.pod6

say ($first-instant, $second-instant) ~~ %intervals.keys.sort; # OUTPUT: «False␤» output should be True
16:31
doc: 2c24bc9663 | Altai-man++ (committed using GitHub Web editor) | doc/Language/hashmap.pod6
Merge pull request #3256 from sztanyi/patch-1

correct output in comment
linkable6 Link: docs.raku.org/language/hashmap
16:44 mowcat joined 16:51 renormalist left, renormalist joined, Altai-man_ joined, abraxxa left 16:52 abraxxa joined, sno left 16:54 sena_kun left 17:12 aborazmeh joined, aborazmeh left, aborazmeh joined 17:27 patrickb joined 17:50 wamba left 17:51 finsternis left, daxim left 17:54 finsternis joined 17:57 daxim joined 17:59 japhb left 18:08 aborazmeh left 18:10 pecastro left 18:14 wamba joined 18:21 sauvin left 18:35 sno joined 18:43 sno left 18:44 sno joined 18:52 sena_kun joined, sno left 18:53 Altai-man_ left 18:56 abraxxa left 18:57 abraxxa joined 18:58 japhb joined 19:07 benlittle left
Geth doc: db7481c0e8 | (Luis F. Uceta)++ | doc/Language/objects.pod6
Add small section about delegation

refs: github.com/Raku/doc/issues/3255
19:07
doc: f8da8ad549 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Language/objects.pod6
Merge pull request #3257 from uzluisf/master

Add small section about delegation Closes #3255
linkable6 Link: docs.raku.org/language/objects
linkable6 DOC#3255 [closed]: github.com/Raku/doc/issues/3255 Small section about the handles trait
19:48 aborazmeh joined, aborazmeh left, aborazmeh joined 19:49 pecastro joined 19:55 chloekek joined 19:58 lichtkind joined, wildtrees joined
rypervenche I'm trying to figure out how to add "race" to one of my programs. I believe at the ".join" it goes back to a single file and is no longer multi-threaded. How can I get it do to the grep on each line of each file and then at the very end join them all together? gist.github.com/rypervenche/adc461...a7e39e5818 20:04
chloekek
.oO(@xs».foo is a guillemap)
20:05
rypervenche I was using that before instead of race, but I'm still having trouble how to keep everything multi-threaded from the middle on. 20:06
20:08 wamba left, wamba joined 20:13 Kaiepi left 20:14 Kaiepi joined 20:18 wamba left 20:21 domidumont left
jnthn rypervenche: Instead of .join.lines, maybe .map(*.lines).flat ? 20:25
Though I ain't sure if .flat is understood well by the parallelizer 20:26
rypervenche Ahhh, flat.
20:33 aborazmeh left 20:36 MasterDuke joined 20:39 stoned75 joined
rypervenche jnthn: Looks to be about the same speed-wise (88sec on mine, 91sec on yours) and all running on one thread. 20:40
20:43 xelxebar left, aborazmeh joined, aborazmeh left, aborazmeh joined
Doc_Holliwood oh hi jnthn 20:45
jnthn rypervenche: How many files do you have?
If < 64, set the degree also (.race(:1dgree) or some such)
oops
not degree, batch
.race(:1batch)
o/ Doc_Holliwood
rypervenche 37 files. I'll try adding :1batch as well 20:46
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2020/03/09/2020-...he-videos/
jnthn isn't thinking entirely clearly today, thanks either to the thraot infection or the things he's taking for the throat infection...
20:46 xelxebar joined
Doc_Holliwood somebody in the mood helping me golfing this down? : pastebin.com/Wyrvfxz3 20:47
lizmat probably the latter... they're known to affect your driving capability
rypervenche jnthn: Ahh, I hope you get better soon. I'll not bother you any further. Hopefully this is enough to get me on the right track. :) 20:49
20:50 ensamvarg left
rypervenche Ahh, there we go. I also needed a .race before my grep. That took it down to 48.9 seconds. 20:51
20:51 Altai-man_ joined
El_Che jnthn: I heard in lizmat+nine's Q&A that you could do your talk. I hope you're btter now. 20:52
better
jnthn El_Che: Thanks; seem to be doing the "it'll get worse before it gets better" bit at the moment. 20:53
El_Che (and Nicholas Clark and Moritz?)
20:53 sno joined 20:54 sena_kun left
El_Che jnthn: that's sucks, but luckily it will pass. /me in your mothers voice: "take care of yourself. Make sure to rest enough!" 20:54
Doc_Holliwood lizmat: who was that charming short british guy who looks like young Montgomery Scott? 20:55
the one who talked about the performance work
El_Che Nicholas Clark
Doc_Holliwood I am completely ignorant of that name 20:56
El_Che A p5p person
Grinnz at this point, p5p could stand for "perl 5 people" :P
lizmat El_Che: I think nwc10 has grown beyond that 20:57
El_Che hehe
lizmat: certainly if he's doing the qa with you :)
I meant, Doc_Holliwood may know them from his perl5 work
s/them/him/ 20:58
lizmat ah, true... Nick has been a pumpkin, so yes...
Doc_Holliwood must have been in my C# period
Doc_Holliwood ducks
lizmat
.oO( you can always C# in hindsight )
20:59
Doc_Holliwood lol
m: sub is-consecutive( @n ) { not @n.rotor(2 => -1).first( -> ($a, $b) { $a + 1 != $b }) }; say is-consecutive( (1,2,3) ); say is-consecutive( (1,0,3) ); 21:08
camelia True
False
Doc_Holliwood this works but i feel like i am doing way too much work 21:09
jnthn m: sub is-consecutive { all @a Z== @a.skip(1) }; say is-consecutive( (1,2,3) ); say is-consecutive( (1,0,3) ); 21:12
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '@a' is not declared
at <tmp>:1
------> 3sub is-consecutive { all 7⏏5@a Z== @a.skip(1) }; say is-consecutive(
jnthn m: sub is-consecutive(@a) { all @a Z== @a.skip(1) }; say is-consecutive( (1,2,3) ); say is-consecutive( (1,0,3) );
camelia all(False, False)
all(False, False)
jnthn oh, duh :) 21:13
m: sub is-consecutive(@a) { all @a.skip(1) Z== @a }; say is-consecutive( (1,2,3) ); say is-consecutive( (1,0,3) );
camelia all(False, False)
all(False, False)
jnthn Ah, and even if I got it right it'd be unreliable I guess. 21:14
m: sub is-consecutive(*@a) { so all @a.map(* + 1) Z== @a.skip(1) }; say is-consecutive 1,2,3; say is-consecutive 1,3,4 # works, but I still wonder if there's an easier way... 21:16
camelia True
False
21:16 Black_Ribbon joined
Doc_Holliwood m: sub infix:<++>($a, $b) { $a + 1 == $b ?? $b !! Inf }; sub is-consecutive( @n ) { ([++] @n) < Inf }; say is-consecutive( (1,2,3) ); say is-consecutive( (1,0,3) ); 21:19
camelia True
False
21:20 foo222 joined
Doc_Holliwood sub infix:<++>($a, $b) { $a + 1 == $b ?? ($b but True) !! (0 but False) }; sub is-consecutive( @n ) { so [++] @n }; say is-consecutive( (1,2,3) ); say is-consecutive( (-3,-2,-1) ); say is-consecutive( (-3,-2,-1, 0) ); say is-consecutive( (1,0,3) ); 21:24
evalable6 True
True
True
False
Doc_Holliwood m: sub infix:<++>($a, $b) { $b but ($a + 1 == $b) }; sub is-consecutive( @n ) { so [++] @n }; 21:26
camelia ( no output )
Doc_Holliwood there we go
doesn't short circuit but meh 21:27
jnthn lizmat++ # weekly 21:28
21:28 foo222 left
jnthn Though I'll maybe not follow the leg-breaking advice :P 21:28
lizmat en.wikipedia.org/wiki/Break_a_leg 21:29
21:30 toddr joined
toddr hey, what do Raku files uploaded to pause look like? 21:30
Doc_Holliwood mixins are really slow
jeez
toddr or: how can I tell if a file uploaded to PAUSE is perl or Raku? 21:31
lizmat toddr: they live in a /Perl6 subdirectory
toddr <3 thanks!
rypervenche When you go to purchase a ticket for the Perl and Raku Conf, it says "Access to all events Monday through Wednesday". Shouldn't that say "Wednesday through Friday"? 21:33
toddr it should. will fix. 21:34
rypervenche Thanks ;)
toddr rypervenche refresh pls. 21:36
21:41 thundergnat joined
thundergnat m: sub is-consecutive (*@a) { my $a = @a[0]; ^@a .map({return False if @a[$_] != $a++}); True }; say .&is-consecutive for (1,2,3), (1,2,4), (2,1,3); 21:41
camelia True
False
False
21:42
thundergnat Doc_Holliwood: ^^^ short circuiting
rypervenche toddr: Looks good. 21:43
toddr thanks for the bug report.
21:46 wamba joined
Doc_Holliwood m: sub is-consecutive( @n ) { not (^@n.end).skip.first( -> $i { @n[ $i ] != @n[ $i - 1 ] + 1 }) }; 21:47
camelia ( no output )
Doc_Holliwood i guess, I'll settle on this
21:53 camelCaser left, camelCaser joined 22:04 aborazmeh left 22:05 wildtrees left 22:07 wildtrees joined 22:19 stoned75 left
Geth problem-solving/master: 4 commits pushed by (JJ Merelo)++, (Aleks-Daniel Jakimenko-Aleksejev)++ 22:29
problem-solving: 7fd1fa4f44 | (Aleks-Daniel Jakimenko-Aleksejev)++ | README.md
Rakufy the README file

  @tbrowder++, resolves #165.
22:32
22:33 wildtrees left 22:34 wildtrees joined 22:37 chloekek left 22:52 sena_kun joined 22:54 Altai-man_ left 23:13 toddr left 23:25 wamba left 23:32 patrickb left 23:39 pecastro left 23:44 rindolf left 23:56 __jrjsmrtn__ joined, _jrjsmrtn left