🦋 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 still being worked out
Set by lizmat on 12 August 2021.
00:12 jast joined 01:12 committable6 left, coverable6 left, bloatable6 left, nativecallable6 left, unicodable6 left, linkable6 left, releasable6 left, sourceable6 left, shareable6 left, statisfiable6 left, quotable6 left, bisectable6 left, greppable6 left, squashable6 left, notable6 left, tellable6 left, evalable6 left, benchable6 left 01:13 committable6 joined, greppable6 joined, benchable6 joined, linkable6 joined, quotable6 joined 01:14 sourceable6 joined, bloatable6 joined, statisfiable6 joined 01:15 nativecallable6 joined 01:29 mjgardner joined 01:30 swaggboi left 01:40 swaggboi joined 01:53 neshpion left 01:54 neshpion joined 02:12 notable6 joined 02:13 bisectable6 joined, unicodable6 joined, shareable6 joined
vrurg greppable6: Cache::Async 02:16
greppable6 vrurg, 40 lines, 1 module: gist.github.com/bdeaaa12b890556adf...1d36de3fef
vrurg So, unless it's used in private projects... 02:17
03:13 linkable6 left, tellable6 joined 03:14 squashable6 joined, linkable6 joined 03:15 releasable6 joined 04:02 neshpion left 04:03 neshpion joined 05:03 bloatable6 left, squashable6 left, unicodable6 left, tellable6 left, nativecallable6 left, sourceable6 left, greppable6 left, statisfiable6 left, releasable6 left, committable6 left, quotable6 left, benchable6 left, notable6 left, bisectable6 left, shareable6 left, linkable6 left 05:04 releasable6 joined 05:05 bisectable6 joined, shareable6 joined 05:15 evalable6 joined 05:29 neshpion left 06:03 quotable6 joined 06:04 linkable6 joined, committable6 joined, benchable6 joined 06:05 squashable6 joined, sourceable6 joined, tellable6 joined, notable6 joined 06:06 statisfiable6 joined 07:04 greppable6 joined 07:05 nativecallable6 joined 07:15 coverable6 joined 07:46 kylese joined 08:00 squashable6 left 08:02 reportable6 joined 08:05 bloatable6 joined 08:06 xinming left 09:04 unicodable6 joined
Geth flycheck-raku: eca94662ac | (Siavash Askari Nasr)++ | flycheck-raku.el
Add project root to include path, instead of `lib` directory
flycheck-raku: 50ac228e65 | (Siavash Askari Nasr)++ | flycheck-raku.el
Bump version to 0.6
10:00 lizmat left, TempIRCLogger left 10:03 Sgeo left 10:12 wanko joined, lizmat joined
wanko hi, I was wondering, does raku support multi-parameter typeclasses? I checked docs.raku.org/language/haskell-to-...ypeclasses but well "TODO" 10:13
10:15 TempIRCLogger joined
lizmat you mean something like Rational[Int,Int] ? 10:15
moritz my knowledge of haskell is pretty rusty and incomplete, but I think roles are the closes thing in raku 10:16
and those can be parameterized
though in general, my feeling is that if you want to super-strong typing (a la haskell), raku is going to disappoint you
wanko oh, I think I see, thanks both of you. so Rational takes 2 parameters and by doing class Positive does Rational[UInt] you basically supply Positive as the second argument, right? 10:21
10:22 keutoi joined
moritz not quite 10:22
Rational wants two parameters, so trying to write Rational[UInt] is an error
(ok, Rational has a default, iirc, so it's not actually an error, but if there was no default...) 10:23
(just to be clear, a Rational in raku is a fraction of two integers) 10:24
wanko I think I get it now, thank you! 10:28
SmokeMachine_ Hi you all! I have a question: Match objects has submaches that you can access as $match<submatch>, isn’t it an Associative way of accessing/storing it? So, wouldn’t it make sense to Match “does” Associative? 10:51
m: say Match ~~ Associative 10:54
camelia False
11:00 squashable6 joined 11:42 frost-lab joined
moritz SmokeMachine_: Match used to be Associative when I was last very active in raku land, so it has changed since then 11:54
maybe because Associative has certain expectations of what happens if you call .list, which clash with the expectations of the Positional aspects
likewise with .keys, .pairs etc
12:03 reportable6 left
andinus` ,ping 12:12
12:12 andinus` left 12:13 andinus joined
andinus m: put "ping" 12:13
camelia ping
12:34 Xliff joined
SmokeMachine_ moritz: thanks! But Mach does have .keys, .pairs, etc like Associative, doesn’t it? 12:43
m: say (“bla ” ~~ /<ws>/).keys 12:44
camelia (ws)
SmokeMachine_ m: say (“bla ” ~~ /<ws>/).pairs
camelia (ws => 「」)
SmokeMachine_ m: say (“bla ” ~~ /<ws>/).kv 12:45
camelia (ws 「」)
SmokeMachine_ m: say (“bla ” ~~ /<ws>/).antipairs
camelia (「」 => ws)
andinus i 'm writing something to parse call logs, i was thinking of an interactive program that displays charts/graphs for each number if the user chooses it 12:47
should i try ncurses or is there a better way to do this? 12:48
13:04 reportable6 joined
Xliff replit.com/@Xliff/GiantChocolateSp...#main.raku 13:21
Why the differing results between the two grammars?
andinus: Yes, you can use curses, or a GUI lib. Raku does have GTK bindings. 13:31
If you want simple plotting, there is SVG::Plot, but that is for generating SVGs, not displaying them. 13:32
andinus which GUI lib is recommended? i haven't wroked with any before 13:43
i was thinking of using curses to provide menu based interface and generating plots with svg::plot and displaying them with feh 13:44
14:04 linkable6 left, evalable6 left 14:17 tejr left 14:19 tejr joined 15:08 ens joined 15:27 dogbert11 joined
Xliff If I have an arbitrary prefix string, that may change. How can I use a regular expression to match any character up to that string? 15:28
15:29 dogbert17 left
moritz .*? <?before $string< 15:34
.*? <?before $string>
Xliff moritz++!
Is there a way to do that where "$string" is a scalar or an array? Or is that what you meant by "$string"? 15:37
Moritz: So something like this seems to work: replit.com/@Xliff/GiantChocolateSp...#main.raku 15:44
Working version of reusable parser: replit.com/@Xliff/GiantChocolateSp...#main.raku 15:51
moritz: Thanks AGAIN!
15:54 frost-lab left 15:58 frost-lab joined, frost-lab left 16:01 keutoi left 16:02 keutoi joined 16:06 linkable6 joined
Juerd I love that I can just use ½ * tau * ($d/2)² 16:39
cnx m: put τ 16:43
camelia 6.283185307179586
17:06 dogbert11 left 17:09 keutoi left 17:10 keutoi joined 17:24 dogbert11 joined 17:30 dogbert17 joined, dogbert11 left 17:32 keutoi left 17:35 dogbert17 left 17:43 dogbert17 joined 18:02 reportable6 left 18:04 reportable6 joined 18:06 Shaeto joined
Shaeto hmm, can't download the latest community commaide, mac os link is broken... and no information how to contact authors 18:09
moon-child ping jnthnwrthngtn 18:22
nine moon-child: on vacation 18:23
moon-child right 18:24
18:35 kylese left 18:51 tejr left 18:52 kawaii_ left 18:54 pjlsergeant left 18:55 mjgardner left, zostay left 18:56 PotatoGim left, tejr joined 18:57 mjgardner joined 18:59 patterner_ left, patterner_ joined 19:00 tbrowder left, tejr left 19:01 tbrowder joined, tejr joined 19:02 PotatoGim joined 19:06 zostay joined 19:11 pjlsergeant joined 19:12 Shaeto left 19:13 Shaeto joined 19:14 kawaii_ joined 19:15 xinming joined
MasterDuke Altai-man and timo are also involved with comma development 19:16
Altai-man thinks what to do 19:18
Shaeto, hi. Alas, it's a known problem, for the time being it's not possible to build an OSX build for the latest version. Tomorrow I'll update the link to download 7.0 instead, I guess. It goes with some unfortunate bugs, so I am not sure what's the best way to proceed. 19:21
Shaeto Altai-man: thank you! 19:22
Altai-man I can ship the buggy 7.0 for OSX or we can wait some days until it'll be possible to ship 7.1 properly.
Shaeto stable 7.1 is more interesting :) 19:23
Xliff m: my $a = Seq(1, 2, 3); $a.^name.say; $a.elems.say; $a.gist.say 19:31
camelia Seq
(1 2 3)
Xliff m: my $a = Seq(1, 2, 3); $a.^name.say; $a.elems.say; $a.gist.say; $a.gist.say
camelia Seq
(1 2 3)
(1 2 3)
Xliff m: my $a = Seq(1, 2, 3); $a.^name.say; $a.elems.say; .say for $a; .say for $a 19:32
camelia Seq
(1 2 3)
(1 2 3)
Xliff m: my $a = Seq(1, 2, 3); $a.^name.say; $a.elems.say; $a.^name.say; .say for $a; .say for $a
camelia Seq
(1 2 3)
(1 2 3)
Xliff Why isn't that Seq complaining about it being used up?
moon-child Seq is an Iterable, not an Iterator 19:34
19:37 Sgeo joined 19:45 neshpion joined 19:53 mattil joined
mjgardner Can someone explain `first` and smartmatch (`~~`) to me? I’m trying to use them in the attached script that uses Perl’s WWW::Mechanize, and although I can do a regular `eq` in `first` I can’t see how to check against a list (`$rss_types` in the example). www.irccloud.com/pastebin/lmQ7jGHc 19:57
19:58 juanfra__ joined
lizmat m: dd "a" ~~ <a b c d> # mjgardner smartmatch won't work that way 20:00
camelia Bool::False
lizmat m: dd "a" (elem) <a b c d> # mjgardner perhaps this will?
camelia Bool::True
20:00 clarjon1 left
[Coke] docs.raku.org/routine/ACCEPTS - this shows what smartmatch does with a list, btw. 20:01
20:01 Shaeto left
[Coke] elem should work, an explicit junction should work ~~ any($rss_types) 20:01
mjgardner lizmat: (elem) works 🙂 20:02
[Coke]: `say $alt_links.first(*.attrs<type> ~~ any($rss_types)).url;` gets me a compiler error: Function "any" may not be called without arguments (please use () or whitespace to denote arguments, or &any to refer to the function as a noun, or use .any if you meant to call it as a method on $_) 20:05
But (elem) works so I’ll go with that. 20:06
[Coke] try 'eq' instead of ~~ there.
mjgardner Nope, that gets me Nil. 20:08
MasterDuke what if you give $rss_types a `@` sigil? 20:11
m: my $a = <a b ab abc d>; say "abc" ~~ any($a); my @b = <a b ab abc d>; say "abc" ~~ any(@b) 20:12
camelia False
[Coke] Apologies for the bad advice, always trust lizmat. :) 20:14
mjgardner MasterDuke: That only works if I do `.first( {$_.attrs<type> ~~ any(@rss_types) } )`, but that’s a bit noisier than lizmat’s (elem), so I’m going with the latter. 20:18
MasterDuke sure. elem going to be faster anyway, just showing how it could/would work 20:20
mjgardner Thanks for the help all. 20:23
20:24 mattil left 20:32 codesections joined 20:33 Xliff left 20:41 dogbert11 joined, dogbert17 left 20:46 dogbert17 joined 20:49 Xliff joined, dogbert11 left 20:55 dogbert17 left, dogbert17 joined 21:00 dogbert17 left 21:18 clarjon1 joined
japhb andinus: There's some rough stuff in github.com/japhb/Terminal-QuickCharts, but that's more for making a CLI output a chart, than to have live charts going in a TUI app. There's also github.com/ab5tract/Terminal-Print which is relatively low level. (It has the underlying code to do animatable widgets, but it has NO widget library. Just the low-level bits.) 21:22
22:07 evalable6 joined 22:20 dogbert17 joined 23:20 reportable6 left, statisfiable6 left, notable6 left, squashable6 left, benchable6 left, evalable6 left, bloatable6 left, coverable6 left, quotable6 left, sourceable6 left, greppable6 left, nativecallable6 left, tellable6 left, unicodable6 left, bisectable6 left, shareable6 left, releasable6 left, linkable6 left, committable6 left, evalable6 joined, sourceable6 joined 23:21 unicodable6 joined, tellable6 joined 23:22 nativecallable6 joined, bloatable6 joined, statisfiable6 joined 23:23 benchable6 joined, coverable6 joined, notable6 joined