»ö« 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:10 mkapra left, z-o-a joined 00:44 aborazmeh left 00:47 pecastro left 00:52 aborazmeh joined, aborazmeh left, aborazmeh joined
cpan-p6 New module released to CPAN! Getopt-Long (0.1.0) by 03LEONT 01:02
01:09 zachk left 01:28 dct_ left 01:31 isomorphismes left 01:34 sena_kun left 01:41 softmoth joined 01:54 softmoth left, softmoth_ joined 01:56 softmoth_ left 01:57 softmoth_ joined 02:04 jeek left 02:12 molaf left 02:21 mkapra joined 02:24 molaf joined
Elronnd is there a way to say 'this string parameter must be composed of only these characters'? 02:26
timotimo you could use a regex match 02:27
m: sub only-vowels(Str $a where /^<[aeiou]>*$/) { say "ok $a" }; try only-vowels("abcde"); try only-vowels("ae"); try only-vowels("") 02:28
camelia ok ae
ok
Elronnd ahhh thx 02:29
leont I rarely find it useful not to have a default option, if only to give a clearer error 02:31
Elronnd that's probably a good idea; this is an internals function called only once though, and that's just to protect against a case that shouldn't happen _anyway_ (checked against outside the callsite) so it's probably fine 02:36
02:37 jme` left
timotimo the regex check may be relatively expensive, though 02:37
so if it's a function that's called often, perhaps check on the performance every now and then
02:43 softmoth_ left 02:55 mkapra left 03:02 Xliff left, aborazmeh left 03:25 ferreira1 joined, ToddAndMargo joined
ToddAndMargo Newbie question: is there a way to declare a variable as both a Buf and a Str and then work on it as either a Buf or a Str? Seems to me they are both arrays of bytes 03:27
03:28 ferreira left, mkapra joined 03:29 markoong left, mkapra left 03:32 ferreira joined
MasterDuke ToddAndMargo: there's been some talk of creating/enabling some of the Str functions for Buf. but they're not both arrays of bytes in Perl 6 (in one way) 03:33
03:33 mkapra joined
MasterDuke a Str could have multiple bytes combined into one grapheme. manipulating those bytes could result in an invalid string 03:34
03:34 ferreira1 left 03:38 saki left
cpan-p6 New module released to CPAN! Net-BGP (0.1.1) by 03JMASLAK 03:40
ToddAndMargo Rats! What would the fastest way to convert a Beuf into a string with NO CONVERSIONS? 03:53
I would adore a bunch of string functions converted to for type Buf!!!
Bug not a Beuf 03:54
Buf not Bug.
03:57 leont left
MasterDuke what do you mean no conversions? 03:58
03:59 tomato_ joined 04:02 mkapra left 04:06 tomato_ left, tomato_ joined
tomato_ Hi, please see a small question: what doe the dollar sign mean in this error message? "# expected: $[1, 2], got: [1, 2]" 04:13
Are they different?
04:14 cpan-p6 left, cpan-p6 joined, ToddAndMargo left 04:15 smallick joined 04:20 mkapra joined 04:24 mkapra left 04:34 jme` joined 04:36 ferreira left 04:38 ferreira joined 04:49 tomato_ left 04:59 _isomorphismes joined 05:04 jme` left
Elronnd if I return Nil from a function, and assign a variable to the output of that function, the variable is Any 05:17
how can I check if the result of the function was Nil? $result ~~ Any returns True, but that's not very helpful
05:30 vrurg left 05:31 pmurias left, pmurias joined 05:48 _isomorphismes left 06:01 jme` joined
b2gills You either need to bind to the variable with :=, or set the default of the variable to Nil 06:16
m: sub foo ( --> Nil ){}; my $a = foo; say $a; my $b := foo; say $b; my $c is default(Nil) = foo; say $c 06:17
camelia (Any)
Nil
Nil
b2gills Elronnd: ^^^ 06:18
Note that sigiless variables are always binding 06:19
m: sub foo (-->Nil){}; my \sigiless = foo; say sigiless 06:20
camelia Nil
06:36 andrzejku_ joined, mowcat left 06:37 smallick left 06:54 woolfy left 07:05 zacts joined 07:21 ufobat__ joined 07:24 ufobat_ left 07:36 dct_ joined
Geth doc: 6a0e6d4428 | (Nick Logan)++ | 2 files
CURFS and CURI basics
07:45
doc: f0cb1f64fb | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | 2 files
Merge pull request #2602 from ugexe/cur-basic

