[00:00] *** sno left [00:02] *** reportable6 left [00:02] *** reportable6 joined [00:21] *** sno joined [00:27] *** parabolize left [00:28] *** sno left [00:29] *** parabolize joined [00:31] *** sno joined [00:37] *** sno left [00:59] *** DiffieHellman left [01:00] *** DiffieHellman joined [01:04] *** sno joined [01:10] *** sno left [01:12] *** DiffieHellman left [01:13] *** DiffieHellman joined [01:19] *** sno joined [01:23] *** sno left [01:29] *** sno joined [01:33] *** sno left [01:35] *** sno joined [01:41] *** sno left [01:49] *** kvw_5_ left [01:51] *** kvw_5 joined [01:53] *** sno joined [01:59] *** sno left [02:02] *** sno joined [02:08] *** sno left [02:11] *** titsuki joined [02:14] *** sno joined [02:16] *** kurahaupo left [02:16] *** dataangel left [02:18] *** sno left [02:28] *** kurahaupo joined [02:31] *** Geth joined [02:35] *** geth_ left [02:48] *** kurahaupo_ joined [02:48] *** kurahaupo left [02:50] *** kurahaupo_ left [02:51] *** kurahaupo joined [02:58] *** kurahaupo_ joined [03:02] *** kurahaupo left [03:03] *** kurahaupo_ left [03:04] *** kurahaupo joined [03:05] *** gabiruh left [03:05] *** gabiruh joined [03:32] *** tejr left [03:37] *** tejr joined [03:48] m: my $graph = -> $out, $freq = 440, $dur = 0.5, $amp = 0.6 { }; [03:48] rakudo-moar 877fdd775: ( no output ) [03:49] Comma CT gives me a sort of linting warning: Cannot put positional parameter $dur after an optional parameter [03:49] this seems reasonable, but i'm curious why i don't get the warning when executing a script. [03:51] also, Comma has really gotten better. yay! [04:16] *** dotdotdot left [04:20] *** rindolf joined [04:23] *** dotdotdot joined [04:36] *** kurahaupo_ joined [04:37] *** kurahaupo left [04:37] *** kurahaupo_ left [04:38] *** kurahaupo joined [04:47] *** kurahaupo left [04:58] *** [Sno] joined [05:07] *** geth_ joined [05:11] *** Geth left [05:12] *** ufobat joined [05:13] *** parabolize left [05:54] *** ufobat left [06:02] *** reportable6 left [06:03] *** reportable6 joined [06:32] *** aindilis` left [06:32] *** wl20 left [06:33] *** wl20 joined [06:33] *** ufobat joined [06:34] *** [Sno] left [06:46] *** domidumont joined [06:50] *** nn joined [06:50] *** nn left [06:53] *** domidumont left [06:54] *** Sgeo left [06:55] *** brtastic joined [06:56] *** stoned75 left [07:06] *** stoned75 joined [07:07] *** domidumont joined [07:19] *** pecastro joined [07:23] *** wamba joined [07:32] *** wamba left [07:32] *** wamba joined [07:32] *** wl20 left [07:34] *** wl20 joined [07:37] *** samcv left [07:42] *** samcv joined [07:42] *** asymptotically joined [08:38] *** geth_ left [08:41] Is there a built-in function to recursively process a hash/array? [08:42] I'm trying to change all hypen in the hash keys so the generated json can be useful to old codes. :-) [08:43] there's deepmap, dunno if that helps you [08:56] *** Geth joined [09:00] *** draco100[m] left [09:11] *** LizBot joined [09:20] thx, Will check it [09:21] hmm, deepmap doesn't work on keys, I'll have to write one myself [09:26] *** spacekookie left [09:27] *** spacekookie joined [09:32] xinming_ : if you are sure there will be no collisions between keys and values [09:32] you could maybe do something like: [09:34] my %ap{Any} = %hash.antipairs; my %changed = %ap.deepmap: { }; my %result = %changed.antipairs ? [09:34] meh, won't work with recursion, sorry for the noise [09:53] *** rindolf left [09:54] https://gist.github.com/moritz/8ab4e598ec74f2893b76ba3efe4fc44f [09:57] *** rindolf joined [09:57] *** Black_Ribbon left [10:02] moritz: thx, Actually, I have another version I wrote, but not generic as your version. [10:03] moritz: https://termbin.com/j7jf [10:03] Mine [10:04] BTW, are there any differences between .list vs .List ? [10:07] Sometimes, yes [10:08] *** wamba left [10:09] The former returns a Positional, it doesn't have to be a List [10:09] leont: could you please illustrate? I know .List is convert the Positional to a List using type object, but what does the .list do then? [10:09] Most of the time they do the same though [10:10] E.g. Array.list returns itself, but Array.List returns a new list [10:23] *** sno joined [10:23] *** wamba joined [10:28] *** Shaeto joined [10:31] is it correct chat for general raku programming questions? [10:34] yes [10:35] thank you :) Q: i use prototyped grammar token, is it possible to add ONE action handler for all proto :sym< > variants ? [10:38] moritz ^^ [10:39] for example i have "test:sym test:sym etc tests" and want to process all matches using one action method [10:40] method test ($/) does not work [10:53] *** linkable6 left [10:53] Shaeto: I don't think so [10:54] *** linkable6 joined [11:07] *** sno left [11:09] *** stoned75 left [11:09] *** spacekookie left [11:10] *** spacekookie joined [11:11] *** sno joined [11:19] *** sno left [11:21] thank you moritz [11:24] *** rindolf left [11:35] *** stoned75 joined [11:38] *** sno joined [11:48] *** sno left [11:50] *** wamba left [11:50] *** wamba joined [11:53] *** sno joined [11:57] *** Kaiepi left [11:57] *** Kaiepi joined [12:02] *** reportable6 left [12:04] *** reportable6 joined [12:04] *** sno left [12:12] *** parv left [12:21] *** Anton joined [12:34] Hi! I would like to generate sentences from Raku grammars. I have seen a video and a slide deck by Jonathan Worthington on the subject (titled "What if....Perl 6 Grammars could Generate?"), but they are from 7-8 years ago. Searches with Google did not produce links to other relevant work. Maybe there are some other / new efforts for that problem [12:34] people in this forum know about? [12:36] Anton, hi. There was such an initiative back then, I think, but it was less relevant for recent years and so was not developed actively. [12:37] sena_kun Ok, thanks! [12:38] maybe be easier after the RakuAST rework is finished [12:38] *** Gruber is now known as Grrrr [12:38] moritz I was just going to ask about using AST! :) [12:40] * moritz quicker :D [12:41] I think that, in principle, I should be able to "traverse" the methods/rules of the grammar objects and pick a random rule branches. Is this viable and easy enough? [12:41] once you can introspect your regexes sufficiently, yes [12:41] of course you also need to consider character classes [12:41] and quantifiers [12:45] So, to be clear, right now there is no sufficient regex introspection? [12:45] at least I wouldn't be aware of how to do it [12:48] @moritz Ok, thanks! You opinion to means that I should stay away from doing this in Raku for awhile... (I assume you are the author of the book "Parsing with Perl 6 Regexes and Grammars".) [12:48] you assume correctly [12:48] *** titsuki left [12:48] :)  Ok. Great book -- very instructive! [12:49] thanks, glad you liked it [12:49] in fact, it's the book I'm most proud of (and which has the lowest sell count of any of my books :D) [12:50] Hmm... I do think the subject matter is great, but most people / developers are not that interested in subject. [12:52] *The subject matter of the book... [12:53] @moritz I would like to ask about a different type of work you did : ODE solvers. Do you plan to resume your work on this package? https://github.com/moritz/Math-Model [12:54] Anton: not really, I consider that thing feature complete [12:55] Ok, good to know! [12:55] though if you would like to take it over, and expand it (maybe plug in different integrators?), I'd be open to such an idea [12:56] @moritz Yes, I think that would be interesting. I would like Raku packages to do, say, epidemiological simulations. [12:56] Also, I plan to write a numerical integration framework in Raku. Please see: https://github.com/antononcube/Raku-Math-NIntegrate [12:58] looks interesting [13:01] @moritz Thanks! Please take a look in this Raku package that generates monadic pipelines for epidemiological simulations: https://github.com/antononcube/Raku-DSL-English-EpidemiologyModelingWorkflows . Right now I hook that Raku package outcomes in R and Mathematica. As I said, I would to use ODE solvers in Raku. [13:03] *I would like to... [13:22] *** Anton left [13:32] *** sno joined [13:35] *** titsuki joined [13:45] *** b2gills left [14:08] *** mowcat joined [14:33] *** wamba left [14:35] *** ufobat_ joined [14:38] *** ufobat left [14:44] *** Shaeto left [14:46] *** domidumont left [14:47] *** domidumont joined [14:47] *** Sgeo joined [14:53] *** rindolf joined [15:00] *** brtastic left [15:09] *** b2gills joined [15:11] *** rindolf left [15:14] *** jmerelo joined [15:14] *** domidumont left [15:30] *** lucasb joined [15:33] *** sno left [15:49] *** patrickb joined [15:49] bisectable: "abcdefg".subst( / ( cde ) /, { say $0.encode.decode } ); [15:49] patrickb, Will bisect the whole range automagically because no endpoints were provided, hang tight [15:49] patrickb, Output on all releases: https://gist.github.com/1535d580ef0ea5711f6b7f554fb5598f [15:49] patrickb, Bisecting by exit code (old=2021.03 new=2021.04). Old exit code: 1 [15:50] patrickb, bisect log: https://gist.github.com/36be05e7a27269cf6c0711e1fa4d02f1 [15:50] patrickb, (2021-04-11) https://github.com/rakudo/rakudo/commit/57ffaf965164922edfbafb6730eeb2121a64d99d [15:50] patrickb, Bisecting by output (old=2016.09 new=2016.10) because on both starting points the exit code is 1 [15:50] patrickb, bisect log: https://gist.github.com/b3077eca7df1fb4522e1a9e403951af2 [15:50] patrickb, (2016-09-27) https://github.com/rakudo/rakudo/commit/222d16b0b94911fdedb06ee6ad817d0f14b9c05c [15:50] patrickb, Output on all releases and bisected commits: https://gist.github.com/45cabf1aa8e08062e3b0e03dcbc363dd [15:51] bisectable: "abcdefg".subst( / ( cde ) /, { say $0.Str.encode.decode } ); [15:51] patrickb, Will bisect the whole range automagically because no endpoints were provided, hang tight [15:51] patrickb, ¦6c (53 commits): «cde␤» [15:51] patrickb, Nothing to bisect! [15:59] *** patrickb left [15:59] *** asymptotically left [16:04] *** rindolf joined [16:53] *** aluaces left [17:00] *** sno joined [17:26] *** aluaces joined [17:33] *** wl20 left [17:34] *** wl20 joined [17:55] *** jmerelo left [18:02] *** reportable6 left [18:03] *** reportable6 joined [18:20] *** kurahaupo joined [18:37] *** aindilis joined [18:40] *** brtastic joined [18:48] *** maggotbrain left [18:48] *** maggotbrain joined [18:51] *** maggotbrain left [18:53] *** maggotbrain joined [19:02] *** titsuki left [19:11] *** Black_Ribbon joined [19:17] *** ufobat_ left [19:25] *** wamba joined [19:33] *** wl20 left [19:35] *** wl20 joined [19:53] *** Shaeto joined [19:55] can't find info how to call parent method, in p5 i use $self->SUPER:: what about raku ? [19:57] nextsame callsame [19:57] or specifically: $foo.Bar::methodname [19:59] thank you! [19:59] and the relevant doc are at https://docs.raku.org/language/functions#Re-dispatching [19:59] s/doc/docs/ [19:59] i tried to read objects inheritance docs [20:03] *** xelxebar_ joined [20:03] *** xelxebar left [20:19] Are set operations _supposed_ to exclude falsy values? [20:20] m: say Map.new((:foo(0), :bar(''), baz(1))) (-) Map.new((:qux(2))) [20:20] rakudo-moar 877fdd775: OUTPUT: «5===SORRY!5=== Error while compiling ␤Undeclared routine:␤ baz used at line 1. Did you mean 'bag'?␤␤» [20:21] m: say Map.new((:foo(0), :bar(''), :baz(1))) (-) Map.new((:qux(2))) [20:21] rakudo-moar 877fdd775: OUTPUT: «Set(baz)␤» [20:21] I found/find ^^^^ *very* surprising. Is it buggy, or am I just confused? [20:24] hmmm, the following seems inconsistent, which makes me think the above might be a bug [20:25] m: say ('', 0, 1) (-) (2) [20:25] rakudo-moar 877fdd775: OUTPUT: «Set( 0 1)␤» [20:49] it is documented: second paragraph and following example at https://docs.raku.org/type/Set#Creating_Set_objects [20:50] *** Shaeto left [20:54] see also the table at the bottom of the introduction at https://docs.raku.org/language/setbagmix which I'd assume is the justification for such behavior [20:58] raydiak: thanks. That's interesting, and might be worth noting in the (-) docs [I might do so, actually] [20:59] I don't really see how the table in setbagmix provides a justification, though? [21:02] from that table, I might expect Map.new((:foo(''), :bar)) (-) Map.new((:bar)) to return Set.new(:foo(0)), but I wouldn't expect the empty set [21:02] (Not arguing -- the other page you linked is clear that it's intentional. I'm just still confused) [21:03] so anything in a Set which :exists is True [21:05] m: say Map.new((:foo(0))):exists [21:05] rakudo-moar 877fdd775: OUTPUT: «True␤» [21:05] so when coercing the Map to a Set, it's calling .Bool on each value and doing what makes sense to a Set with that - throwing away the false things because they aren't in the set, according to set semantics [21:05] yes I agree it feels to me like we're confusing truthiness with existence to some extent [21:06] m: say (0, '').Set [21:06] rakudo-moar 877fdd775: OUTPUT: «Set( 0)␤» [21:06] m: say (0, False, 1).Set [21:06] rakudo-moar 877fdd775: OUTPUT: «Set(0 1 False)␤» [21:07] m: say (0, False, 1, :p(0)).Set [21:07] rakudo-moar 877fdd775: OUTPUT: «Set(0 1 False)␤» [21:08] ^^^ I think it is something to do specifically with the slightly odd smartmatching for Pair [21:09] (not unjustified -- it powers some cool features. But, still, it still seems a bit odd) [21:09] keys of any sort are allowed. it's the truthiness of the *value* that matters, which only exists when you're converting from a map-like thing or a pair or pairlist [21:10] look at how bag and mix work...if something drops to zero, it's not in the collection any more. so I guess someone thought "Sets should work just like that but under Bool instead of Int or Real" [21:11] ohh, thanks, that's a helpful way of putting it [21:12] re: someone thinking that -- maybe. But I also think it falls naturally out of the Pair smartmatch symantics [21:13] this is the relevant code: https://github.com/rakudo/rakudo/blob/master/src/core.c/Rakudo/QuantHash.pm6#L392 [21:15] agreed, that or maybe the method right below it SUB-PAIRS-FROM-SET, which notes that it uses Pair semantics [21:16] (aka, the semantics that mean :bar(42) ~~ :foo(42) returns True) [21:33] *** neshpion joined [21:34] *** wl20 left [21:35] *** wl20 joined [21:40] *** MasterDuke joined [21:49] *** mowcat left [22:10] *** wamba left [22:36] *** oddp joined [22:40] This works: say slurp.chomp.comb.map(...); now, if i wanna break that chain up and insert a newline after slurp, the whole thing breaks. Why's is calling slurp and not considering the .chomp... on the next line? thought we had semicolons just for that? [22:41] gives: "No such method 'chomp' for invocant of type 'Any'" [22:42] *** parv joined [22:42] slurp() looks a bit ugly, but i guess i have to go with that for now [22:42] *** parabolize joined [22:47] oddp: it's actually not the newline specifically -- it's any whitespace (because foo.method and foo .method have different precedence). I'm pretty sure you can do `slurp\ .chomp`, though [22:48] m: say -1.abs; say -1 .abs; say -1\ .abs [22:48] rakudo-moar 877fdd775: OUTPUT: «-1␤1␤-1␤» [22:49] I think \ is even uglier than () :P [22:49] :D fair. [22:49] and why are both slurp().chomp and slurp() .chomp working then? [22:50] m: class Foo { has $!sig = :($x = 1, $y = 1); method foo($!sig) {} } [22:50] rakudo-moar 877fdd775: OUTPUT: «===SORRY!===␤QAST::Block with cuid 1 has not appeared␤» [22:52] kybr: interpolating a signature bound to/stored in a variable as the signature for a sub/method is not (currently at least) possible [22:54] MasterDuke: thanks. [22:55] maybe i'll generate some code then. [22:57] oddp: I'm not 100% sure of the details, but it's caused by the fact that &infix:<.> (the one with a space) has lower precedence than the .method call, and that means that `slurp .chomp` is parsed as `slurp(Any.chomp)` -- which isn't possible with slurp() .chomp or slurp.chomp [22:58] https://github.com/rakudo/rakudo/issues/3786 and https://github.com/rakudo/rakudo/issues/1301 are related to the QAST::Block and cuid error [23:00] `slurp(Any.chomp)` -- hm, interesting. alright, thanks for your input! [23:17] *** pecastro left [23:48] *** brtastic left