»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
00:01 vike left 00:05 cpan-p6 left, cpan-p6 joined 00:12 SergiusUA left 00:14 vike joined 00:16 drclaw joined 00:22 vike left 00:25 pecastro left 00:28 cpan-p6 left, irced joined 00:29 cpan-p6 joined
irced sooo like any self-respecting *nixer, I am learning BASH scripting. but, what opinions do you all have of BASH vs perl6? what thoughts do you all have on perl6 replacing BASH and variants? I know, that pesky jvm! but still. 00:31
in the context of treating perl6 as a "glue" language and doing things the unix way. (process piping) 00:32
timotimo i'm not sure what you mean by "that pesky jvm"? 00:33
irced turns red in the face.
irced starts chewing on his foot. 00:34
irced muffles something incomprehensible.
timotimo i mean, perl6 is pretty good for putting stuff together from different processes, and it has a bunch of stuff built-in that can do what many unix tools do easily, as well 00:36
irced mumbles more and finally removes his foot from his mouth.
00:36 zacts left 00:37 zacts joined
irced good points, timotimo, thanks. 00:38
00:41 zacts left
irced well, looking at native call and IO::Handle, I'm beginning to think different-ly 00:47
render things unto BASH that are BASH, and things that are perl6 unto perl6 and who needs BASH anyway :-p 00:48
provided you're a c/unix programmer
00:49 |oLa| left
irced waits for his epiphany to be appreciated. 00:49
irced climbs a tree. 00:50
irced strings a hammock.
00:52 cpan-p6 left, cpan-p6 joined 00:55 w_richard_w joined 00:56 vike joined
timotimo sorry, a bit distracted by the C code in front of me 00:56
at least i remember now what i was doing before i got sidetracked by a bug that wasn't actually there any more 00:59
01:07 cpan-p6 left 01:08 cpan-p6 joined
irced climbs down. 01:08
01:09 rindolf left
irced hablo C. any questions? 01:09
irced looks around for the perl6 police.
01:17 zachk left 01:19 epony joined 01:22 cpan-p6 left 01:23 cpan-p6 joined
irced that is, what have you got that you might like some input/feedback on? 01:45
01:46 cpan-p6 left
Seance[m] Been tooling around with Comma Community 01:46
Beats the hell out of atom + p6 packages 01:47
(:
01:47 cpan-p6 joined
irced I'm holding out for semicolon 01:48
Semicolon is slated for release next after the CE 01:49
timotimo irced: no worries, i had been installing my modified moar to a different folder from the one i was running, so my changes weren't being hit and it made no sense to me at all 01:53
irced timotimo: stupid computers! 01:55
timotimo no, stupid timo 01:56
01:56 w_richard_w left
timotimo i didn't look at what i was getting from my commandline history 01:56
irced I stand by my statement!
02:06 molaf left 02:09 cpan-p6 left 02:10 cpan-p6 joined
Seance[m] <freenode_irc "I'm holding out for semicolon"> What's got you holding out? 02:15
02:19 molaf joined 02:20 drclaw left 02:23 SCHAPiE left 02:28 cpan-p6 left 02:37 SCHAPiE joined 02:41 zacts joined 02:53 drclaw joined 02:54 vike left 02:58 vike joined 03:03 mowcat joined 03:05 cpan-p6 joined
Xliff m: my @a = ^100; for @a.rotor(5) -> $a { $a.hyper.map( .say ) } 03:18
camelia (Any)
Cannot resolve caller map(Rakudo::Internals::HyperRaceSharedImpl:U: HyperSeq:D, Rakudo::Internals::HyperIteratorBatcher:D, Bool:D, Hash:D); none of these signatures match:
($: Hash \h, *%_)
(\SELF: &block;; :$label, :$item, *%_)
Xliff m: my @a = ^100; for @a.rotor(5) -> $a { $a.hyper( degree => 4 ).map( .say ) } 03:19
camelia (Any)
Cannot resolve caller map(Rakudo::Internals::HyperRaceSharedImpl:U: HyperSeq:D, Rakudo::Internals::HyperIteratorBatcher:D, Bool:D, Hash:D); none of these signatures match:
($: Hash \h, *%_)
(\SELF: &block;; :$label, :$item, *%_)
Xliff m: my @a = ^100; for @a.rotor(5) -> $a { $a.hyper( degree => 4 ).map( *.say ) }
camelia 0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
5…
03:19 cpan-p6 left
Xliff m: my @a = ^100; for @a.rotor(5) -> $a { $a.hyper( degree => 4 ).map({ .say }) } 03:19
camelia 0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
5…
03:19 cpan-p6 joined
Xliff m: constant BATCH = 4; my @a = ^100; for @a.rotor(5) -> $a { $a.hyper( degree => BATCH ).map({ .say }) } 03:21
camelia 0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
5…
03:27 drclaw left
irced Seance[m], I dunno, I was super optimistic about exclamation point but all it and myself spewed were expletives. 03:29
Geth doc: 33238e3ce7 | cfa++ | 4 files
Remove .html from internal doc links.
03:39
03:43 cpan-p6 left, cpan-p6 joined 04:07 cpan-p6 left, cpan-p6 joined 04:11 netrino left 04:13 zacts left 04:27 cpan-p6 left 04:29 zacts joined 04:41 zacts left
Kaiepi i have a binary that has a multi sub MAIN() and a multi sub main(Str $host!, Int $port!, Str $serverid!). why doesn't it include the usage of the binary without any arguments in the help message it shows if you use it wrong? 04:48
s/multi sub main/multi sub MAIN/ 04:49
04:55 Cabanoss- joined 04:57 Cabanossi left 05:04 zacts joined 05:11 cpan-p6 joined 05:14 mowcat left
Xliff Kaiepi: I don't know if USAGE generation is supported for multi MAINS 05:14
s/MAINS/MAINs 05:15
You get what I mean.
Kaiepi oh
Xliff Keyphrase there being "I don't know"
But it's FRY-day. I have no life. And I am sitting here doing what most people do on FRY-day nights. 05:16
Has anyone thought about adding module dependency generation into CURI so precompiling can go faster? 05:18
irced I wish it was a FRY day, sigh, but I can dream. In fact, that's what I'll do. 05:20
irced zzzZZzzzZZzzz
05:21 irced left 05:23 drclaw joined 05:28 [particle]1 joined 05:31 [particle] left 05:35 cpan-p6 left 05:36 cpan-p6 joined 05:44 zacts left
Kaiepi i helped get perl6 to 1k questions on stack overflow stackoverflow.com/questions/550722...-in-perl-6 05:48
just 6 more to go!
05:56 zacts joined
cpan-p6 New module released to CPAN! Random-Choice (0.0.3) by 03TITSUKI 05:57
05:59 cpan-p6 left 06:00 cpan-p6 joined 06:04 Sgeo_ joined
Xliff Kaiepi: Just off of the cuff, you might want to override STORE and just die unless the assigned value is (T, Failure).any 06:05
m: role Maybe[::T] { sub STORE(\v) { self = v unless (T, Failure).any }; sub foo(--> Int) { rand < 0.5 ?? 1 !! fail 'oops' }; my Maybe[Int] $foo = foo; 06:06
camelia 5===SORRY!5=== Error while compiling <tmp>
'self' used where no object is available
at <tmp>:1
------> 3role Maybe[::T] { sub STORE(\v) {7⏏5 self = v unless (T, Failure).any }; sub
expecting any of:
term
Xliff m: role Maybe[::T] { method STORE(\v) { self = v unless (T, Failure).any }; sub foo(--> Int) { rand < 0.5 ?? 1 !! fail 'oops' }; my Maybe[Int] $foo = foo;
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3fail 'oops' }; my Maybe[Int] $foo = foo;7⏏5<EOL>
Xliff m: role Maybe[::T] { method STORE(\v) { self = v unless (T, Failure).any }; sub foo(--> Int) { rand < 0.5 ?? 1 !! fail 'oops' }; my Maybe[Int] $foo = foo();
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3il 'oops' }; my Maybe[Int] $foo = foo();7⏏5<EOL>
06:06 MidCheck joined
Xliff m: role Maybe[::T] { method STORE(\v) { self = v unless (::T, Failure).any }; sub foo(--> Int) { rand < 0.5 ?? 1 !! fail 'oops' }; my Maybe[Int] $foo = foo(); 06:06
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3il 'oops' }; my Maybe[Int] $foo = foo();7⏏5<EOL>
Xliff Something like that. I am missing something, too. 06:07
m: role Maybe[::T] { method STORE(\v) { self = v unless (::T, Failure).any }; }; sub foo(--> Int) { rand < 0.5 ?? 1 !! fail 'oops' }; my Maybe[Int] $foo = foo();
camelia Type check failed in assignment to $foo; expected Maybe[Int] but got Int (1)
in block <unit> at <tmp> line 1
Xliff m: role Maybe[::T] { method STORE(\v) { self = v unless (T, Failure).any }; }; sub foo(--> Int) { rand < 0.5 ?? 1 !! fail 'oops' }; my Maybe[Int] $foo = foo();
camelia Earlier failure:
(HANDLED) oops
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1

Final error:
Type check failed in assignment to $foo; expected Maybe[Int] but got Failure (&CORE::infix:<orelse>...)
in block <unit> at <…
06:07 Sgeo left
Xliff m: role Maybe[::T] { method STORE(\v) { self = v unless v ~~ (T, Failure).any }; }; sub foo(--> Int) { rand < 0.5 ?? 1 !! fail 'oops' }; my Maybe[Int] $foo = foo(); 06:08
camelia Earlier failure:
(HANDLED) oops
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1

Final error:
Type check failed in assignment to $foo; expected Maybe[Int] but got Failure (&CORE::infix:<orelse>...)
in block <unit> at <…
Xliff m: role Maybe[::T] { method STORE(\v) { self = v unless v ~~ (T, Failure).any }; }; sub foo(--> Int) { rand < 0.5 ?? 1 !! fail 'oops' }; my Maybe[Int] $foo = foo();
camelia Earlier failure:
(HANDLED) oops
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1

Final error:
Type check failed in assignment to $foo; expected Maybe[Int] but got Failure (&CORE::infix:<orelse>...)
in block <unit> at <…
Xliff m: role Maybe[::T] { method STORE(\v) { self = v unless v ~~ (T, Failure).any }; }; sub foo(--> Int) { rand < 0.5 ?? 1 !! fail 'oops' }; my Maybe[Int] $foo = foo();
camelia Earlier failure:
(HANDLED) oops
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1

Final error:
Type check failed in assignment to $foo; expected Maybe[Int] but got Failure (&CORE::infix:<orelse>...)
in block <unit> at <…
Xliff m: role Maybe[::T] { method STORE(\v) { self = v unless v ~~ (T, Failure).any }; }; sub foo(--> Int) { 1 }; my Maybe[Int] $foo = foo();
camelia Type check failed in assignment to $foo; expected Maybe[Int] but got Int (1)
in block <unit> at <tmp> line 1
Xliff Hmmm...
Kaiepi m: role Maybe[::T] { method STORE(\v) is raw { state $subset = my subset Maybe of Mu where T | Failure; return-rw Proxy.new: FETCH => -> { $subset }, STORE => -> $ { die }; } }; my Maybe[Int] $foo = 1 06:10
camelia Type check failed in assignment to $foo; expected Maybe[Int] but got Int (1)
in block <unit> at <tmp> line 1
06:11 ayerhart left
Kaiepi oh wait that's not even what STORE does 06:12
cpan-p6 New module released to CPAN! Random-Choice (0.0.4) by 03TITSUKI
Kaiepi m: role Maybe[::T] { method ACCEPTS(::?ROLE:D: Mu \v) { v ~~ T | Failure } }; my Maybe[Int] $foo = 1 06:13
camelia Type check failed in assignment to $foo; expected Maybe[Int] but got Int (1)
in block <unit> at <tmp> line 1
Kaiepi m: role Maybe[::T] { method ACCEPTS(::?ROLE:D: Mu \v) { v ~~ T | Failure } }; 1 ~~ Maybe[Int]
camelia ( no output )
Kaiepi m: role Maybe[::T] { method ACCEPTS(::?ROLE:D: Mu \v) { v ~~ T | Failure } }; say 1 ~~ Maybe[Int]
camelia False
06:15 telex left 06:16 telex joined
Xliff Aand... I think we killed camelia. 06:22
m: 1.say
camelia 1
Xliff Oh. NVM
06:22 cpan-p6 left 06:23 cpan-p6 joined
Xliff ¯\_(ツ)_/¯ 06:24
06:34 reach_satori joined 06:37 cpan-p6 left 06:38 cpan-p6 joined 06:47 daxim left 06:53 daxim joined
Xliff Does .hyper work with Lists? 06:58
07:01 cpan-p6 left, cpan-p6 joined
cpan-p6 New module released to CPAN! Random-Choice (0.0.5) by 03TITSUKI 07:01
Xliff m: my $b = ^6; $b».map( *.say ) 07:03
camelia ( no output )
07:03 drclaw left
Xliff m: my $b = ^6; $b.»map( *.say ) 07:04
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing dot on method call
at <tmp>:1
------> 3my $b = ^6; $b.»7⏏5map( *.say )
expecting any of:
postfix
Xliff m: my $b = ^6; say $b.gist; $b.map( *.say )
camelia ^6
0
1
2
3
4
5
Xliff m: my $b = ^6.list; $b.map( *.say )
camelia Potential difficulties:
Precedence of ^ is looser than method call; please parenthesize
at <tmp>:1
------> 3my $b = ^67⏏5.list; $b.map( *.say )
0
Xliff m: my $b = (^6).list; $b.map( *.say )
camelia 0
1
2
3
4
5
Xliff m: my $b = (^6).list; $b».map( *.say )
camelia ( no output )
Xliff ^^ WTF? 07:05
m: my $b = (^6).list; $b».map({ .say })
camelia ( no output )
Xliff m: my $b = (^6).list; $b.hyper.map({ .say })
camelia 0
1
2
3
4
5
Xliff m: my $b = (^6).list; ($b)».map({ .say }) 07:06
camelia ( no output )
Xliff m: my $b = (^6).list; ($b»).map({ .say })
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed postfix
at <tmp>:1
------> 3my $b = (^6).list; ($b»7⏏5).map({ .say })
expecting any of:
postfix
Xliff m: my $b = (^6).list; $b.gist.say; $b».map({ .say })
camelia (0 1 2 3 4 5)
Xliff m: my $b = (^6).list; $b.gist.say; $b».map({ say "S: $_" })
camelia (0 1 2 3 4 5)
Xliff m: my $b = (^6).list; $b».map({ say "S: $_" }) 07:07
camelia ( no output )
Xliff m: my $b = (^6).list; $b.map({ say "S: $_" })
camelia S: 0
S: 1
S: 2
S: 3
S: 4
S: 5
Xliff m: my $b = (^6).list; $b.Array.map({ say "S: $_" })
camelia S: 0
S: 1
S: 2
S: 3
S: 4
S: 5
Xliff m: my $b = (^6).list; $b.Array».map({ say "S: $_" })
camelia ( no output )
07:25 cpan-p6 left, cpan-p6 joined 07:28 sena_kun joined 07:30 SergiusUA joined 07:32 SergiusUA left 07:33 SergiusUA joined 07:37 zacts left 07:39 SergiusUA left 07:49 cpan-p6 left 07:50 cpan-p6 joined, SergiusUA joined 07:52 jmerelo joined
Xliff m: my @list = ^100; sub dothis(@a) { sleep rand; say @a }; @list.rotor(5).hyper(:1batch).map: &dothis 08:02
camelia (10 11 12 13 14)
(15 16 17 18 19)
(0 1 2 3 4)
(5 6 7 8 9)
(35 36 37 38 39)
(20 21 22 23 24)
(45 46 47 48 49)
(25 26 27 28 29)
(30 31 32 33 34)
(40 41 42 43 44)
(55 56 57 58 59)
(70 71 72 73 74)
(50 51 52 53 54)
(80 81 82 83 8…
Xliff m: my @list = ^100; sub dothis($a) { sleep rand; say $a }; @list.rotor(5).hyper(:1batch).map: &dothis 08:03
camelia (15 16 17 18 19)
(10 11 12 13 14)
(5 6 7 8 9)
(0 1 2 3 4)
(30 31 32 33 34)
(20 21 22 23 24)
(25 26 27 28 29)
(50 51 52 53 54)
(40 41 42 43 44)
(35 36 37 38 39)
(45 46 47 48 49)
(65 66 67 68 69)
(55 56 57 58 59)
(75 76 77 78 7…
08:03 sauvin joined
Xliff m: my @list = ^100; sub dothis($a) { sleep rand; say $a }; @list.rotor(5) -> $b { $b.map: &dothis } 08:04
camelia 5===SORRY!5=== Error while compiling <tmp>
Unexpected block in infix position (missing statement control word before the expression?)
at <tmp>:1
------> 3) { sleep rand; say $a }; @list.rotor(5)7⏏5 -> $b { $b.map: &dothis }
expec…
Xliff m: my @list = ^100; sub dothis($a) { sleep rand; say $a }; for @list.rotor(5) -> $b { $b.map: &dothis }
camelia (timeout)0
Xliff m: my @list = ^20; sub dothis($a) { sleep rand; say $a }; for @list.rotor(5) -> $b { $b.map: &dothis }
camelia 0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
08:05
Xliff m: my @list = ^20; sub dothis($a) { sleep rand; say $a }; for @list.rotor(5) -> $b { $b.hyper(:1batch).map: &dothis }
camelia 3
2
4
0
1
8
5
6
7
9
13
14
12
10
11
15
18
16
19
17
Xliff m: my @list = ^20; sub dothis($a) { sleep rand; say $a }; for @list.rotor(5) -> $b { $b.hyper(:3batch).map: &dothis }
camelia 0
3
4
1
2
8
5
6
9
7
13
14
10
11
12
15
18
19
16
17
Xliff m: my @list = ^20; sub dothis($a) { say $a }; for @list.rotor(5) -> $b { $b.hyper(:3batch).map: &dothis }
camelia 0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
08:14 cpan-p6 left, cpan-p6 joined
Kaiepi m: $*SCHEDULER.cue({ say 1 }, at => -Inf) 08:15
camelia This type cannot unbox to a native integer: P6opaque, Failure
in block <unit> at <tmp> line 1
08:16 MidCheck left 08:17 rindolf joined
Kaiepi m: -Inf - now 08:18
camelia WARNINGS for <tmp>:
Useless use of "-" in expression "-Inf - now" in sink context (line 1)
Kaiepi m: say -Inf - now
camelia -Inf
Kaiepi m: use nqp; (1000 * -Inf).Int
camelia Cannot convert -Inf to Int:
in block <unit> at <tmp> line 1
Kaiepi m: Inf.Int 08:22
camelia Cannot convert Inf to Int:
in block <unit> at <tmp> line 1
hahainternet Inf isn't really a number is it :p
Kaiepi nope
m: use nqp; say nqp::iseq(Inf, nqp::inf) 08:23
camelia ===SORRY!===
No registered operation handler for 'iseq'
jmerelo Just created commaide tag in StackOverflow stackoverflow.com/questions/tagged/commaide
yoleaux 8 Mar 2019 08:38Z <AlexDaniel> jmerelo: cool. But keep in mind that we've been testing the ecosystem since the 2017.04 disaster, after which Zoffix created Toaster
8 Mar 2019 08:49Z <AlexDaniel> jmerelo: Blin is simply a bit more efficient, and it automatically bisects affected modules (so that the release manager doesn't have to do it manually)
Kaiepi m: use nqp; say nqp::iseq_n(Inf, nqp::inf) 08:24
camelia 1
jmerelo Maybe someone with the knowledge (and the time) can fill it up a little bit
.tell AlexDaniel OK, good point. What happened during the 2017.04?
yoleaux jmerelo: I'll pass your message to AlexDaniel.
jmerelo Also, first question using that tag: stackoverflow.com/questions/550753...-comma-ide 08:25
08:25 zacts joined 08:33 sno left 08:36 ravenousmoose joined
Kaiepi ok the fix for setting :at to Inf/-Inf/NaN is pretty simple 08:37
08:37 w17t joined 08:38 cpan-p6 left 08:39 cpan-p6 joined
Kaiepi m: say 1000 * NaN 08:52
camelia NaN
08:53 cpan-p6 left 08:54 cpan-p6 joined 09:07 cpan-p6 left 09:08 cpan-p6 joined
Kaiepi bastille% perl6 -e '$*SCHEDULER.cue({ say 1 }, at => Inf)' 09:09
1
:)
09:22 cpan-p6 left, cpan-p6 joined
jmerelo Kaiepi: what? 09:25
Kaiepi m: $*SCHEDULER.cue({ say 1 }, at => Inf) 09:26
camelia This type cannot unbox to a native integer: P6opaque, Failure
in block <unit> at <tmp> line 1
Kaiepi i wrote a fix for this jmerelo
in js using Infinity/-Infinity/NaN with setTimeout immediately calls the callback so i did the same here 09:28
09:31 ravenousmoose left
jmerelo Kaiepi: nice! 09:32
09:36 cpan-p6 left, cpan-p6 joined 09:58 cpan-p6 left 09:59 cpan-p6 joined 10:07 SergiusUA left 10:09 w17t left
Geth doc: f70f13f69b | (JJ Merelo)++ | doc/Type/IO/Handle.pod6
Provides example for WRITE refs #2653
10:13
synopsebot Link: doc.perl6.org/type/IO::Handle
jmerelo Kaiepi: any luck with the Maybe type?
Kaiepi no 10:14
jmerelo Kaiepi: the problem is that everything is a subclass of Mu unless you use the MOP 10:16
Kaiepi the MOP?
jmerelo Kaiepi: maybe you can create a new class with the features you want through the meta-object-protocol 10:17
Kaiepi: yep, classHOW and all that.
Kaiepi ah
jmerelo Kaiepi: docs.perl6.org/type/Metamodel::ClassHOW
Kaiepi: it's hard, but you have all the building blocks to create a class that behaves just the way you want (and without subclassing Mu) 10:18
10:21 cpan-p6 left 10:22 cpan-p6 joined 10:26 netrino joined 10:27 haukex joined 10:33 w17t joined 10:48 cpan-p6 left, cpan-p6 joined 10:57 drclaw joined 11:12 drclaw left, lizmat joined, cpan-p6 left 11:13 cpan-p6 joined, drclaw joined 11:24 jmerelo left 11:33 drclaw1 joined 11:35 cpan-p6 left, woolfy joined, cpan-p6 joined 11:36 drclaw left, drclaw2 joined 11:39 drclaw1 left 11:46 mowcat joined 11:49 MasterDuke left 11:53 pecastro joined 11:59 cpan-p6 left 12:00 cpan-p6 joined 12:04 lizmat left 12:09 woolfy left 12:22 cpan-p6 left, cpan-p6 joined 12:31 pmurias joined, dhyan_nataraj joined, SergiusUA joined 12:34 drclaw2 left 12:37 cpan-p6 left, cpan-p6 joined 12:52 cpan-p6 left, cpan-p6 joined 12:54 lucasb joined 12:55 ravenousmoose joined 13:11 ravenousmoose left, cpan-p6 left 13:18 ravenousmoose joined
Geth doc: fea4772bca | (Ben Davies)++ | doc/Language/js-nutshell.pod6
Correct statement about typeof/constructor/^name in JS nutshell

typeof has no equivalent in Perl 6. The constructor property has an equivalent, but it's not the ^name meta-attribute, it's the WHAT attribute.
13:18
synopsebot Link: doc.perl6.org/language/js-nutshell
doc: c980c202f5 | (Ben Davies)++ | doc/Language/js-nutshell.pod6
Change Node to Node.js in the title of the JS nutshell

Calling it Node does not follow Node.js' style guide
13:19
AlexDaniel . 13:22
yoleaux 08:24Z <jmerelo> AlexDaniel: OK, good point. What happened during the 2017.04?
13:22 haukex left
AlexDaniel .tell rakudo.party/post/The-Failure-Poin...-a-Release 13:22
yoleaux AlexDaniel: I don't know what you want me to say to rakudo.party/post/The-Failure-Poin...a-Release.
AlexDaniel oops
.tell jmerelo rakudo.party/post/The-Failure-Poin...-a-Release 13:23
yoleaux AlexDaniel: I'll pass your message to jmerelo.
13:27 netrino left
El_Che wasn't zoffix planning on letting the rakudo.party domain expire? 13:55
Kaiepi m: say [Nil, Nil, Nil].map({ 1 }) 14:09
camelia (1 1 1)
Kaiepi is there a better way to generate an array using a function?
wait that was worded badly 14:10
14:10 cpan-p6 joined
timotimo yeah, use the xx operator. it thunks its LHS 14:10
m: say ($++ xx 20)
camelia (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19)
Kaiepi m: my @ranks = [2, 3, 4, 5, 6, 7, 8, 9, 'J', 'Q', 'K', 'A']; say @ranks.pick xx 3 14:11
camelia (3 7 J)
timotimo rather than .pick xx 3 you can also .roll(3)
and also: 14:12
if you actually have a deck of cards, you'll really want to .pick, which will not grab the same element twice
m: my @ranks = <1 2 3 4 4 4 4 4 4>; say @ranks.pick(5); say @ranks.pick(5); say @ranks.pick(5)
camelia (4 4 4 2 4)
(4 4 4 4 4)
(4 2 4 4 1)
timotimo m: my @ranks = <1 2 3 4 5 6>; say @ranks.pick(5); say @ranks.pick(5); say @ranks.pick(5) 14:13
camelia (5 4 3 2 1)
(3 2 4 1 5)
(3 4 5 1 2)
timotimo .pick(*) will give you as many elements as are in the source, .roll(*) will give you an infinite lazy sequence
Kaiepi ah
what about if i want to generate each element in an array with a nondeterministic function? 14:15
sena_kun foo xx 50? 14:16
m: sub foo { rand }; say foo() xx 50;
camelia (0.48982788749651385 0.4173129736778004 0.8122867503349468 0.4006933500550446 0.33840279263919715 0.06235815537018208 0.009366707936189766 0.9424356648221496 0.44825783385146745 0.9564038172628159 0.7097463593071354 0.4829340447387036 0.90074128035879…
Kaiepi oh, i thought it'd call the function once and repeat the output 50 times 14:18
lucasb thunkiness is tricky. I'm not entirely sure it was the best idea to make xx thunked by default :) 14:19
yoleaux 8 Mar 2019 18:11Z <AlexDaniel> lucasb: thank you! :)
lucasb m: say (state $x = 42) xx 3 14:20
camelia ((Any) (Any) (Any))
lucasb ^^ is this right?
timotimo lucasb: ask python programmers about the x operator being used on arrays 14:25
er, the * operator
m: my @inner-array = 0 xx 10; my @outer = @inner-array xx 10; @outer[0][0] = 1; say @outer;
camelia [[1 0 0 0 0 0 0 0 0 0] [1 0 0 0 0 0 0 0 0 0] [1 0 0 0 0 0 0 0 0 0] [1 0 0 0 0 0 0 0 0 0] [1 0 0 0 0 0 0 0 0 0] [1 0 0 0 0 0 0 0 0 0] [1 0 0 0 0 0 0 0 0 0] [1 0 0 0 0 0 0 0 0 0] [1 0 0 0 0 0 0 0 0 0] [1 0 0 0 0 0 0 0 0 0]]
timotimo m: my @outer = [0 xx 10] xx 10; @outer[0][0] = 1; say @outer; 14:26
camelia [[1 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0]]
Kaiepi m: 1 xx Inf
camelia ( no output )
timotimo which do you prefer? :)
Kaiepi m: say 1 xx Inf
camelia (...)
Kaiepi the latter's a bit easier to read imo
14:27 cpan-p6 left
tobs Kaiepi: the outputs are different 14:28
lucasb sure, the behavior is convenient when you really needs it :)
Kaiepi oh 14:29
didn't notice
timotimo the first one is what you get from python's * operator 14:30
Kaiepi right, the former has 10 references to @inner-array, while the latter has 10 separate arrays
timotimo yup 14:31
tobs btw, was your grant proposal about sockets accepted, Kaiepi?
Kaiepi yep!
timotimo i believe it was
lucasb but I think thunkiness is a "big deal", so it could be more prominently that you are using it. "A xx B" looks just like a regular operator, but it's not
Kaiepi just waiting to hear from a mentor
timotimo m: sub foobar(@bloop = []) { @bloop.push(1); say @bloop; }; foobar(); foobar(); foobar();
camelia [1]
[1]
[1]
tobs Nice, I'm looking forward especially to UNIX sockets! (Heard about it some time ago, and then forgot about it.)
timotimo m: my $bloop = []; sub foobar($ibloop = $bloop) { $ibloop.push(1); say $ibloop; }; foobar(); foobar(); foobar();
camelia [1]
[1 1]
[1 1 1]
Kaiepi that'll be what i work on a couple months from now if all goes to schedule 14:32
timotimo ^- the second one is how python does what the first code does in perl6
similar issue
Kaiepi rn i have getsockopt/setsockopt support finished, i'm just waiting on a code review
14:45 Black_Ribbon left 14:53 cpan-p6 joined 14:55 ravenousmoose left 15:02 pmurias left
Kaiepi jesus explaining control flow for the js nutshell page is rough 15:09
i'm at 169 lines and i've only explained if/else, switch, and for loops
15:09 cpan-p6 left 15:10 cpan-p6 joined
lucasb m: sub f($x = my $y = 42) { $y }; say f() 15:20
camelia 42
lucasb lexical $y is really supposed to leak inside the sub?
15:22 MilkmanDan left, MilkmanDan joined
timotimo m: sub f($x = my $y = 42) { $x }; say f(); say $y 15:23
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$y' is not declared
at <tmp>:1
------> 3f($x = my $y = 42) { $x }; say f(); say 7⏏5$y
timotimo it's actually even only inside the sub
15:26 kurahaupo left 15:27 kurahaupo joined 15:28 molaf left 15:33 pmurias joined 15:34 cpan-p6 left, cpan-p6 joined 15:38 andrewshitov joined 15:42 andrewshitov left
Geth doc: 5fdddcc8fd | cfa++ | doc/Type/IO/Handle.pod6
Fix typo.
15:47
synopsebot Link: doc.perl6.org/type/IO::Handle
15:49 cpan-p6 left, cpan-p6 joined
AlexDaniel El_Che: yes, and we should make a backup somewhere 15:50
and in fact maybe set up a perm redirect before it expires 15:51
that needs tuits, time and a volunteer :)
Kaiepi m: my %primes is SetHash; my Int $i = 2; OUTER: loop { next OUTER if $i %% $_ for %primes.keys; %primes{$i}++; last if ++$i >= 20 } 15:55
camelia Cannot resolve caller next(OUTER:U); none of these signatures match:
( --> Nil)
(Label:D \x --> Nil)
in block at <tmp> line 1
in block <unit> at <tmp> line 1
Kaiepi m: my %primes is SetHash; my Int $i = 2; OUTER: loop { for %primes.keys { next OUTER if $i %% $_ }; %primes{$i}++; last if ++$i >= 20 } 15:56
camelia Cannot resolve caller next(OUTER:U); none of these signatures match:
( --> Nil)
(Label:D \x --> Nil)
in block at <tmp> line 1
in block <unit> at <tmp> line 1
Kaiepi is there something i'm doing wrong? 16:00
bisectable6, my %primes is SetHash; my Int $i = 2; OUTER: loop { next OUTER if $i %% $_ for %primes.keys; %primes{$i}++; last OUTER if ++$i >= 20 }
bisectable6 Kaiepi, Bisecting by output (old=2015.12 new=70d61b2) because on both starting points the exit code is 1
sena_kun you mean the approach itself or the absence of `is-prime` method? :)
Kaiepi the approach
bisectable6 Kaiepi, bisect log: gist.github.com/b9a7021c7dc06ad4e1...9e66f92ee3 16:01
Kaiepi, (2016-06-09) github.com/rakudo/rakudo/commit/b6...430078bc7d
Kaiepi i know about is-prime, i'm just using this as an example of using loops with next/last and labels
tobs m: OUTER.perl.say
camelia OUTER
tobs I think it's complaining about the name of your label. OUTER is already a thing. 16:02
Kaiepi m: my %primes is SetHash; my Int $i = 2; OUTSIDE: loop { for %primes.keys { next OUTSIDE if $i %% $_ }; %primes{$i}++; last OUTSIDE if ++$i >= 20 }
camelia (timeout) 16:03
16:03 cpan-p6 left
tobs m: my $x = 10; { my $x = 12; say $x; say $OUTER::x } # as in 16:03
camelia 12
10
16:03 reach_satori left, cpan-p6 joined
Kaiepi m: my %primes is SetHash; .say for %primes.keys 16:03
camelia ( no output )
Kaiepi oh i know why it's timing out 16:04
m: my %primes is SetHash; my Int $i = 1; OUTSIDE: loop { ++$i; for %primes.keys { next OUTSIDE if $i %% $_ }; %primes{$i}++; last OUTSIDE if $i >= 20 }
camelia ( no output )
Kaiepi m: my %primes is SetHash; my Int $i = 1; OUTSIDE: loop { ++$i; for %primes.keys { next OUTSIDE if $i %% $_ }; %primes{$i}++; last OUTSIDE if $i >= 20 }; say %primes
camelia SetHash(11 13 17 19 2 23 3 5 7)
Kaiepi m: my %primes is SetHash; my Int $i = 1; OUTSIDE: loop { ++$i; for %primes.keys { redo OUTSIDE if $i %% $_ }; %primes{$i}++; last OUTSIDE if $i >= 20 }; say %primes 16:05
camelia SetHash(11 13 17 19 2 23 3 5 7)
Kaiepi m: my %primes is SetHash; my Int $i = 1; OUTSIDE: loop { ++$i; last OUTSIDE if $i >= 20; redo OUTSIDE if $i %% $_ for %primes.keys; %primes{$i}++; }; say %primes 16:06
camelia SetHash(11 13 17 19 2 3 5 7)
Kaiepi there we go
tobs m: my %primes is SetHash; while (my $i = 2) < 20 { next if $i %% any(%primes.keys); %primes{$i}++; NEXT $i++ } 16:08
hmmm
camelia (timeout)
tobs all I wanted to say is: a NEXT phaser might also look nice.
ah, I see 16:09
m: my %primes is SetHash; my $i = 2; while $i < 20 { next if $i %% any(%primes.keys); %primes{$i}++; NEXT $i++ }
camelia ( no output )
tobs m: my %primes is SetHash; my $i = 2; while $i < 20 { next if $i %% any(%primes.keys); %primes{$i}++; NEXT $i++ }; say %primes
camelia SetHash(11 13 17 19 2 3 5 7)
Kaiepi i'd use any but i haven't gotten to explaining junctions yet in the docs i'm writing 16:21
16:26 cpan-p6 left 16:27 cpan-p6 joined 16:28 netrino joined, lizmat joined 16:30 reach_satori joined 16:38 woolfy joined 16:50 cpan-p6 left, cpan-p6 joined 16:52 ufobat joined 17:04 cpan-p6 left, cpan-p6 joined 17:08 MilkmanDan left 17:09 dhyan_nataraj left 17:12 MilkmanDan joined 17:20 cpan-p6 left, cpan-p6 joined 17:38 zacts left 17:44 cpan-p6 left, dhyan_nataraj joined, cpan-p6 joined
discord6 <kawaii> Got an error stating Undeclared routine: unpack used at line 47, the docs say all I need is use experimental :pack; (which I already have due to using pack, are the docs wrong? 17:50
17:50 zacts joined
discord6 <kawaii> (yes I already checked if use experimental :unpack; was a thing, it's not 😉 ) 17:51
sena_kun well, it is a routine
which is undeclared, but you need a method.
m: use experimental :pack; say Blob.new(1..10).unpack("C*");
camelia (1 2 3 4 5 6 7 8 9 10)
sena_kun see example from docs.perl6.org/routine/unpack
discord6 <kawaii> I was trying to use it like unpack("VVVa*", $response); 17:52
sena_kun so it is not a `unpack $blob, $pattern`, but `$block.unpack($pattern)`.
discord6 <kawaii> ah, hm
sena_kun try `$response.unpack("VVVa*")`
you can write a wrapper if you want, it'd be just `sub unpack($p, $buf) { $buf.unpack($p) }` 17:53
17:53 zacts left, zacts joined
discord6 <kawaii> ah, that seems to work, new error about strings or something, but progress, thank you! 😃 17:53
sena_kun but if you are porting a thing from P5, I suspect, it's better to use more nativish approach, imho.
discord6 <kawaii> fastapi.metacpan.org/source/CHANDW...et/RCON.pm
<kawaii> sena_kun: this is what I'm porting 17:54
<kawaii> figured it was simple enough to handle as my first module
sena_kun looks like a good choice to me. :)
18:08 cpan-p6 left, cpan-p6 joined
Geth doc: Kaiepi++ created pull request #2654:
Document control flow in the JS nutshell
18:10
cpan-p6 New module released to CPAN! Smack (0.2.0) by 03HANENKAMP 18:13
tobs @kawaii, if you don't want to do it more nativish, try P5pack 18:14
eco: P5pack
(does that bot not exist anymore?) 18:15
18:17 molaf joined
discord6 <kawaii> tobs: I'm happy to refactor bits to be more native, can you point me in the right direction? 😃 18:20
18:22 cpan-p6 left, cpan-p6 joined 18:27 kyzn left
Geth doc: 88232c9940 | (Ben Davies)++ | util/perl-nbsp.p6
Fix up and refactor util/perl-nbsp.p6

Sometimes the script would replace the "6" in "Perl 6" with nothing for whatever reason. That no longer happens. A filename can now be passed to the script so it'll only check that file for any instances of "Perl 6" using regular spaces.
18:42
18:42 cpan-p6 left
18:43 cpan-p6 joined
cpan-p6 New module released to CPAN! Concurrent-Stack (1.1) by 03JNTHN 18:44
18:44 Khisanth left 18:48 MasterDuke joined, MasterDuke left, MasterDuke joined 18:54 MilkmanDan left 18:56 MilkmanDan joined 18:58 Khisanth joined 19:06 zachk joined 19:07 zachk left 19:08 cpan-p6 left, zachk joined, zachk left, zachk joined, cpan-p6 joined 19:09 zacts left
cpan-p6 New module released to CPAN! gtk-v3 (0.8.3) by 03MARTIMM 19:14
19:15 hankache joined 19:18 reach_satori left 19:24 ravenousmoose joined
Geth doc: 828a8411f5 | (Ben Davies)++ | doc/Language/js-nutshell.pod6
Document control flow in the JS nutshell
19:24
synopsebot Link: doc.perl6.org/language/js-nutshell
doc: 564eb6a81d | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Language/js-nutshell.pod6
Merge pull request #2654 from Kaiepi/nodejs

Document control flow in the JS nutshell
19:32 zachk left, dhyan_nataraj left, dhyan_nataraj joined 19:33 cpan-p6 left, cpan-p6 joined 19:48 cpan-p6 left, hcshcshcshcshcs left, cpan-p6 joined 19:52 jmerelo joined
discord6 <kawaii> my ($response-size, $response-id, $packet-type, $response-body) = $response.unpack("VVVa*"); No such method 'unpack' for invocant of type 'Str' I assume this means that one of the values in $response is not a blob and is actually already a string? 20:01
20:02 cpan-p6 left
discord6 <kawaii> I assumed that the socket would be sending me a 'packet' in the form of a blob, and that I could use unpack like this to extract values out into those variables according to the template provided 20:02
timotimo yeah, that'd already be a string
20:02 cpan-p6 joined
timotimo you can use stuff that reads strings from sockets, too 20:02
depends on what methods you are using
discord6 <kawaii> the perl5 code I'm porting does the same thing though :[ my ( $size, $response_id, $response_type, $response_body ) = unpack( "VVVa*", $response ); 20:03
20:03 ferreira left
jmerelo kawaii you did "use experimental :pack", right? 20:04
yoleaux 13:23Z <AlexDaniel> jmerelo: rakudo.party/post/The-Failure-Poin...-a-Release
jmerelo tell AlexDaniel thanks!
discord6 <kawaii> jmerelo: yep! i'm already using pack elsewhere too :]
<kawaii> github.com/shuppet/p6-net-rcon/blo...ON.pm6#L47
jmerelo kawaii perl5 works on strings, not Blobs... It wouldn't make a lot of sense to convert stuff back into a Blob, I guess. 20:06
discord6 <kawaii> from my understanding, the original p5 module packs strings into blobs, before sending them, and unpacks blobs we get back from the socket into strings to populate variables with 20:08
timotimo maybe you can also use .read-int64 (or .read-uint64) and friends, too
we don't have a "read string" equivalent, so you'd .subbuf.decode('utf-8') or whatever
20:09 smash_ left 20:10 Util left 20:11 Util joined 20:12 charsbar left, charsbar joined, jmerelo left
discord6 <kawaii> timotimo: I was missing :bin on my recv call, so the socket was returning me strings all along :] 20:13
timotimo ah, easy :) 20:14
20:14 integral left 20:15 integral joined 20:16 smash joined 20:17 a3r0 left, a3r0 joined 20:25 cpan-p6 left, cpan-p6 joined 20:27 smash left, smash joined 20:40 cpan-p6 left, cpan-p6 joined
AlexDaniel kawaii: btw, recommended reading: rakudo.party/post/The-Failure-Poin...-a-Release 20:42
greppable: Test::Output 20:43
greppable6 AlexDaniel, 52 lines, 14 modules: gist.github.com/bcb89321e1bad458d4...c320a1439a
AlexDaniel greppable: use Test::Output; 20:44
greppable6 AlexDaniel, 27 lines, 12 modules: gist.github.com/b87e9d4dc5eb60e1e8...0479b518e6
discord6 <kawaii> AlexDaniel: thanks! I'll add it to my reading list, going to spend the next week getting comfortable with everything detailed in the rakudo release document you linked too, not sure if I'll be much use for the next release, but hopefully if I can at least help out with the next one it's progress. 20:46
AlexDaniel kawaii: OK, will talk to you next week then! 20:54
20:54 molaf left 20:58 ferreira joined 21:01 Black_Ribbon joined 21:04 cpan-p6 left, cpan-p6 joined 21:05 integral left, integral joined 21:14 Kaiepi left 21:15 Kaiepi joined 21:18 ravenousmoose left 21:25 Kaiepi left 21:26 Kaiepi joined 21:27 cpan-p6 left, cpan-p6 joined 21:38 sno joined 21:41 pmurias left 21:52 cpan-p6 left, cpan-p6 joined 21:54 dhyan_nataraj left 21:58 pmurias joined 22:05 sena_kun left 22:06 kurahaupo left, kurahaupo joined
Kaiepi m: class Maybe { method ^parameterize(Mu \M, Mu \T) { my $refinee = (T === Junction) ?? Mu !! Any; Metamodel::SubsetHOW.new_type: :name("Maybe[{T.^name}]"), :$refinee, :refinement(T | Failure) } }; my Maybe[Int] ($a, $b) = (1, Failure.new); say $a; say $b 22:15
camelia 5===SORRY!5=== Error while compiling <tmp>
An exception occurred while parameterizing Maybe
at <tmp>:1
Exception details:
Type check failed in binding to parameter '<anon>'; expected Any but got Junction (Junction)
in method parame…
22:15 cpan-p6 left, cpan-p6 joined
Kaiepi m: use nqp; class Maybe { method ^parameterize(Mu \M, Mu \T) { Metamodel::SubsetHOW.new_type: :name("Maybe[{T.^name}]"), :refinee(nqp::if(nqp::istype(T, Junction), Mu, Any)), :refinement(T | Failure) } }; my Maybe[Int] ($a, $b) = (1, Failure.new); say $a; say $b 22:16
camelia 1
Failed