CURFS and CURI basics Thanks!
07:54 zacts left 07:59 pmurias left, pmurias joined 08:10 mayuresh joined, mayuresh left
Elronnd b2gills: ok, thanks 08:15
08:15 cpan-p6 left, cpan-p6 joined 08:16 jmerelo joined 08:19 rindolf joined 08:22 domidumont joined 08:30 tomato_ joined 08:35 tomato_ left 08:46 zacts joined 08:52 zacts left 09:07 molaf left 09:09 domidumont left 09:13 lizmat joined
lizmat weekly: gfldex.wordpress.com/2019/02/02/nq...n-threads/ 09:13
notable6 lizmat, Noted!
09:19 patrickb joined 09:24 lizmat left 09:31 pmurias left, pmurias joined
Geth doc: 2c795607d7 | (JJ Merelo)++ | doc/Type/IO/ArgFiles.pod6
Adds an example which fails with invalid filehandles.

I couldn't find a way to deal with them, as indicated in #96 and rakudo/rakudo#2666. I asked [this question in SO](stackoverflow.com/questions/545015...ects-too), will reopen if there's some answer that does not involve catching the error. Meanwhile, closes #96
09:44
synopsebot Link: doc.perl6.org/type/IO::ArgFiles
synopsebot RAKUDO#2666 [open]: github.com/rakudo/rakudo/issues/2666 implement a new var @*ARGFILES listing paths for @*ARGS that are existing files
09:47 patrickb left 10:12 z-o-a left 10:13 dct_ left 10:16 ravenousmoose joined 10:33 lizmat joined 10:47 ravenousmoose left
jmerelo hi, lizmat . How''s FOSDEM going? 10:49
10:57 lizmat left 11:07 pecastro joined 11:08 dct_ joined 11:19 z-o-a joined 11:26 kurahaupo joined 11:27 reach_satori left 11:31 mkapra joined 11:32 mkapra left 11:36 ferreira left, ferreira joined 11:39 z-o-a left, kurahaupo left 11:40 kurahaupo joined, dct_ left 11:41 lucasb joined 11:43 dct_ joined
jmerelo m: my $m = (1 => 0.5, 2 => 0.25, 3 => 0.3 ).Mix; say $m 11:46
camelia Mix(1(0.5), 2(0.25), 3(0.3))
jmerelo m: my $m = (1 => 0.5, 2 => 0.25, 3 => 0.3 ).Mix; say 2 (elem) $m
camelia True
11:51 kurahaupo left, kurahaupo joined 12:03 cpan-p6 left 12:04 cpan-p6 joined, dct_ left 12:06 kurahaupo left, kurahaupo joined 12:10 andrzejku_ left 12:13 yqt joined 12:18 kurahaupo left 12:22 molaf joined, kurahaupo joined 12:28 dct_ joined 12:30 sena_kun joined 12:32 leont joined 12:33 markoong joined, kurahaupo left 12:38 kurahaupo joined 12:39 aborazmeh joined, aborazmeh left, aborazmeh joined 12:50 kurahaupo left 12:51 kurahaupo joined 12:59 [Sno] left 13:00 andrzejku_ joined 13:02 ravenousmoose joined 13:04 kurahaupo left, kurahaupo joined 13:15 kurahaupo left 13:16 zacts joined, kurahaupo joined 13:26 kurahaupo left, kurahaupo joined 13:34 andrzejku_ left, mowcat joined 13:36 kurahaupo left, jmerelo left, z-o-a joined, kurahaupo joined 13:39 ravenousmoose left 13:40 ravenousmoose joined 13:41 mowcat left 13:46 kurahaupo left 13:47 kurahaupo joined 13:56 mowcat joined 13:57 kurahaupo left, kurahaupo joined 13:58 saki joined 14:06 z-o-a left 14:08 mowcat left 14:09 dogbert17 left 14:11 mowcat joined 14:12 kurahaupo left, kurahaupo joined 14:15 dct_ left, z-o-a joined 14:22 aborazmeh left 14:23 zacts left 14:27 ravenousmoose left, kurahaupo left, kurahaupo joined 14:37 kurahaupo left, kurahaupo joined 14:48 kurahaupo left, kurahaupo joined 14:51 molaf left 14:55 dct_ joined
cpan-p6 New module released to CPAN! App-Prove6 (0.0.9) by 03LEONT 15:03
15:03 kurahaupo left, kurahaupo joined 15:11 lucasb left 15:13 z-o-a left, kurahaupo left, kurahaupo joined 15:23 kurahaupo left 15:24 kurahaupo joined 15:32 z-o-a joined 15:38 z-o-a left, kurahaupo left 15:39 kurahaupo joined 15:40 cpan-p6 left, cpan-p6 joined 15:47 z-o-a joined 15:51 kurahaupo left 15:52 kurahaupo joined, isomorphismes joined 15:53 leont left 15:56 z-o-a left 16:03 kurahaupo left, saki left, kurahaupo joined 16:04 isomorphismes left 16:05 smallick joined
smallick say 0 16:06
evalable6 0
smallick m: say 1 16:07
camelia 1
16:14 kurahaupo left 16:15 kurahaupo joined 16:20 Mediphira joined, Mediphira left 16:24 MilkmanDan left, jmerelo joined 16:26 MilkmanDan joined 16:27 kurahaupo left, kurahaupo joined 16:29 smallick left 16:39 zacts joined 16:41 kurahaupo left, zakharyas joined 16:42 kurahaupo joined 16:55 kurahaupo left 16:56 kurahaupo joined 16:57 dct_ left 17:02 reach_satori joined 17:08 isomorphismes joined, dct_ joined 17:09 kurahaupo left, kurahaupo joined 17:18 dct_ left 17:24 kurahaupo left, kurahaupo joined 17:30 w17t left 17:39 kurahaupo left, reach_satori_ joined, kurahaupo joined 17:40 andrzejku_ joined 17:42 reach_satori left 17:50 kurahaupo left, kurahaupo joined 17:53 b2gills left 17:57 b2gills joined 17:58 zacts left 18:06 isomorphismes left 18:09 molaf joined
Geth doc: 675330d619 | cfa++ | 6 files
a → an (#2604)
18:24
doc: e45f0317e1 | cfa++ | 7 files
an → a, an → and (#2604)
18:27
timotimo .seen cygx 18:29
yoleaux I saw cygx 10 Jan 2019 19:56Z in #moarvm: <cygx> if it solves a legitimate problem, I wouldn't let purity be the enemy of pragmatism...
18:40 Ven`` joined 18:47 zacts joined 18:53 jmerelo left 18:59 kensanata joined 19:06 cpan-p6 left, cpan-p6 joined 19:08 reach_satori_ left 19:09 zacts left
timotimo .tell cygx i want to put something in the ecosystem to bridge Image::RGBA::Text and SDL2::Raw, how does that sound to you? 19:10
yoleaux timotimo: I'll pass your message to cygx.
19:12 kensanata left
TreyHarris This is interesting... I was getting tired of ANSI line noise in my compilation buffer in Emacs, so I added a hook to colorize the output. But it only works for runtime errors. Compile-time errors still show as '^[===^[SORRY!^[===^[ Error while compiling -'. 19:31
I wonder what Emacs could be seeing differently in the two cases?
moritz I think there is an environment variable to suppress the ANSI codes
timotimo is that a difference between stdout and stderr being used? 19:32
TreyHarris Yeah, I'll go that route next, but I was getting pretty colors for runtime errors. :-)
Shouldn't both noparse and divide-by-zero (the two cases I was comparing just now) both go to stderr?
timotimo probably
19:35 vendethiel- joined, kensanata joined 19:37 Ven`` left
TreyHarris They both go to stderr, so I'm going to guess it may be that the filter isn't equipped to deal with a output stream that begins with escape codes perhaps? That's the only difference I see immediately. I guess I can load ANSI myself and note something to see 19:38
19:46 andrzejku_ left 20:20 domidumont joined 20:26 domidumont left 20:28 domidumont joined 20:30 Khisanth left 20:31 domidumont left
Geth doc: 0434083c02 | cfa++ | doc/Language/testing.pod6
/type/Role (broken) → /language/objects#Roles
20:37
synopsebot Link: doc.perl6.org/language/testing
doc: d189ee1b86 | cfa++ | 4 files
/type/EVAL (broken) → /routine/EVAL
20:39
20:44 Khisanth joined 20:46 drolax joined 20:48 sno joined 21:14 zakharyas left 21:23 domidumont joined, yqt left, pmurias left 21:25 domidumont left
gfldex lolibloggedalittle: gfldex.wordpress.com/2019/02/03/th...a-channel/ 21:31
21:37 vendethiel- left 21:41 eseyman left
timotimo gfldex: you can use a semaphore, or atomic integers to get that 64-at-the-same-time thing going; another thing i like doing is have a channel for "tickets" and receiving from the channel is "taking a ticket" and sending to it is "freeing the ticket" and you just send, for example, 64 tickets at the very start to fill the channel 21:42
21:45 kensanata left, eseyman joined 21:50 zengargoyle joined 21:54 Xliff joined
Xliff m: say π - 4 * ([+] <1 -1> <</<< (1,3,5,7,9...20)) 21:54
camelia 0.09975303466039076
Xliff m: say π - 4 * ([+] <1 -1> <</<< (1,3,5,7,9...10000)) 21:55
camelia 0.0001999999980029088
Xliff m: say 3 + [+] ((2, 4...*).map: -> $i {($i % 4 - 1) * 4/[*] $i..($i+2)})[^1000] 21:57
camelia 3.1415926533405423
21:58 cpan-p6_ joined
Xliff m: ((2, 4...*).map: -> $i {($i % 4 - 1) * 4/[*] $i..($i+2)})[^1000] 21:58
camelia ( no output )
Xliff m: ((2, 4...*).map: -> $i {($i % 4 - 1) * 4/[*] $i..($i+2)})[^1000].say
camelia (0.166667 -0.033333 0.011905 -0.005556 0.00303 -0.001832 0.00119 -0.000817 0.000585 -0.000433 0.000329 -0.000256 0.000204 -0.000164 0.000134 -0.000111 0.000093 -0.000079 0.000067 -0.000058 0.00005 -0.000044 0.000039 -0.000034 0.00003 -0.000027 0.00002…
Xliff m: say 3 + [+] ((2, 4...*).map: -> $i {($i % 4 - 1) * 4/[*] $i..($i+2)})[^1000] 21:59
camelia 3.1415926533405423
Xliff m: say 3 + [+] ((2, 4...*).map: -> $i {($i % 4 - 1) * 4/[*] $i..($i+2)})[^30]
camelia 3.1415842726746206
Xliff m: asy 22/7 22:04
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
asy used at line 1. Did you mean 'any', 'say'?
Xliff m: asy (22/7)
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
asy used at line 1. Did you mean 'say', 'any'?
Xliff m: say (22/7)
camelia 3.142857
Xliff m: say 22/7
camelia 3.142857
Xliff m: say 23/7
camelia 3.285714
Xliff m: say 22/7
camelia 3.142857
Xliff m: say 22/7.^name.say
camelia Int
22
Xliff m: say (22/7).^name.say
camelia Rat
True
22:09 cpan-p6 left
timotimo gfldex: i think you can save just a little bit of memory by defining @dirs to be a "my str @dirs" 22:09
Xliff m: say (22/7).base-repeating 22:12
camelia (3. 142857)
Xliff m: say (22/7).base-repeating.say
camelia (3. 142857)
True
Xliff m: say (335/113).base-repeating.say
camelia (2. 9646017699115044247787610619469026548672566371681415929203539823008849557522123893805309734513274336283185840707)
True
Xliff m: say (344/113).base-repeating.say
camelia (3. 0442477876106194690265486725663716814159292035398230088495575221238938053097345132743362831858407079646017699115)
True
22:13
Xliff m: say (355/113).base-repeating.say
camelia (3. 1415929203539823008849557522123893805309734513274336283185840707964601769911504424778761061946902654867256637168)
True
Xliff m: say 3~(355/113).base-repeating[1] 22:15
camelia 31415929203539823008849557522123893805309734513274336283185840707964601769911504424778761061946902654867256637168
Xliff m: say 3~(355/113).base-repeating[1].split.comb(2).map(*.join(' '))
camelia Cannot resolve caller split(Str:D: ); none of these signatures match:
(Str:D: Regex:D $pat, $limit is copy = Inf;; :$v is copy, :$k, :$kv, :$p, :$skip-empty, *%_ --> Seq:D)
(Str:D: Str(Cool) $match;; :$v is copy, :$k, :$kv, :$p, :$skip-emp…
Xliff m: say 3~(355/113).base-repeating[1].comb(2).map(*.join(' '))
camelia 314 15 92 92 03 53 98 23 00 88 49 55 75 22 12 38 93 80 53 09 73 45 13 27 43 36 28 31 85 84 07 07 96 46 01 76 99 11 50 44 24 77 87 61 06 19 46 90 26 54 86 72 56 63 71 68
Xliff m: say (3~(355/113).base-repeating[1]).comb(2).map(*.join(' ')) 22:16
camelia (31 41 59 29 20 35 39 82 30 08 84 95 57 52 21 23 89 38 05 30 97 34 51 32 74 33 62 83 18 58 40 70 79 64 60 17 69 91 15 04 42 47 78 76 10 61 94 69 02 65 48 67 25 66 37 16 8)
Xliff \o/\
22:20 drolax left 22:23 sivoais joined
Xliff m: say (3~(355/113).base-repeating[1]).comb(2) 22:38
camelia (31 41 59 29 20 35 39 82 30 08 84 95 57 52 21 23 89 38 05 30 97 34 51 32 74 33 62 83 18 58 40 70 79 64 60 17 69 91 15 04 42 47 78 76 10 61 94 69 02 65 48 67 25 66 37 16 8)
Xliff m: say (3~(355/113).base-repeating[1]).comb(2).perl.say 22:39
camelia ("31", "41", "59", "29", "20", "35", "39", "82", "30", "08", "84", "95", "57", "52", "21", "23", "89", "38", "05", "30", "97", "34", "51", "32", "74", "33", "62", "83", "18", "58", "40", "70", "79", "64", "60", "17", "69", "91", "15", "04", "42", "47"…
Xliff m: say (3~(355/113).base-repeating.join.comb(2).perl.say 22:41
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in parenthesized expression; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> 0313).base-repeating.join.comb(2).perl.say7⏏5<EOL>
Xliff m: say (3~(355/113).base-repeating.join('').comb(2).perl.say
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in parenthesized expression; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> 3base-repeating.join('').comb(2).perl.say7⏏5<EOL>
Xliff m: say (355/113).base-repeating.join('').comb(2).perl.say
camelia ("3.", "14", "15", "92", "92", "03", "53", "98", "23", "00", "88", "49", "55", "75", "22", "12", "38", "93", "80", "53", "09", "73", "45", "13", "27", "43", "36", "28", "31", "85", "84", "07", "07", "96", "46", "01", "76", "99", "11", "50", "44", "24"…
Xliff m: say (355/113).base-repeating.join.comb(2).perl.say
camelia ("3.", "14", "15", "92", "92", "03", "53", "98", "23", "00", "88", "49", "55", "75", "22", "12", "38", "93", "80", "53", "09", "73", "45", "13", "27", "43", "36", "28", "31", "85", "84", "07", "07", "96", "46", "01", "76", "99", "11", "50", "44", "24"…
22:44 MilkmanDan left, notagoodidea joined 22:45 MilkmanDan joined 22:50 matiaslina joined 22:52 ferreira left
notagoodidea Hi all! I'm digging a little bit in perl6 grammars and binary data parsing after seeing a talk in fosdem and having to some nice chat with perl6 folks. I have found some old (~4yo) gist liking to Synopsis 05, I was asking myself is there a place that recap the state of current implementation vs the synopsis? (i'm looking for the :bytes from the new modifiers section of S05) 22:54
22:56 MilkmanDan left, MilkmanDan joined
timotimo notagoodidea: that's sadly not implemented at all so far 23:01
rakudo-moar can currently only work with grammars on the grapheme level
which even in latin1 will be normalizing \r\n into a single grapheme
(because that's what the unicode folks have decided) 23:02
notagoodidea timotimo: Someone linked a blog post doing that (buf -> latin1 -> grammar) in my SO question. Where can we find how/where the grapheme definition for perl6 is (the actual code) ? 23:20
23:28 notagoodidea left
timotimo sorry, i was distracted for a while there 23:30
oh no, they already left :< 23:31
i guess i'll post to StackOverflow then?
23:33 mowcat left 23:34 kurahaupo_ joined 23:35 kurahaupo_ left 23:36 matiaslina left 23:38 kurahaupo left 23:43 kurahaupo joined 23:45 kurahaupo_ joined, kurahaupo_ left 23:46 kurahaupo_ joined, tomato_ joined 23:47 kurahaupo left, pecastro left 23:49 tomato_ left