🦋 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 hungrydonkey joined 00:02 dolmen joined, dolmen_ left 00:03 oneeggeach left 00:06 ensamvarg3 joined, oddp left 00:08 Petr37 left 00:16 aindilis left, markoong left 00:20 cydf left 00:26 hungrydonkey left 00:34 rbt left 00:35 rbt joined 00:37 hungrydonkey joined 01:13 _jrjsmrtn joined, __jrjsmrtn__ left 01:21 irced joined 01:22 no-n joined 01:24 aindilis joined 01:41 irced left 01:55 ensamvarg3 left, ensamvarg3 joined, cpan-raku left 02:05 Manifest0 left, Manifest0 joined 02:14 cpan-raku joined, cpan-raku left, cpan-raku joined 03:05 oneeggeach joined 03:20 pilne left 03:37 pad108 joined 03:39 pad108 left 03:40 dolmen left 03:51 pad10884 joined 03:52 pad10884 left 04:06 oneeggeach left 04:30 kktt007 left, kktt007 joined 04:34 OpenZen left 04:50 Xliff joined 05:13 kensanata joined 05:23 hungrydonkey left 05:24 hungryd72 joined 05:40 hungryd72 left 05:49 Xliff left 05:52 bocaneri joined 05:59 hungrydonkey joined 06:18 hungryd55 joined, hungrydonkey left 06:29 __jrjsmrtn__ joined 06:31 _jrjsmrtn left 06:32 skids left
no-n is it possible to declare two classes that 'has' a variable of each others type? 06:32
06:47 molaf joined 06:57 wamba joined, hungryd55 left 06:58 hungrydonkey joined 07:00 rindolf joined
guifa2 no-n: yes 07:06
it's easiest if they're in the same file
if you have classes A and B, first stub B: class B { … }
then define class A: class A { has B $.b } 07:07
then define class B: class B { has A $.a }
07:08 ensamvarg3 left
no-n ah! thanks 07:09
guifa2 if they're in different files..... you can sometimes pull off using interpolated types like class A { ::('B') $.b } but it's tough to get right 07:10
no-n heh, no, that's ok, they're same file :) 07:11
07:11 JJMerelo joined
guifa2 Yeah, then stubbing is the way to go. I actually had to merge a few classes into one mega file because of that a few months ago 07:14
no-n *nod* 07:15
JJMerelo releasable6: status 07:38
releasable6 JJMerelo, Next release in ≈11 hours. 1 blocker. 85 out of 85 commits logged
Geth_ doc: 9c89efc471 | Antonio++ (committed using GitHub Web editor) | doc/Type/Junction.pod6
Fix typo, close #3516
linkable6 Link: docs.raku.org/type/Junction
DOC#3516 [closed]: github.com/Raku/doc/issues/3516 [docs] typo in method new of junction
releasable6 JJMerelo, Details: gist.github.com/d7dbd4fcc8bfb911cb...3e9b495ca5
07:45 kensanata left, kensanata joined 07:47 sena_kun joined 07:56 yangzq50 left 07:57 yangzq50 joined
Geth_ doc: 7fe5a62423 | (JJ Merelo)++ | 2 files
Eliminates boolean from dictionary, refs #3517
07:59
doc: d25ee46567 | (JJ Merelo)++ | doc/Type/Junction.pod6
Changes to Boolean in Junctions, refs #3517
linkable6 DOC#3517 [open]: github.com/Raku/doc/issues/3517 [docs][easy to resolve] Boolean should be capitalized
Link: docs.raku.org/type/Junction
08:11 ensamvarg3 joined 08:27 vrurg left 08:29 vrurg joined 08:32 oddp joined 08:41 rbt left, rbt joined 08:56 wamba left 09:12 Altai-man_ joined 09:14 sena_kun left 09:26 JJMerelo left 09:34 JJMerelo joined
JJMerelo m: my regex key {<? ^^ [#-]> \d+ }; say "#333" ~~ &key 09:35
camelia 5===SORRY!5===
Unrecognized regex metacharacter < (must be quoted to match literally)
at <tmp>:1
------> 3my regex key {<?7⏏5 ^^ [#-]> \d+ }; say "#333" ~~ &key
Unrecognized regex metacharacter ? (must be quoted to match literally)…
JJMerelo m: my regex key {<?^^ [#-]> \d+ }; say "#333" ~~ &key 09:36
camelia 5===SORRY!5===
Unrecognized regex metacharacter < (must be quoted to match literally)
at <tmp>:1
------> 3my regex key {<?7⏏5^^ [#-]> \d+ }; say "#333" ~~ &key
Unrecognized regex metacharacter ? (must be quoted to match literally)
JJMerelo m: my regex key {<?^ [#-]> \d+ }; say "#333" ~~ &key
camelia 5===SORRY!5===
Unrecognized regex metacharacter < (must be quoted to match literally)
at <tmp>:1
------> 3my regex key {<?7⏏5^ [#-]> \d+ }; say "#333" ~~ &key
Unrecognized regex metacharacter ? (must be quoted to match literally)
a…
JJMerelo m: my regex key { \d+ <?3$>}; say " #333" ~~ &key 09:37
camelia 5===SORRY!5===
Unrecognized regex metacharacter < (must be quoted to match literally)
at <tmp>:1
------> 3my regex key { \d+ <?7⏏053$>}; say " #333" ~~ &key
Malformed regex
at <tmp>:1
------> 3my regex key { \d+ <?7⏏053$>};…
JJMerelo m: my regex key {<?[^^]> \d+ }; say "333" ~~ &key 09:38
camelia Potential difficulties:
Repeated character (^) unexpectedly found in character class
at <tmp>:1
------> 3my regex key {<?7⏏5[^^]> \d+ }; say "333" ~~ &key
Nil
JJMerelo m: my regex key {<?[^]> \d+ }; say "333" ~~ &key
camelia Nil
09:39 Black_Ribbon left, wamba joined 09:40 pecastro joined
JJMerelo So I have no idea what this "Anchors ^, ^^, $, and $$ are valid in lookarounds" means 09:43
09:44 MasterDuke joined 09:48 holyghost joined 09:59 Sgeo left 10:11 markoong joined 10:13 JJMerelo left 10:19 vrurg left 10:20 vrurg joined 10:21 sena_kun joined 10:23 Altai-man_ left 10:24 vrurg left 10:36 cydf joined 10:48 thundergnat joined
thundergnat JJMerlo: I suspect that that is just ambiguously worded and means "Anchors ^, ^^, $, and $$ are valid in lookahead and lookbehind assertions" 10:50
m: say ("aabZ ccd eef" ~~ m:g/ \w+ <?[Z:$]> /).Str
camelia aab
thundergnat m: say ("aabZ ccd eef" ~~ m:g/ \w+ <before 'Z' | $> /).Str 10:51
camelia aab eef
thundergnat Yeah.
10:56 vrurg joined 10:57 vrurg left, vrurg joined 11:18 codesections joined 11:43 molaf left 11:47 thundergnat left, kktt007 left 11:48 hungryd78 joined 11:49 kktt007 joined 11:51 Manifest0 left 11:52 oddp left, Manifest0 joined, hungrydonkey left 12:02 isacl___ left
elcaro 12:02
12:07 cydf left, cydf joined 12:18 molaf joined 12:20 Altai-man_ joined 12:23 sena_kun left 12:24 wamba left 12:28 wildtrees joined, kktt007 left 12:29 kktt007 joined, kktt007 left 12:30 kktt007 joined, wildtrees left, kktt007 left, kktt007 joined, wildtrees joined 12:39 kktt007 left, kktt007 joined 12:43 rbt left 12:44 rbt joined 12:51 lucasb joined 12:52 kensanata left
Geth_ ecosystem/finanalyst-patch-4: 9e4d9b6191 | (Richard Hainsworth)++ (committed using GitHub Web editor) | META.list
Remove old module from Ecosystem

my `finanalyst/raku-pod-render` is a complete rewrite and upgrade of `finanalyst/pod-render`. Old pod-render is too close in name and could be confusing. Not aware that anyone uses old `pod-render`. So removing from the Ecosystem seems best.
12:53
ecosystem: finanalyst++ created pull request #518:
Remove old module from Ecosystem
12:53 oddp joined 12:58 cpan-raku left 13:05 kensanata joined 13:06 cydf left 13:08 cpan-raku joined, cpan-raku left, cpan-raku joined 13:13 vrurg left 13:17 vrurg joined 13:44 yangzq50 left 13:55 markoong left, markong joined 14:08 _jrjsmrtn joined 14:10 __jrjsmrtn__ left 14:13 holyghost left 14:21 sena_kun joined 14:22 vrurg left 14:23 vrurg joined, Altai-man_ left 14:27 vrurg left 14:28 kktt007 left, kktt007 joined
gfldex lolibloggedalittle: gfldex.wordpress.com/2020/07/18/de...erplating/ 14:29
14:32 kktt007 left, molaf left 14:33 kktt007 joined 14:45 vrurg joined 15:03 poga joined
guifa2 weekly: gfldex.wordpress.com/2020/07/18/de...erplating/ 15:09
notable6 guifa2, Noted! (weekly)
guifa2 gfldex++ I have a hatred of boiler plate
lizmat
.oO( it can never be DRY enough )
15:11
15:17 MilkmanDan left
timotimo is "without much afford" an idiom that i just never knew about? 15:19
lizmat he... no, that should be effort 15:22
or affordance I guess
probably not 15:23
guifa2 lizmat: hear hear! 15:32
guifa2 . o O ( actually, both of us really do seem to be making lots of utility modules to let people stay DRY )
lizmat well, tbh, my work on JSON::Fast was prompted by being annoyed with the slowness of interpreting data from Discogs 15:33
from-jsonning a 10K file is now down to 10msecs :-) 15:34
15:35 MilkmanDan joined 15:37 molaf joined 15:59 OpenZen joined
lizmat m: my %h; 16:01
say "foo" unless %h{"bar"}
say "bar";
camelia ( no output )
evalable6 bar
lizmat m: "my %h; say 'foo' unless %h\{'bar'}\nsay 'bar'".EVAL # a case where } at the end of the line is *not* a ; 16:03
camelia 5===SORRY!5=== Error while compiling /home/camelia/EVAL_0
Strange text after block (missing semicolon or comma?)
at /home/camelia/EVAL_0:2
------> 3my %h; say 'foo' unless %h{'bar'}7⏏5<EOL>
expecting any of:
infix
16:04 Xliff joined
guifa2 do we not have it clear on the docs (I think we just say terminal } is a ; actually)? That } is part of the operator, rather than the block delimiter. 16:19
16:20 Altai-man_ joined 16:23 sena_kun left
timotimo why is now the first time i hear that there's actually a "perlzwiebel" ("pearl onion") 16:42
16:44 vrurg left, vrurg joined 16:46 rbt left 16:47 rbt joined 16:48 vrurg left 16:49 Xliff left
timotimo en.wikipedia.org/wiki/Perl#Perl_on_IRC 16:50
16:51 JJMerelo joined
JJMerelo m: say "First. Second" ~~ m:g/ <?after ^^ | "." \s+> <:Lu>\S+ / 16:54
camelia (「First.」 「Second」)
Geth_ doc: 0d8a0814de | (JJ Merelo)++ | doc/Language/regexes.pod6
Minor corrections according to rakudo/rakudo#3800
16:58
doc: 6eef3622ca | (JJ Merelo)++ | doc/Language/regexes.pod6
Clarifying "lookaround" assertions according ot answers in rakudo/rakudo#3800

Checking item in #2632
linkable6 Link: docs.raku.org/language/regexes
RAKUDO#3800 [open]: github.com/rakudo/rakudo/issues/3800 "Anchors valid in lookarounds": what does it mean. Plus: circumflex in lookaround does not work.
linkable6 DOC#2632 [open]: github.com/Raku/doc/issues/2632 [Hacktoberfest][RFE][big][docs][good first issue][help wanted][new][⚠ Top Priority ⚠] Checklist for 6.d
guifa2 timotimo: really? they're so yummy (especially pickled) 17:03
timotimo apparently also very expensive 17:05
17:08 tejr left 17:10 markoong joined, markong left 17:11 dataangel joined 17:13 tejr joined 17:16 vrurg joined 17:28 JJMerelo left
kawaii Hello, I have the following snippet of code `$member.roles.map({$_.id }).Array ~~ @protected-roles` which is returning a `Seq`, which we then coerce into an array so that I can compare using ~~ to an existing array in memory. but keep getting this error message when using .cache or .Array www.irccloud.com/pastebin/j0VXeEEB/ 17:44
any ideas? :)
17:45 guifa2 left
kawaii attempted to use `any($member.roles.map({ $_.id })) == any(@protected-roles)` as a workaround, but got the same result :) 17:47
18:03 hungryd78 left 18:22 sena_kun joined, vrurg left 18:23 vrurg joined, Altai-man_ left 18:24 guifa2 joined 18:26 guifa2 left 18:27 vrurg left 18:29 wildtrees left 18:30 wildtrees joined 18:41 vrurg joined 18:55 dataangel left 18:56 dataangel joined 18:58 guifa2 joined 18:59 guifa2 left 19:03 sena_kun left
timotimo you don't happen to have a golf of some kind? 19:03
19:05 sena_kun joined, ensamvarg3 left
kawaii timotimo: I... don't think so :( 19:13
timotimo can you do more thorough dumping around the code? 19:14
kawaii timotimo: github.com/myisha/p6-zoe-voteban/b...ban.p6#L34 19:16
anything look suspicious?
19:19 Sgeo joined 19:34 holyghost joined
timotimo what's $member and $user like? 19:34
they aren't anything seq-like at all, yes?
does has-any-permissions go via self.roles or so? 19:35
btw junctions are already distributiing, so you can say any($member.roles).id == any(@protected-roles)
Zero_Dogg Can I type returned hashes from subs? Ie. a sub returns a hash with the keys success and value. Can I do a "returns" declaration that is more specific than "returns Hash" and have raku know more about what it is? Or should that maybe then be its own class instead?
timotimo you can 19:36
that'll be using the role/type parameter syntax like Hash[blah, blubb]
gotta go for a little bit 19:38
Zero_Dogg timotimo: could you point me to where in the docs I can read about that syntax? That was new to me
timotimo docs.raku.org/type/Hash#method_keyof - here's examples of the other syntax where you give a type for the key (or the values) for a "my %blah" declaration 19:40
Zero_Dogg timotimo: ty
timotimo aha
docs.raku.org/language/hashmap
this is a better place to look i bet!
"non-string keys" is one interesting section of that document 19:41
hum, no, that also only shows the "my"-related syntax
docs.raku.org/type/Associative - not really the easiest document to read for a beginner i guess? 19:42
maybe this could be turned into a docs issue on the tracker?
Zero_Dogg probably, but I need to find out how to declare what I want before I can formulate an issue :) 19:43
timotimo m: sub test(--> Int %{Int}) { return my Int %test{Int} }; dd test() 19:46
camelia 5===SORRY!5===
Shape declaration is not yet implemented; please use whitespace if you meant something else
at <tmp>:1
------> 3sub test(--> Int %7⏏5{Int}) { return my Int %test{Int} }; dd
Malformed return value (return constraints o…
19:47 wildtrees left
timotimo m: sub test(--> Hash[Int, Int]) { return my Int %test{Int} }; test() 19:47
camelia ( no output )
timotimo m: sub test(--> Hash[Int, Int]) { return my Int %test{Int} }; dd test()
camelia Hash[Int,Int] %test = (my Int %{Int})
Zero_Dogg nod, but that won't let me declare, say, this method returns a hash with key "success" is Bool, and key "value" is Str. 19:48
19:49 wildtrees joined 19:50 wildtrees left 19:51 wildtrees joined 19:53 wildtrees left 20:00 oneeggeach joined 20:10 oneeggeach left 20:11 oneeggeach joined
timotimo ah, in that case you will want to use a class of your own 20:13
20:14 oneeggea_ joined
Zero_Dogg right, thanks :) 20:15
20:15 kensanata left, oneeggeach left 20:18 oneeggea_ is now known as oneeggeach 20:19 rindolf left 20:21 Altai-man_ joined 20:23 sena_kun left 20:25 kensanata joined
Geth_ ecosystem: gfldex++ created pull request #519:
I renamed the repo on github for META6::bin.
20:43
20:50 rbt left, rbt joined 20:55 Petr37 joined
Petr37 Nice day/night to all )) 20:56
21:15 aborazmeh joined, aborazmeh left, aborazmeh joined, wamba joined 21:16 Petr37_ joined 21:19 Petr37 left 21:38 oneeggeach left 21:43 dolmen joined
codesections I have encountered some surprising (to me) behavior – can anyone tell me if this is intended behavior? Here's the situation: in a file named `my-script.raku`, the following content: 21:46
use lib '.';
use MyMod;
say "Hi from my script";
evalable6 Hi from my script
codesections and then in `MyMod.rakumod`
unit module MyMod;
sub my-sub() { say "Hi from my-sub"};
say "Hi from MyMod";
evalable6 Hi from MyMod
codesections I would expect that to print "hi from my script", make `my-sub` available in `my-script`'s namespace, and *not* print "hi from MyMod" 21:47
Instead, it does print "Hi from MyMod". So I guess the mainline of each used module is run, even without invoking a single function from that module? 21:48
And the same seems to be true with `require` and `need`, right?
(It's not such an issue with `say`, but it's much more of one with `run <rm -rf>`, which seems like it'd work just the same. And, yeah, I know I ought to trust my dependencies *anyway*, but I didn't realize that amount of code would be executed without me explicitly calling any methods/subs. 21:51
(Unless I'm just very confused – always a distinct possibility!) 21:52
21:55 Altai-man_ left
jnthn codesections: Yes, the mainline is run on module load, which can be used to do bits of initialization. Even were it not, folks could still write a custom EXPORT sub to do whatever they wish on symbol import, or an INIT phaser. 21:58
codesections jnthn: Interesting and good to know. I guess I need to be *especially* vigilant in auditing my dependencies! 21:59
And there's no way of bringing a module's symbols into my namespace without running their mainline code? 22:00
22:06 sena_kun joined 22:07 hungrydonkey joined
jnthn No, and as noted, you'd still not win much peace of mind anyway, 'cus an INIT phaser runs at module load time. And anyway, if you installed the module it already had change to run code at compile time, 'cus meta-programming depends on that. 22:08
codesections fair enough. Thanks – I could easily have spent a good deal of time thinking that I just wasn't figuring it out.
22:17 aborazmeh left 22:19 leah2 left 22:21 Altai-man_ joined, aborazmeh joined, aborazmeh left, aborazmeh joined 22:23 sena_kun left 22:24 Petr37_ left 22:25 leah2 joined
timotimo okay so i realize what i really should have made a long time ago is a "seq already in use" analyzer based on, like, the debugserver or something 22:31
is there a backreference to the Seq object from the iterator (or whatever) that has been pulling items from it? 22:32
if there's something like that, a heap dump could give you what you need to know
22:32 vrurg left
jnthn No, only Seq -> Iterator 22:33
timotimo otherwise the debugger will have to have a breakpoint everywhere that may be relevant, and track involved objects and store their stack traces and such
ah, seq -> iterator points at the iterator that the seq will pull from when it is asked to spit out its values?
m: Seq.new-from-list(1, 2, 3).map(*+1).&dd 22:34
camelia No such method 'new-from-list' for invocant of type 'Seq'
in block <unit> at <tmp> line 1
jnthn Yes
timotimo ah, from-list is only on Supply 22:35
22:35 kensanata left
timotimo m: my $s = (1, 2, 3).Seq; .say for $s; .say for $s.map(*+1); 22:35
camelia (1 2 3)
2
3
4
timotimo m: my $s = (1, 2, 3).Seq; .say for $s.map(* / 2); .say for $s.map(*+1);
camelia 0.5
The iterator of this Seq is already in use/consumed by another Seq
(you might solve this by adding .cache on usages of the Seq, or
by assigning the Seq into an array)
in block <unit> at <tmp> line 1

1
1.5
timotimo ok so this is the situation i guess? 22:36
maybe the only breakpoint the debugger would need is actually the "iterator" method of Seq?
perhaps this is even easy enough to just build with a module
and monkey-patch Seq
how do i replace the iterator method in Seq using augment? :o 22:40
jnthn Just .wrap it instead? 22:43
timotimo ah, right
22:49 wamba left 23:00 xelxebar left, xelxebar joined
timotimo annoyingly, Seq's iterator method is apparently used inside of call_with_capture or something 23:09
a simple recursion check doesn't seem to be enough 23:11
23:12 xelxebar left, xelxebar joined 23:15 dolmen left
timotimo No such method 'push-all' for invocant of type 'ForeignCode' 23:16
incredible :)
holyghost fuck it, doubly defined obj files through bison in my m68k-coff gcc build
oh well
23:20 aborazmeh left
timotimo kawaii: you still there? 23:28
23:29 moony left
holyghost I have an assembler though, so maybe I'm going to port slib from ~gandalf 23:29
kawaii timotimo: yep! 23:32
23:32 moony joined
timotimo gist.github.com/timo/9878a562fe9b8...11e7f74310 <- kawaii check this 23:33
it'd be better if it showed "map" in each instance, too 23:34
maybe all i need is the right offset 23:35
kawaii: i updated the gist with better code 23:37
kawaii 🤔 23:40
timotimo you had a "sequence was already consumed" problem, right?
kawaii Yes 23:41
Sorry brain is afk 23:42
timotimo the code in that gist will give you two backtraces instead of one
23:44 pecastro left
timotimo added one more piece of information that could perhaps be helpful 23:45
hm. if it would also mark where every Seq is created, that could also be helpful 23:49
also expensive and more typing work and i'm tired :) 23:50
but do tell me how it goes 23:52
feel free to pack the wrap call up in a sub somewhere and call it just before the code you're experiencing the problem with 23:53
also, you can use the return value of wrap to unwrap again
kawaii I'll get some coffee and figure out how to use it in an hour or so, thanks timotimo :)
timotimo oh, easy. put it anywhere where it gets run before your problem happens, and presto! 23:54
23:58 molaf left