Actually thrown at:
in block <unit> at <tmp> line 1
Kaiepi FINALLY
m: use nqp; class Maybe { method ^parameterize(Mu \M, Mu \T) { Metamodel::SubsetHOW.new_type: :name("Maybe[{T.^name}]"), :refinee(nqp::if(nqp::istype(T, Junction), Mu, Any)), :refinement(T | Failure) } }; my Maybe[Int] $a = 'a'
camelia Type check failed in assignment to $a; expected Maybe[Int] but got Str ("a")
in block <unit> at <tmp> line 1
22:20 SergiusUA left
lizmat m: my Int $a = Failure.new 22:26
camelia Earlier failure:
(HANDLED) Failed

Final error:
Type check failed in assignment to $a; expected Int but got Failure (&CORE::infix:<orelse>...)
in block <unit> at <tmp> line 1
lizmat hmmm
22:27 rindolf left
lizmat Kaiepi++ # perseverance 22:27
lizmat wonders whether Maybe should be core 22:28
22:29 cpan-p6 left, cpan-p6 joined 22:42 drclaw2 joined 22:44 cpan-p6 left, cpan-p6 joined 23:04 kurahaupo left 23:05 kurahaupo joined 23:09 cpan-p6 left 23:10 cpan-p6 joined 23:35 cpan-p6 left, cpan-p6 joined 23:50 cpan-p6 left, cpan-p6 joined