[00:02] *** sena_kun joined [00:04] *** Altai-man_ left [00:05] *** hungrydonkey left [00:10] *** hungrydonkey joined [00:12] *** finanalyst joined [00:31] *** hungrydonkey left [00:31] *** hungrydonkey joined [00:45] *** hungryd20 joined [00:47] *** hungrydonkey left [00:49] *** finanalyst left [00:50] *** hungryd20 left [00:51] *** hungrydonkey joined [01:06] *** oddp left [01:24] *** nightfrog joined [01:57] *** molaf left [02:01] *** ensamvarg3 joined [02:01] *** Altai-man_ joined [02:04] *** sena_kun left [02:05] *** Manifest0 left [02:06] *** Manifest0 joined [02:10] *** molaf joined [02:21] *** Cabanossi left [02:22] *** reach_satori left [02:22] *** reach_satori joined [02:25] *** adu joined [02:25] how do you express empty? [02:26] wasn't something like [02:29] asu: As in set empty? [02:31] *** Cabanossi joined [02:32] m: my $a = ø; $a.gist.say [02:32] rakudo-moar c7c18c214: OUTPUT: «5===SORRY!5=== Error while compiling ␤Undeclared routine:␤ ø used at line 1␤␤» [02:32] m: 'ø'.uniname.say [02:32] rakudo-moar c7c18c214: OUTPUT: «LATIN SMALL LETTER O WITH STROKE␤» [02:32] m: 'ø'.ord.say [02:32] rakudo-moar c7c18c214: OUTPUT: «248␤» [02:33] m: my $a = ∅; $a.gist.say [02:33] rakudo-moar c7c18c214: OUTPUT: «Set()␤» [02:33] adu ^^ [02:35] sourceable: ∅ [02:35] Xliff, No idea, boss. Can you give me a Code object? [02:35] sourceable: my $a = ∅ [02:35] Xliff, https://github.com/rakudo/rakudo/blob/c7c18c2/src/core.c/operators.pm6#L9 [02:42] Xliff, no empty grammar production [02:45] *** xinming_ left [02:46] *** xinming_ joined [03:05] *** bdju left [03:05] *** bdju joined [03:11] *** tejr joined [03:13] *** Guest311 left [03:18] How you you represent the empty grammar production? [03:21] m: say Empty [03:21] rakudo-moar c7c18c214: OUTPUT: «()␤» [03:25] m: say "".match(token { Empty }) [03:25] rakudo-moar c7c18c214: OUTPUT: «Nil␤» [03:25] m: say "".match(token { }) [03:25] rakudo-moar c7c18c214: OUTPUT: «Nil␤» [03:26] m: say "".match(token { "something" }) [03:26] rakudo-moar c7c18c214: OUTPUT: «Nil␤» [03:26] m: say "".match(token { "" }) [03:26] rakudo-moar c7c18c214: OUTPUT: «「」␤» [03:26] There we go [03:29] m: say "".match(rx//) [03:29] rakudo-moar c7c18c214: OUTPUT: «「」␤» [03:29] m: say "oh".match(rx//) [03:29] rakudo-moar c7c18c214: OUTPUT: «「」␤» [03:29] *** Cabanossi left [03:40] *** Cabanossi joined [03:43] *** wamba joined [04:02] *** sena_kun joined [04:04] *** Altai-man_ left [04:11] *** OpenZen left [04:16] *** softmoth joined [04:18] *** Xliff left [04:20] *** OpenZen joined [05:06] *** molaf left [05:08] *** wamba left [05:29] *** OpenZen left [05:43] *** wamba joined [06:01] *** wamba left [06:01] *** Altai-man_ joined [06:04] *** sena_kun left [06:05] *** stoned75 left [06:07] *** stoned75 joined [06:08] *** molaf joined [06:21] *** adu left [06:26] *** tejr left [06:27] *** hungrydonkey left [06:30] *** tejr joined [06:34] *** hungrydonkey joined [06:38] *** softmoth left [07:09] *** brtastic joined [07:20] *** nightfrog left [07:20] *** nightfrog joined [07:24] *** Black_Ribbon left [07:33] *** brtastic left [07:43] u: İ [07:43] AlexDaniel, U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE [Lu] (İ) [07:43] this is so weird :D [07:51] *** dolmen joined [08:03] *** sena_kun joined [08:04] *** Altai-man_ left [08:05] *** dolmen left [08:08] *** dolmen joined [08:19] *** dolmen left [08:26] *** aborazmeh joined [08:26] *** aborazmeh left [08:26] *** aborazmeh joined [08:29] *** molaf left [08:43] it's used in Turkey for uc('i') [08:51] *** pecastro joined [08:53] *** ChrisRakuIrc joined [09:02] *** bocaneri left [09:04] *** bocaneri joined [09:10] I wonder if instead of declaring the name as a dependency, an uri with version (tag) could be declared. It solved the centralization problem [09:12] the only mandatory bit is forcing authors to use tags for releases, but that's something sane people do already [09:14] *** oddp joined [09:17] *** ChrisRakuIrc left [09:17] *** ChrisRakuIrc joined [09:26] *** ChrisRakuIrc left [09:26] *** ChrisRakuIrc joined [09:27] *** ChrisRakuIrc left [09:44] *** chrisMuc joined [09:45] *** chrisMuc left [09:49] *** hungrydonkey left [09:49] *** hungrydonkey joined [09:49] *** aborazmeh left [09:51] *** aborazmeh joined [09:51] *** aborazmeh left [09:51] *** aborazmeh joined [09:55] *** chrisMuc joined [09:58] *** chrisMuc left [10:01] *** Altai-man_ joined [10:04] *** sena_kun left [10:45] *** aborazmeh left [10:48] *** rindolf joined [10:50] *** holyghost joined [10:56] *** kensanata joined [11:21] *** hungrydonkey left [11:28] *** holyghost left [12:02] *** sena_kun joined [12:04] *** Altai-man_ left [13:05] *** linkable6 joined [13:07] *** evalable6 joined [13:20] *** nightfro` joined [13:20] *** nightfrog left [13:20] *** nightfro` is now known as nightfrog [13:23] *** lucasb joined [13:32] *** orinthe3 joined [13:34] *** orinthe left [13:34] *** orinthe3 is now known as orinthe [13:50] *** Cabanossi left [13:52] *** Cabanossi joined [14:01] *** rir joined [14:02] *** Altai-man_ joined [14:05] *** sena_kun left [14:10] *** rbt left [14:11] *** rbt joined [14:20] *** dolmen joined [14:37] *** fling left [14:39] t [14:49] *** rbt left [14:55] lolibloggedalittle: https://gfldex.wordpress.com/2020/07/04/piping-made-easy/ [14:58] *** softmoth joined [15:15] gfldex: another meaning is “it's not provided by core yet” :P [15:16] but yes, I actually need something like this [15:17] *** rbt joined [15:20] *** softmoth left [15:21] m: say [0, 1] [15:21] rakudo-moar eaa72afa1: OUTPUT: «(a b)␤» [15:21] m: say [0, 1]:kv.perl [15:21] rakudo-moar eaa72afa1: OUTPUT: «(0, "a", 1, "b")␤» [15:21] m: say [0, 1]:p.perl [15:21] rakudo-moar eaa72afa1: OUTPUT: «(0 => "a", 1 => "b")␤» [15:23] *** cpan-raku left [15:23] I'm trying to get the index of the shortest element of an array [15:24] (and ingoring undefined values) [15:24] *** cpan-raku joined [15:24] *** cpan-raku left [15:24] *** cpan-raku joined [15:24] is there anything more compact/readable than .pairs.grep(*.value.defined).min(*.value.chars).key; ? [15:25] *** dolmen left [15:31] *** fling joined [15:34] AlexDaniel: The custom IO::Handle part or the whole thing? [15:36] m: .pairs.sort(*.value.chars).tail.key.say [15:36] rakudo-moar eaa72afa1: OUTPUT: «2␤» [15:36] moritz, ^ maybe this one is a bit more easy to read. But not really very concise. [15:37] Altai-man_: that's potentially slower [15:37] m: say ('aaa', 'aa', 'a', Any).pairs.sort(*.value.chars).tail.key.say [15:37] rakudo-moar eaa72afa1: OUTPUT: «No such method 'chars' for invocant of type 'Any'␤ in block at line 1␤␤» [15:37] Ah, and there are also undefined ones... [15:37] Ok, never mind. [15:40] moritz: if you're not using sort, then you're potentially not even creating a copy of your initial array [15:40] it'll be seqs and iterators all the way through, if rakudo does things right [15:43] m: my @a = (‘foo’, ‘xxx’, ‘b’, Nil, ‘za’, ‘nnn’); say @a.pairs.min({.value.?chars // ∞}).key [15:43] rakudo-moar eaa72afa1: OUTPUT: «2␤» [15:44] moritz: what about this? [15:44] AlexDaniel: I like the sneaky way it avoids the extra grep, thanks :D [15:48] m: my @a = (‘foo’, ‘xxx’, ‘b’, Nil, ‘za’, ‘nnn’); say @a[]:p.min({.value.?chars // ∞}).key [15:48] rakudo-moar eaa72afa1: OUTPUT: «2␤» [15:48] a little bit of code golf :) [15:50] I'm working on a small program that generates strings from regexes [15:50] in particular, shortest possible strings [15:51] I'm sure it's been done before (even in raku), this is just a way to solidify my understanding of regex semantics [15:58] lazy lists are gold for that :D [16:00] question: are there limits (or ways to set limits) to the amount of resources a `hyper` operation takes up? I ask, because I was trying to build a shellscript like program to query zef for package info last night, and kept running into problems [16:00] I ended up using something along the lines of: [16:00] codesections: .hyper(jobs => 3) iirc [16:00] for $long-input.lines -> bution { f', 'info' $distribution } [16:01] moritz: thanks! That's the syntax I should have been using [16:02] https://docs.raku.org/routine/hyper [16:02] it's degree, not jobs [16:02] *** sena_kun joined [16:03] `hyper for $long-input.lines -> bution { f', 'info' $distribution }` was impressively capable of bringing even a pretty beefy dev machine to its knees! [16:04] *** Altai-man_ left [16:04] *** dolmen joined [16:04] for $.long-input.lines.hyper(:2degree) -> $line { ... } maybe? [16:04] Oh, there's my problem: I was reading the wrong docs page. I was on https://docs.raku.org/language/operators#index-entry-hyper_%3C%3C-hyper_%3E%3E-hyper_%C2%AB-hyper_%C2%BB-Hyper_operators [16:05] (which doesn't mention degree) [16:05] Thanks for the pointer to the right page! [16:09] enjoy, and good luck :D [16:18] *** vike left [16:25] gfldex: wow. great post! 💯 [16:29] :) [16:34] > great post! [16:34] agreed [16:35] One question, though: is the complexity of this driven by wanting/needing to keep the async nature of shell pipes? [16:35] If you were willing to wait for the first task to finish, you could do something simple with `==>`, right? [16:39] *** charsbar joined [16:53] my @a = ['a', 'b'], ['X'], ['1', '2']; say cross(@a).perl; say cross(|@a).perl; [16:53] moritz, rakudo-moar eaa72afa1: OUTPUT: «(($["a", "b"], $["X"], $["1", "2"]),).Seq␤(($["a", "b"], $["X"], $["1", "2"]),).Seq␤» [16:53] none of those seem to work [16:53] *** JJMerelo joined [16:54] what do I have to do to get the cross product of an array of arrays? [16:55] my @a = ['a', 'b'], ['X'], ['1', '2']; say cross(@a.map(*.list)).perl [16:55] moritz, rakudo-moar eaa72afa1: OUTPUT: «(("a", "X", "1"), ("a", "X", "2"), ("b", "X", "1"), ("b", "X", "2")).Seq␤» [16:55] aaaaargh, I HATE list handling [16:55] why do I need the .list here? [16:56] m: my @a = ['a', 'b'], ['X'], ['1', '2']; say [X] @a [16:56] rakudo-moar eaa72afa1: OUTPUT: «((a X 1) (a X 2) (b X 1) (b X 2))␤» [16:57] does this do what you needed? As for the *.list, I don't know :/ [16:57] tobs: that'd help, but in the end I actually want to do cross(..., :with) [16:59] The .Seq will be introduced by the map, right? And then propagated to cross [16:59] aha [16:59] m: say cross(['a', 'b'], ['X'], ['1', '2']) [16:59] rakudo-moar eaa72afa1: OUTPUT: «((a X 1) (a X 2) (b X 1) (b X 2))␤» [16:59] so it seems to be signature of cross's doing [16:59] m: my @a = ['a', 'b'], ['X'], ['1', '2']; say [X] @a [16:59] rakudo-moar eaa72afa1: OUTPUT: «((a X 1) (a X 2) (b X 1) (b X 2))␤» [16:59] tobs: if that works, I don't understand why cross(|@) doesn't work [17:00] cross(|@a) [17:00] JJMerelo: I don't see how the fact that map returns a Seq affects how &cross treats the individual items [17:02] moritz right... Well, if cross returns a Seq, I can't really see how you would make it return something else. Why is Seq a problem? [17:03] JJMerelo: that's not my problem at all [17:03] my @a = ['a', 'b'], ['X'], ['1', '2']; say cross(@a) [17:03] moritz, rakudo-moar eaa72afa1: OUTPUT: «(([a b] [X] [1 2]))␤» [17:03] my problem is that in this example, cross treats each inner list as a single item [17:03] my @a = ['a', 'b'], ['X'], ['1', '2']; say cross(|@a) [17:03] moritz, rakudo-moar eaa72afa1: OUTPUT: «(([a b] [X] [1 2]))␤» [17:03] and here as well [17:03] but in [17:04] say cross(['a', 'b'], ['X'], ['1', '2']) [17:04] moritz, rakudo-moar eaa72afa1: OUTPUT: «((a X 1) (a X 2) (b X 1) (b X 2))␤» [17:04] it doesn't [17:04] and I don't understand that, because my mental of anything(|@a) is that it behaves the same as anything(@a[0], @a[1], ...) [17:05] my @a = ['a', 'b'], ['X'], ['1', '2']; say cross(@a[0], @a[1], @a[2]) [17:05] moritz, rakudo-moar eaa72afa1: OUTPUT: «(([a b] [X] [1 2]))␤» [17:05] *** vike joined [17:06] so putting the inner arrays into the outer array magically itemizes them [17:06] * moritz so >.< close to switching to python [17:06] IIRC everything in an array is by default itemized [17:07] or well, I don't know. That's a very dark corner of Raku for me. [17:08] I know that array elems need to be containers to allow modifications, but I thought we were past the "a container itemizes" stage [17:08] maybe not [17:09] I hate all this list flattening and unflattening magic so much [17:09] It can get complicated and messy, yes... [17:09] you know, in python `for i in x()` just throws an exception if x() doesn't return anything iterable [17:09] and a, b is always a two-element tuple, no matter the contents of a and b [17:10] and then it has an explicit concatenation operator [17:10] it sometimes requires a tiny bit of manual effort, but all the edge cases are perfectly logical and pretty easy to understand [17:13] in python, lazy generators and lists are distinct; again not always as comfortable as lazy lists, but performant and easy to understand [17:23] moritz: is it the case of https://docs.raku.org/language/traps#Using_[%E2%80%A6]_metaoperator_with_a_list_of_lists ? [17:24] I'm not really following [17:26] moritz: well, yes, Raku is really hard. Nothing is ever straightforward or easy to understand [17:28] there used to be a saying about “baby talk” or something like that, but one thing that people don't mention out loud is that nobody is ever able to learn any feature fully [17:28] *** OpenZen joined [17:29] so Raku is fun when you start using it, but the further you go the more frustrated you get [17:30] all the quirks and edge cases bring so much mental load that it's almost unbearable [17:32] “A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away.” [17:33] there's a lot of things to take away from Raku, so you can probably guess what I think about the design :) [17:34] * [Coke] tries an older version of rakudo to see if cro works on that. :| [17:40] <[Coke]> (zef install cro on this box is soooooo slow. wtf.) [17:50] <[Coke]> is there a way to get verbose test output with zef? 'zef test .' is just showing that tests failed. [17:52] does --verbose or --debug help? zef has many flags in general [17:53] *** Tirifto joined [17:53] <[Coke]> verbose did it, thanks [17:54] <[Coke]> I tried test --help and it didn't show --verbose (probably a global option not one for the subcommand) [17:55] ah, possible [18:02] *** Altai-man_ joined [18:05] *** sena_kun left [18:15] *** maggotbrain joined [18:19] *** wamba joined [18:28] *** ensamvarg3 left [18:39] *** dolmen left [18:50] https://gist.github.com/moritz/af5f3cfcd497ab4d51baf4045c1060b9 my basic regex inverter [18:51] supports literals, char classes, alternatives(branches) and quantifiers [18:53] *** rbt left [18:53] ¦ ecosystem: 8b9cf5b873 | thundergnat++ (committed using GitHub Web editor) | META.list [18:53] ¦ ecosystem: Add Terminal-Boxer [18:53] ¦ ecosystem: [18:53] ¦ ecosystem: Automatically generate boxed tables, primarily for use in a terminal. [18:53] ¦ ecosystem: [18:53] ¦ ecosystem: See: https://github.com/thundergnat/Terminal-Boxer [18:53] ¦ ecosystem: review: https://github.com/Raku/ecosystem/commit/8b9cf5b873 [18:54] *** rbt joined [18:55] <[ptc]> moritz: is that what was causing you headaches earlier this evening? [18:56] [ptc]: I'd say Raku's list semantics caused the headaches, and I encountered them while implementing them :D [18:56] <[ptc]> :-D [19:03] *** softmoth joined [19:11] gist updated; now supports conjunctions [19:14] *** holyghost joined [19:16] I've just passed my 1st year bachelor of arts (painting) ! [19:16] I wonder if I should add a parser for the regexes :D [19:16] holyghost: congrats! [19:17] while working for perl mongers :-) [19:18] (I don't know you but…) congrats! [19:20] *** stoned75 left [19:22] *** stoned75 joined [19:26] *** telex left [19:27] *** telex joined [19:41] *** wamba left [19:57] *** dolmen joined [20:02] *** sena_kun joined [20:04] *** Altai-man_ left [20:34] *** dolmen left [20:34] https://gist.github.com/moritz/af5f3cfcd497ab4d51baf4045c1060b9 updated with a basic regex parser [20:36] it only supports word characters for literals and char class contents, otherwise it supports quantifiers, conjunctions and discjunctions, groups [20:36] *** dolmen joined [20:37] haven't tried really hard to get the precedence of the parser right, you can always use [] to correct precedence [20:50] <[ptc]> moritz: are you working on an update to your regex book? [20:51] <[ptc]> moritz: just saw your tweet. That answered my question :-) [20:53] nope. And I think it would be too much of a distraction from how regexes work, even if it's somewhat illustrative [20:54] it's a bit sad; the regex book is the one I'm most proud of, but it's the one with the fewest sales [20:55] but I bet it's a book that is more appreciated by the fewer people that *do* have it [20:57] <[ptc]> yup, definitely. I definitely enjoyed it while reviewing it :-) [20:58] the feedback has been very positive [21:00] *** softmoth left [21:09] *** aborazmeh joined [21:09] *** aborazmeh left [21:09] *** aborazmeh joined [21:46] *** Xliff joined [21:47] *** aborazmeh left [21:52] *** softmoth joined [21:55] *** rindolf left [21:58] *** Maylay joined [22:01] *** Altai-man_ joined [22:04] *** sena_kun left [22:12] *** dolmen left [22:13] *** dolmen joined [22:16] *** Benett left [22:22] *** kensanata left [22:22] *** flossy joined [22:25] *** Benett joined [22:39] *** stux|RC-only left [22:44] *** libertas joined [23:00] *** dolmen left [23:02] New module released to CPAN! LibXML (0.5.4) by 03WARRINGD [23:12] *** Benett left [23:18] *** Benett joined [23:21] *** Tirifto left [23:23] *** pecastro left [23:26] *** vrurg left [23:27] *** vrurg joined [23:48] *** flossy left [23:48] *** flossy_ joined