🦋 Welcome to the former MAIN() IRC channel of the Raku Programming Language (raku.org). This channel has moved to Libera (irc.libera.chat #raku)
Set by lizmat on 23 May 2021.
japhb Is there a module already for an ordered hash (in the sense that iterating over it will return keys/values/pairs in exactly the order they were inserted)? I see lizmat has Map::Ordered but not Hash::Ordered, FCO has an OrderedHash but it seems to care about either sorting or specifying the order of keys (rather than depending on insertion order), and there appear to be lots of modules in the Hash::* 02:26
namespace, but none look like a match for what I'm looking for.
(Unless of course I just missed it.) 02:28
patrickb polettix_: Did you notice www.reddit.com/r/rakulang/comments...?context=3 09:59
tellable6 hey patrickb, you have a message: gist.github.com/8503b4fd5eae8e2cd0...26d550c237
CIAvash m: say .chars == .comb.unique given 'abcd' 10:00
camelia True
patrickb polettix_: I fear I have tried leaving that comment in *three* different ways, only to not be seen and you finding out about object construction separately. Grrr. I'm grumpy on Disqus now. 10:01
SmokeMachine sorry, yesterday I said `Model.WHAT` meaning `Model.HOW` 11:44
rassoc m: "a1b2\nc3\nd4e5".lines.comb(/\d/) 11:50
camelia ( no output )
rassoc m: "a1b2\nc3\nd4e5".lines.comb(/\d/).say 11:51
camelia (1 2 3 4 5)
rassoc oh, interesting comb behaviour; never knew that
lizmat you're combing for numeric characters... or is that not what you meant ? 11:52
rassoc that it considers multiple elements, separate lines in this case. usually incorporated a map of some kind while processing lines
SmokeMachine m: say <a1 b2 c3>.comb: /\d+/ 11:54
camelia (1 2 3)
SmokeMachine m: say <0a1 b2 3c4>.comb: /\d+/
camelia (0 1 2 3 4)
gfldex m: "a1b2\nc3\nd4e5".lines».comb(/\d/) 12:01
camelia ( no output )
gfldex m: "a1b2\nc3\nd4e5".lines».comb(/\d/).say
camelia ((1 2) (3) (4 5))
gfldex rassoc: .comb coerces to Str
lizmat rassoc: what gfldex says, so you would get the same result without the .lines 12:02
lizmat m: "a1b2\nc3\nd4e5".comb(/\d/) 12:02
camelia ( no output )
lizmat m: "a1b2\nc3\nd4e5".comb(/\d/).say 12:03
camelia (1 2 3 4 5)
lizmat m: "a1b2\nc3\nd4e5".lines>>.comb(/\d/).say
camelia ((1 2) (3) (4 5))
rassoc i do realize that now, but it never occurred to me before that i could utilize it in such a way 12:11
gfldex: recently, i ran into a situation where i deadlocked the scheduler by .receiving on various interdependent channels. stumbled upon one of your blog posts on await and it really saved me. the docs mention that it utilizes .receive internally, but the impl is actually using .polling and supplies. so, thanks a bunch for your frequent blogging! 12:31
cnx <CIAvash "m: say .chars == .comb.unique gi"> I'm aware of this, but I'm still curious of a regex solution (apologies to IRC people for the quote) 13:27
rassoc regex solution for what? verifying that a str has no repeated chars? 13:44
m: say "abc" !~~ /(.).*$0/
camelia True
rassoc m: say "abca" !~~ /(.).*$0/
camelia False
cnx is it possible for a possive match? 13:49
e.g. of only 4 to 20 unique alphanumerics 13:50
rassoc cnx: in a single regex? not quite sure what you are trying to do. is this what you are after? 14:10
m: my &small-uniq = { !/(.) .* $0/ ?& /<alpha> ** 4..20/ }; "abc".&small-uniq.say; "abcd".&small-uniq.say; "abcdd".&small-uniq.say;
camelia False
True
False
cnx yes, in a single regex, I'm just wondering if it's possible to forbid duplication using capture groups 14:16
Eddward m: say "test" 14:16
camelia test
Eddward m: my $y = -> $n { say "hi $n" } ; $y(3)
camelia hi 3
hi 3 14:17
Eddward m: my $y = -> $n { say "hi $n" } ; for 1..5 $y
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3my $y = -> $n { say "hi $n" } ; for 1..57⏏5 $y
expecting any of:
block or pointy block
infix
infix stopper
Eddward m: my $y = -> $n { say "hi $n" } ; $y.perl 14:18
camelia ( no output )
Eddward m: my $y = -> $n { say "hi $n" } ; $y.raku
camelia ( no output )
Eddward m: my $y = -> $n { say "hi $n" } ; say $y.perl 14:19
camelia -> $n { #`(Block|91879296) ... }
melezhik . 14:24
. 14:25
Eddward sub x($n) { say "hi $n" } ; for 1..5 &x 14:34
sub x($n) { say "hi $n" } ; &x.perl.say 14:35
evalable6 sub x ($n) { #`(Sub|94922466683104) ... }
Eddward my $x = ->($n) { say "hi $n" } ; $x.perl.say
evalable6 -> $ ($n) { #`(Block|94632884115120) ... }
Eddward my $x = -> $n { say "hi $n" } ; $x.perl.say 14:36
evalable6 -> $n { #`(Block|93854853147912) ... }
Eddward my $x = -> $n { say "hi $n" } ; for 1..5 { $x($_) } 14:37
evalable6 hi 1
hi 2
hi 3
hi 4
hi 5
Eddward my $x = -> $n { say "hi $n" } ; for 1..5 $x 14:38
m: my $x = -> $n { say "hi $n" } ; for 1..5 $x
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3my $x = -> $n { say "hi $n" } ; for 1..57⏏5 $x
expecting any of:
block or pointy block
infix
infix stopper
Eddward ¯\_(ツ)_/¯ 14:39
rassoc m: my &x = -> $n { say "hi $n" }; .&x for 1..5 # Eddward 14:45
camelia hi 1
hi 2
hi 3
hi 4
hi 5
Eddward rassoc: Thanks. I was inspired by an article that I didn't think did what it thought it did. 14:47
jcoterhals.medium.com/what-not-to-...94121ab30c 14:48
I thought `A($_) for ^3` was the same as `for ^3 { A($_) }` 14:49
lizmat Eddward: it has the same effect, but the for ^3 { } case has an extra level of indirection 14:50
Eddward right 14:51
m6locks can has more exercises in exercism.io/my/tracks/raku ? 15:57
rassoc m6locks: you can try theweeklychallenge.org/challenges/ or adventofcode.com/ while waiting for some more content on exercism 16:19
rassoc latter has a collection of solutions for comparison here: github.com/codesections/advent-of-raku-2020 16:20
perlmaros hi, i'm running a raku application in a systemd unit and no ~/.raku/precomp files are being written. whenever i start it manually/directly via shell they are created. any suggestions what might be needed to coerce rakudo into creating these files? 16:50
perlmaros strace shows that it looks for these files, but it does not try to create them 16:52
moritz permission problems, maybe? 17:37
systemd unit files have an option to disable access to home directories, IIRC
ugexe note just because it looks and doesn't find them there doesn't mean it didnt find them somewhere else 17:38
m: say $*REPO.repo-chain.map(*.?prefix).grep(*.so).map(*.absolute) 17:39
camelia (/home/camelia/.raku /home/camelia/rakudo-m-inst-1/share/perl6/site /home/camelia/rakudo-m-inst-1/share/perl6/vendor /home/camelia/rakudo-m-inst-1/share/perl6/core)
ugexe run your script with `RAKUDO_MODULE_DEBUG=1` and you'll get some more details 17:40
perlmaros not sure if i can get anything helpful from RAKUDO_MODULE_DEBUG=1 ... it just prints where it tries to load the precomp files from, but it doesn't say anything about where/when/if it tries to write them 19:20
lizmat it should say something like "Precompiled /foo/bar into /foo/baz" 19:25
and "Writing dependencies and byte code to foo for source checksum: 765372657362
raydiak permissions and env vars are common stumbling blocks I've read about wrt systemd units. unix.stackexchange.com/a/339645 gives a good list of various differences between running from a shell and running from systemd. also if you're running selinux/apparmor, make sure that's not causing an issue 19:59
Geth problem-solving/clarify-readme: e43a7a59a4 | (Daniel Sockwell)++ (committed using GitHub Web editor) | README.md
clarify PS process in README

This is an attempted solution to #272 as described in that issue. In particular, it is intended to clarify the existing process without adding any substantive changes.
21:56
problem-solving: codesections++ created pull request #289:
Clarify Problem Solving process description in README
21:57
Raycat|Home Howdy. Two questions: How do I create a subset of a fixed array containing a particular class? I wanna do `subset Board of Array[Square] where .elems > 9;` but this doesn't work. 22:42
Hmm. I've forgotten the second question. So, just the one then. 22:43
guifa lizmat: are you still working on a redo of the sequence operator mechanics? (I seem to recall that being in your long list of todos) 23:19