🦋 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.
00:07 reportable6 left 00:08 monkey_ joined 00:21 lichtkind_ left 00:26 tellable6 joined 00:27 statisfiable6 joined 00:54 finanalyst left 01:08 reportable6 joined 01:18 frost joined 01:24 committable6 joined 01:35 monkey_ left 02:11 Voldenet_ joined 02:12 Voldenet left, Voldenet_ is now known as Voldenet 02:54 monkey_ joined 03:12 Voldenet_ joined 03:13 Voldenet left, Voldenet_ is now known as Voldenet 03:37 monkey_ left 03:43 monkey_ joined 04:25 monkey_ left 05:25 reportable6 left, evalable6 left, linkable6 left, bloatable6 left, coverable6 left, nativecallable6 left, statisfiable6 left, notable6 left, sourceable6 left, shareable6 left, bisectable6 left, tellable6 left, releasable6 left, greppable6 left, committable6 left, benchable6 left, quotable6 left, squashable6 left, unicodable6 left 05:27 unicodable6 joined, bisectable6 joined, evalable6 joined, linkable6 joined, benchable6 joined 05:28 tellable6 joined, nativecallable6 joined, reportable6 joined, statisfiable6 joined 06:07 reportable6 left 06:27 quotable6 joined, squashable6 joined 06:28 coverable6 joined 06:53 TheAthlete joined 07:09 reportable6 joined 07:23 seednode left 07:24 seednode joined 07:26 notable6 joined, releasable6 joined 07:28 sourceable6 joined, shareable6 joined 08:17 Sgeo left 08:27 bloatable6 joined 08:36 synthmeat joined 09:36 linkable6 left, evalable6 left 09:37 linkable6 joined, Skarsnik joined 09:55 holyghost joined
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
10:27 committable6 joined 11:27 linkable6 left, unicodable6 left, committable6 left, bisectable6 left, bloatable6 left, reportable6 left, shareable6 left, nativecallable6 left, tellable6 left, sourceable6 left, releasable6 left, notable6 left, quotable6 left, coverable6 left, benchable6 left, statisfiable6 left, nativecallable6 joined, shareable6 joined, notable6 joined, bloatable6 joined 11:28 greppable6 joined 11:29 reportable6 joined, benchable6 joined, bisectable6 joined, unicodable6 joined, linkable6 joined 11:37 Skarsnik left 11:59 jjido joined 12:07 reportable6 left 12:10 reportable6 joined 12:28 releasable6 joined 12:29 quotable6 joined, tellable6 joined 12:37 evalable6 joined 13:16 Altai-man joined
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
13:28 coverable6 joined 13:29 committable6 joined 13:30 sourceable6 joined
ugexe im not sure how much more direct it could be 13:31
frost just like a function 13:36
13:40 tejr left, tejr joined
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
14:33 thundergnat joined
thundergnat m: sub binomial { [×] ($^n … 0) Z/ 1 .. $^p }; say binomial 16, 8; 14:33
camelia 12870
thundergnat frost ^^^ 14:34
14:36 monkey_ joined 14:40 monkey_ left 14:41 monkey_ joined 14:50 Sgeo joined
frost Thank you! thundergnat 14:57
thundergnat Welcome
15:09 monkey_ left 15:10 frost left 15:12 monkey_ joined 15:20 tejr left 15:21 tejr joined 15:30 morte_ joined
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
15:40 MoC joined 15:43 morte_ left 15:46 patrickb joined
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
16:01 patrickb left
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
16:08 holyghost left
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
16:15 monkey_ left
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
16:26 monkey_ joined
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
16:29 statisfiable6 joined
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
16:34 monkey_ left
ugexe @A.grep(*.defined).any 16:37
oops missed a bunch of scrollback 16:38
16:42 avuserow left 16:49 MoC left
El_Che cool, we may end up with a rakudo star maintainer 16:54
16:56 morte_ joined 17:07 Sgeo left 17:18 discord-raku-bot left, discord-raku-bot joined 17:34 xinming left 17:41 Sgeo joined 17:50 Altai-man left
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
18:08 reportable6 left
rba El_Che: Thanks, just saw it. 18:09
18:10 reportable6 joined 18:26 Sgeo_ joined 18:28 Sgeo left 18:34 TheAthlete left 18:35 TheAthlete joined
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 ?
18:45 discord-raku-bot left, discord-raku-bot joined
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
19:03 mathias[m] left 19:05 mmat joined 19:06 m_athias joined
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
19:24 jjido left
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!
19:37 TheAthlete left 19:45 bd3i joined
[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
20:17 Skarsnik joined
[Coke] \v 20:21
docs.raku.org/language/regexes#\v_and_\V
(Started on that page and searched for "vertical") 20:22
20:23 merryprog is now known as perryprog
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
20:28 Colt left, Colt joined 20:30 Colt left 20:34 mmat left 20:44 morte_ left 20:45 morte_ joined 21:13 linkable6 left
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
22:13 evalable6 left
spacekookie I guess that makes sense. Although now the way my `method statement` works seems wrong 22:13
(everything is nil >.>) 22:14
22:15 jjido joined 22:24 thundergnat left
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
23:14 linkable6 joined 23:19 Skarsnik left 23:46 jjido left