🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
lizmat $ raku -v 10:10
Welcome to Rakudo™ v2021.12.
El_Che++
El_Che lizmat: I should cloudsmith make to pay me. With every new release they add the needed distro because I ping them 10:15
:)
they lacked ubuntu jammy (next stable) so the upload of ubuntu-devel packages failed
lizmat I see... 10:16
El_Che lizmat: I had to do a weird workaround, though:
# Workaround for github.com/rakudo/rakudo/issues/1515
mkdir -p $INSTALL_ROOT/share/perl6/site/short $INSTALL_ROOT/share/perl6/vendor/short
touch $INSTALL_ROOT/share/perl6/site/short/.keep $INSTALL_ROOT/share/perl6/vendor/short/.keep
the packager I use does not handle empty dirs well in debs
and for one reason or the other rakudo started supplying 2 empty dirs a few releases ago 10:17
lizmat have you made an issue for this particular issue ? 10:18
El_Che yeah, it's in the paste
lizmat the empty dirs issue ? 10:20
El_Che yes
lizmat nxadm commented 16 seconds ago 10:21
yeah, now :-)
El_Che no, no, that's how I worked around it, not the issue itself 10:22
frost m: combinations 16, 8 13:23
camelia ( no output )
frost m:say  combinations 16, 8
evalable6 ((0 1 2 3 4 5 6 7) (0 1 2 3 4 5 6 8) (0 1 2 3 4…
frost, Full output: gist.github.com/1628858848b1f3b570...f069d42427
frost m:say  (combinations 16, 8).elems
evalable6 12870
frost hello all, is there a more direct way to find C(m, n) in Raku? 13:24
s/find/compute/ 13:25
ugexe im not sure how much more direct it could be 13:31
frost just like a function 13:36
frost I choose to define a operator to calculate it which is a easy way in Raku 13:41
holyghost C(n,k) = n! * (n-k)! / k! with a factorial function ! ? 13:45
Which does not exist in raku I presume 13:48
lizmat m: sub postfix:<!>(Int $n) { [*] 1..$n }; say 5! # voila 14:11
camelia 120
thundergnat m: sub binomial { [×] ($^n … 0) Z/ 1 .. $^p }; say binomial 16, 8; 14:33
camelia 12870
thundergnat frost ^^^ 14:34
frost Thank you! thundergnat 14:57
thundergnat Welcome
Anton Antonov Do you know are the icons (the content) in this repository used in any packages, internet writings, or presentations? github.com/MadcapJake/metamorphosis 15:34
Altai-man well, the original Camelia of course, but don't know about others. They look super cool though. 15:39
there are also those: github.com/Raku/marketing/tree/mas...Os/Camelia
Anton Antonov @Altai-man Thanks for the links! I am writing about connecting Mathematica and Raku. For the Raku-mode cells in Mathematica I use the stylized icon raw.githubusercontent.com/uzluisf/...-logo1.png . (Rotated 30 degrees.) But I wanted to refer to more "generic" and well know source of Raku icons. 15:48
Altai-man for the docs website I used this: raku-infra-fsn1-01.rakulang.site:10...loured.png and IMO it looks 1)recognizable; 2)more stylish, the original is somewhere in the marketing repo. 15:50
I like the hex icon you're using now a lot too, IMO that's an example of an icon one can show to people outside of community without them making faces. 15:51
Anton Antonov I tried to use a smaller version that icon to indicate Raku cells, but that icon has too many details. 15:52
Altai-man hmm, how small do you need it to be?
in Comma we use 13x13, which is fairly small, and it works kinda alright. 15:53
Anton Antonov @Altai-man Yes -- thank you for that feedback!
There is a question of how well it fits with the icons of other language cells in Mathematica. I will post example within 2 min. 15:54
Here is an example of Raku and other languages cells in a Mathematica notebook: imgur.com/NvT40r0 16:04
Altai-man hmm, I don't see anything criminal, but maybe it can be resized better, now it looks blurry. 16:07
Anton Antonov Yeah, it does, I have to tweak the Mathematica code for those cells some more. I think the icons used by WRI are from vectorized drawings (not images.) 16:09
WRI == Wolfram Research, Inc. (Makers of Mathematica)
BTW, as background cell color I used background color in the input/output cells in the documentation. (E.g. here: docs.raku.org/language/objects .) 16:12
lucs m: 'x' ~~ Any && print "Why does this match?" 16:17
camelia Why does this match?
Altai-man lucs, because 'x' is Str and Str is Any. 16:18
maybe you meant this:
m: 'x' ~~ Any:U && print "Why does this wait you don't see me..."
camelia ( no output )
Altai-man ? 16:19
lucs Hmm... I'll think it over, thanks.
Altai-man say: 'x'.^mro.say
oops
m: 'x'.^mro.say
camelia ((Str) (Cool) (Any) (Mu))
Altai-man so it is an instance of Str, Cool, Any and Mu.
lucs The context I'm seeing the "problem" is different, but your explanation should help me figure out what to do. 16:20
Altai-man lucs, what do you want to do in the first place? 16:21
lucs Let me beef up my example...
Altai-man if you need an exact type check you can use =:= I think.
m: say Any =:= Any; say 'x' =:= Any;
camelia True
False
lucs Turns out I'm calling a function that returns an array, and I want to see if some element appears in that array. 16:26
But the returned array can look like (Any), and 'foo' ~~ @A matches in that case (which I don't want).
E
sorry
'foo' ~~ any @A
lucs (edited) But the returned array can look like (Any), and 'foo' ~~ any @A matches in that case (which I don't want). 16:27
At least now I understand what's going on :)
Altai-man is the function yours? 16:28
lucs No :(
Altai-man if you can change it, why not return Empty... ah, I see
hmm
Altai-man maybe you want `'foo' (elem) @what-returned`? 16:29
lucs Oh, good idea.
Yeah, that works fine. 16:30
Thanks!
Altai-man it's probably cheaper (?), but in any case it's less weird than using ~~ for membership check.
yw
lucs "Weird" is in the eye of the more experienced developer ;) 16:31
Altai-man perhaps
lucs The TIMTOWTDI can sometimes be misleading, ey. 16:32
*eh
Altai-man I mean, it's more specific and being more specific is good IMO.
lucs Oh, I totally agree.
Altai-man m: say 1 ~~ [1, 2, 3]
camelia False
Altai-man it doesn't work the usual way and then you need to do tricks with junctions 16:33
but junctions are tricky
lucs I'd just forgotten about (elem) and tried something I vaguely thought would work.
Altai-man yup
lucs It's good to screw up like that once in a while (not too often!), it can become a learning experience. 16:34
ugexe @A.grep(*.defined).any 16:37
oops missed a bunch of scrollback 16:38
El_Che cool, we may end up with a rakudo star maintainer 16:54
rba El_Che: Who is the rakudo star maintainer? 18:04
El_Che today, no one 18:05
rba: github.com/rakudo/rakudo.org/pull/75
rba El_Che: Thanks, just saw it. 18:09
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2021/12/27/2021-...-released/ 18:37
Anton Antonov @lizmat Thanks for mentioning "Doing it like Cro"! 18:43
lizmat Anton Antonov: you're welcome 18:44
will you still publish your blog post somewhere ?
Anton Antonov @lizmat Yes. So far is on GitHub only (version 0.9), but I plan to publish in my WordPress site "RakuForPrediction" tomorrow. (rakuforprediction.wordpress.com) 18:47
lizmat ++Anton Antonov 18:52
Anton Antonov @lizmat I also plan to make FOSDEM22 proposal submission this week. 18:55
lizmat well, please do before Friday, not sure how FOSDEM interpretes 31 December as a deadline :-) 18:56
spacekookie I have a question about grammars (I'm pretty new to raku still so pls easy explanation :p) but why does my say line not print a hash with the two keys I provided? paste.rs/c7I.pl 19:23
spacekookie It prints "(Any)" 19:25
leah2 so, the problem is TOP doesnt match due to the whitespace 19:30
ugexe because it should be e.g. `token TOP { <keyword> \s <payload> }`
leah2 and then you want LineGrammar.parse(...).made 19:31
Anton Antonov @lizmant Will do -- thanks!
[Coke] sees "find element in returned list" and didn't see 'grep' suggested. huh 20:00
Anton Antonov Is there named regexes for `\v` or `\n` ? (Like `<space>` for `\s`.) 20:08
Or, probably it is more correctly to say ask: is there a predefined character class for vertical whitespaces? 20:11
[Coke] \v 20:21
docs.raku.org/language/regexes#\v_and_\V
(Started on that page and searched for "vertical") 20:22
Anton Antonov @Coke Yes, am I aware of `\v` -- I am asking is there a predefined character class say `<vspace>`. 20:24
I did not find such character class in docs.raku.org/language/regexes#Pre...er_classes
spacekookie leah2: oh thanks! 21:33
okay i'm confused again. I'm trying to replicate the example in the "Action Objects" section and a bit confused by the message I get paste.rs/siB The error: No such method 'made' for invocant of type 'Array'. (in the TOP method) 21:56
moritz_ `$<statement>` is an array because <statement> is inside a quantifier 22:06
so you'd need something like method TOP($/) { make $/<statement>.map: *.made } 22:07
spacekookie hmmm 22:12
spacekookie I guess that makes sense. Although now the way my `method statement` works seems wrong 22:13
(everything is nil >.>) 22:14
gfldex .oO( Don't be so Nilhilistic! ) 22:44
spacekookie Okay I don't really understand what I changed but this line: my %foo = Keyword => $<keyword>.made, Payload => $<payload>.made; outputs "{Keyword => (Any), Payload => (Any)}" 22:51
Which feels like step in the right direction? But not sure why it's (Any) and not the actual tokens that those roles match
I'm very out of my depth here x) 22:52