🦋 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.
SmokeMachine It’s a memorizes dom module, it can help to write html and interact with it on the browser 00:00
fco.github.io/MemoizedDOM/todo6.html
(This is a old test using webperl6, I don’t know if it would be faster currently) 00:01
oddp timotimo: why doesn't this work when you can use something like .reduce(&[+]) just fine?
m: say <1 2 3 4>.rotor(2 => -1).map(&[-])
camelia (0 2)
00:02 sena_kun joined
SmokeMachine [Coke]: the API is not finalised, but it was cool to play with that 00:04
00:04 Altai-man_ left
[Coke] Ok. the lack of readme is daunting. 00:04
I will add it to my research list. thanks
SmokeMachine github.com/FCO/MemoizedDOM/tree/ma...mples/todo 00:05
timotimo oddp: you want &[R-] at least
cpan-raku New module released to CPAN! Text::Diff (1.0.4) by 03RBT
oddp m: say <1 2 5 10>.rotor(2 => -1).map(&[R-]) 00:06
camelia (2 2 2)
oddp ok?
timotimo huh that's not quite it 00:07
SmokeMachine (Last comment, I promise) this is how you do the app: github.com/FCO/MemoizedDOM/blob/ma...do/App.pm6
timotimo i assume it's giving you a two-item list on both sides of the - there
m: say <1 2 5 10 20 50 100>.rotor(3 => -2).map(&[R-]) 00:08
camelia (3 3 3 3 3)
timotimo m: say <1 2 5 10 20 50 100>.rotor(4 => -3).map(&[R-])
camelia (4 4 4 4)
timotimo yeah it's only about the size of list you put out of the rotor
SmokeMachine m: say <1 2 5 10>.map: &[R-] 00:09
camelia (1 2 5 10)
SmokeMachine m: <1 2 5 10>.map: &[-] 00:14
camelia ( no output )
SmokeMachine m: say <1 2 5 10>.map: &[-]
camelia (-1 -5)
oddp That one seems to eat two list elements, right?
SmokeMachine Yes 00:15
oddp Hm, guess I'll defer from using this syntax sugar till I get the hang of it. A bit unintuitive coming from ruby. 00:16
SmokeMachine m: say <1 2 5 10 20>.map: -> $a, $b = 0 { $b - $a } 00:17
camelia (1 5 -20)
SmokeMachine oddp: it goes 2 by 2 because the function I’ve passed to map accepts 2 parameters 00:21
00:21 wamba left 00:26 zz-z joined
oddp Too late over here, maybe it will all make sense tomorrow morning. Thanks for your time and patience. 00:28
00:29 faiface left 00:40 zz-z left 00:44 lainon left 01:07 stoned75 joined 01:41 moony joined, moony is now known as Guest42671 01:44 Guest42671 left 01:49 probablymoony joined 01:53 vike joined 01:57 probablymoony is now known as moony 02:00 molaf left 02:01 Altai-man_ joined 02:03 rbt left 02:04 rbt joined, sena_kun left 02:05 Manifest0 joined 02:12 molaf joined 02:22 hungrydonkey left, hungrydonkey joined 02:25 Cabanossi left 02:37 Cabanossi joined 03:04 softmoth joined 04:02 sena_kun joined 04:04 Altai-man_ left 04:09 xinming_ left 04:10 xinming_ joined 04:47 rindolf joined 04:58 team\andinus joined 04:59 skids left 05:05 OpenZen joined 05:16 OpenZen left 05:18 team\andinus is now known as notandinus 05:25 zacts joined 05:34 bocaneri joined 05:44 wamba joined 05:48 vike left 05:54 softmoth left 05:57 brtastic joined 05:58 sarna joined 06:01 Altai-man_ joined 06:04 sena_kun left 06:06 rbt left 06:07 rbt joined 06:10 vike joined 06:16 wamba left 06:58 JJMerelo joined 07:03 finanalyst joined 07:13 dolmen joined 07:22 pecastro joined, rindolf left 07:35 dyske joined, dyske left 07:39 wamba joined 07:43 aborazmeh joined, aborazmeh left, aborazmeh joined, dakkar joined 07:49 Cabanossi left, satori__ joined 07:50 reach_satori_ left 07:51 kensanata joined 07:52 aborazmeh left 07:59 Cabanossi joined 08:03 sena_kun joined 08:04 Altai-man_ left 08:06 dolmen left 08:08 dolmen joined 08:11 abraxxa joined 08:16 abraxxa left, abraxxa joined 08:54 JJMerelo left 08:56 finanalyst left 09:02 epony joined 09:06 dolmen left 09:07 rindolf joined 09:17 dolmen joined 09:21 dolmen left 09:23 dolmen joined 09:25 notandinus left 09:28 team\andinus joined 09:29 team\andinus is now known as notandinus 09:30 lichtkind joined 09:31 oddp joined 09:32 hungrydonkey left, hungrydonkey joined 09:43 JJMerelo joined 09:57 nosqrt joined 10:02 Black_Ribbon left, Altai-man_ joined 10:04 sena_kun left 10:10 rindolf left 10:11 kensanata left 10:14 molaf left 10:18 epony left 10:24 thundergnat joined
thundergnat m: say <1 2 5 10 20>.rotor(2=>-1).flat.map: * R- * 10:24
camelia (1 3 5 10)
thundergnat You were all _so_ close. 10:25
10:44 zacts left, zacts joined 11:02 squashable6 joined 11:11 thundergnat left 11:44 dolmen left 11:49 dolmen joined 11:52 cpan-raku left 11:53 cpan-raku joined, cpan-raku left, cpan-raku joined 11:56 kensanata joined 12:03 sena_kun joined 12:04 Altai-man_ left 12:44 |oLa| joined
cpan-raku New module released to CPAN! Gnome::Cairo (0.1.0.1) by 03MARTIMM 12:45
New module released to CPAN! Gnome::Gdk3 (0.16.0) by 03MARTIMM 12:53
12:57 skids joined 12:59 AlexDani` left, rindolf joined 13:04 JJMerelo left 13:31 dolmen left 13:41 skids left 13:45 skids joined 13:47 wamba left 13:51 dolmen joined 13:55 wamba joined 14:01 Altai-man_ joined 14:03 zacts left 14:04 sena_kun left 14:07 sarna left 14:12 rbt left 14:13 rbt joined 14:20 kensanata left, stoned75 left, brtastic left 14:21 rindolf left, stoned75 joined 14:22 rindolf joined
cpan-raku New module released to CPAN! Gnome::Gtk3 (0.28.6) by 03MARTIMM 14:38
14:45 AlexDani` joined, dolmen left, AlexDani` is now known as AlexDaniel 14:46 AlexDaniel left, AlexDaniel joined 14:55 finanalyst joined 15:00 dudzHat joined 15:05 MilkmanDan joined 15:09 dogbert17 left, spacebat2 joined, jargan joined 15:10 vike1 joined, Kaeipi joined 15:12 sftp_ joined 15:13 dustinm`_ joined, skyl4rk_ joined 15:14 elcaro_ joined, jargan is now known as jast, skyl4rk_ is now known as skyl4rk, aindilis` joined, [Coke]_ joined, [Coke]_ left, [Coke]_ joined, sftp_ is now known as sftp, dogbert17 joined, vike left, notandinus left, lnx joined, eseyman joined 15:15 pecastro left, finanalyst left 15:16 notandinus joined 15:17 pecastro joined, synthmeat joined, sjm_uk joined 15:18 finanalyst joined 15:19 k-man joined 15:22 orinthe joined, aindilis` left 15:23 aindilis joined 15:25 MilkmanDan left 15:27 Ekho joined 15:32 OpenZen joined 15:37 |oLa| left 15:43 kensanata joined 15:49 nebuchadnezzar joined
Geth doc: 093cbb3ec2 | (JJ Merelo)++ | doc/Language/control.pod6
Some minor reformatting.
15:55
linkable6 Link: docs.raku.org/language/control
15:56 rbt left, molaf joined 15:57 MilkmanDan joined 16:03 sena_kun joined
Geth doc: bedfefdd21 | (JJ Merelo)++ | doc/Language/control.pod6
Additional minor corrections.
16:03
linkable6 Link: docs.raku.org/language/control
16:04 Altai-man_ left 16:19 codesections joined 16:20 JJMerelo joined
JJMerelo Well, I just broke the documentation 16:20
Trying to fix it back.
It might be due to latest changes in Documentable, but I am not so sure
reverting to an old version of Documentable to generate it 16:21
codesections I kind of like that look. Very clean 16:22
16:23 kensanata left
JJMerelo Yep, that's the thing 16:24
I mean, the content is the same, but all the old CSS and JS are totally lost 16:25
There have been lots of changes in documentable lately, and I just moved to a new laptop, so I installed the new version. I'm reverting to generating it with the old version
Fortunately, every version of raku installed with rakudobrew keeps its own version of everything, so we should be good I guess
Generating the new (old) pages now, should take only a few minutes 16:26
codesections Makes sense. I'm just expressing admiration for how well it degrades, without (external) CSS
JJMerelo I'm going to save also this version to a repo, so that we can always get the old look back when we want.
codesections maybe we should add a toggle... 16:27
well, old crufty version is back 16:28
Replica of this version saved to rakudocs.github.io/ 16:30
16:30 [Sno] left 16:32 sno joined 16:42 molaf left 17:00 dakkar left 17:10 softmoth joined 17:17 nosqrt left
Geth ¦ problem-solving: landyacht assigned to jnthn Issue Exponentiation with Rat or FatRat exponent results in Num github.com/Raku/problem-solving/issues/209 17:21
17:28 dolmen joined 17:29 holyghost joined 17:30 holyghost left, holyghost joined
Geth ¦ problem-solving: lizmat unassigned from jnthn Issue Exponentiation with Rat or FatRat exponent results in Num github.com/Raku/problem-solving/issues/209 17:30
17:40 patrickb joined
Geth doc: 10f8491990 | Antonio++ (committed using GitHub Web editor) | assets/doc-generation.json
fix: update config file, refs Raku/Documentable#63
17:45
17:46 JJMerelo left 17:49 Cabanossi left 17:59 Cabanossi joined 18:02 Altai-man_ joined, hungrydonkey left, dolmen left 18:05 sena_kun left 18:26 bocaneri left 18:47 epony joined 18:52 Black_Ribbon joined 18:56 Merfont joined 18:57 kensanata joined, Kaeipi left 19:08 dolmen joined 19:12 molaf joined 19:19 veesh_ joined 19:20 veesh_ is now known as veesh 19:28 finanalyst left 19:29 MasterDuke joined 19:30 [Coke]_ is now known as [Coke]
codesections This is very much a beginner question, but do I need to do something (beyond installing Rakudo Star) to install/use the documentation? I see the source for the docs has been installed to ~/rakudo/install/share/perl6/site/doc, but I don't see any way to interact with those docs. In particular, I thought I'd be able to see something in the REPL with an expression like `&say.WHY`, but I don't get 19:42
anything with that. Do I have something set up wrong or am I just confused about what to expect?
19:48 Benett left, Benett joined
codesections Ok, partly answering my own question: after reading the FAQ more carefully, I realize that I needed to be using p6doc to interact with the documentation locally (I'd tried `raku --doc` and checked the `raku -h` output, but had somehow missed the existence of `p6doc`) 19:53
But that still leaves me confused about the second half of my question: should I be able to see documentation for items in the REPL? 19:55
I'm currently getting messages like
No documentation available for type 'Sub'.
Perhaps it can be found at docs.raku.org/type/Sub
which *suggests* (to me) that I may not have something installed correctly… 19:56
hmm, maybe I should try on here. Let's see… 19:58
raku: &say.WHY
evalable6
codesections raku: say &say.WHY 19:59
evalable6 No documentation available for type 'Sub'.
Perhaps it can be found at docs.raku.org/type/Sub
»
codesections hmm, same message I get locally
20:01 aborazmeh joined, aborazmeh left, aborazmeh joined 20:02 sena_kun joined 20:05 Altai-man_ left
lizmat codesections: the .WHY functions sadly do not work on built-ins 20:06
long story cut short: during development, it was a. too much in flux, and b. hindering the development cycle as it would at least double compilation time (this was in the Parrot days) 20:07
since then, no effort has been made to remedy this, other than what you saw with the "perhaps it can be found" message
for most built-in types, the link is actually correct 20:08
codesections Ok, thanks – very informative! So what do they work on? From the docs, I thought I could add .WHY help strings to my own sub by adding a comment above it with #|, but couldn't get that to work. 20:09
lizmat are you trying things in the REPL ? 20:10
20:11 abraxxa left
codesections Well, I tried both in the REPL and by sending an Emacs buffer to the REPL via raku-mode 20:11
lizmat #| foobar 20:12
sub zip() { }
say &zip.WHY;
evalable6 No documentation available for type 'Sub+{is-pure}+{Precedence}'.
Perhaps it can be found at docs.raku.org/type/Sub+{is-pure}+{Precedence}
»
lizmat works for me
20:14 abraxxa joined
codesections when you say that it works for you, you get output with `foobar` when running those statements in the REPL? I am getting a message similar to the one from evalable6 20:16
lizmat yes, that's what I was saying: it should say "foobar" 20:17
because that is the .WHY text associated with the sub
20:18 dolmen left
codesections That is what I thought. I wonder why I and evalable6 are both getting an error instead 20:18
lizmat evalable6 only does line at at time, and loses knowledge of the previous lines 20:19
*one
codesections Hmm, that seems to be the case for the REPL version I'm using as well (both when I paste the three lines in together and when I send the full buffer from Emacs). I get the expected output when I save those lines to a file and execute them as a standalone script 20:21
20:25 rindolf left
lizmat yeah, the REPL and the bots only know of one line at the time, really 20:26
although the REPL tries to fake it, but fails in a lot of cases
this being one of them I guess
codesections Fair enough. And I guess Emacs' raku-mode is still sending the text as lines to the REPL, and runs into the same limitations 20:28
lizmat probably, dunno, /me uses vim
if it would be smart enough to write it to a temp file, and then run that, it should work 20:29
codesections Fair enough. Maybe I'll switch back one of these days :)
lizmat :) 20:30
codesections While you're being so helpful, a (semi) related question: is there a way to have Raku print a human readable representation of a `sub`? 20:32
raku: sub add1($i) { $i + 1 }; say &add1.raku; 20:34
evalable6 sub add1 ($i) { #`(Sub|94400420871152) ... }
codesections I was looking for a textual version of the sub in place of that hash 20:35
lizmat alas, no
jnthn's RakuAST work might make that possible
20:35 dudzHat is now known as dudz, dudz left, dudz joined
moritz keeping all that around after compilation would still be a huge waste of memory 20:35
lizmat moritz: not necessaryily: could be a single int value with an offset and a length in it, that would index into the source 20:36
codesections moritz, I hadn't really thought though the technical details – I just remember that being a feature of the JavaScript REPL, and it's one I miss a bit 20:40
20:51 aborazmeh left
timotimo iirc we currently don't ship the core setting source into the installation folder 20:52
in typical javascript VMs the functions are actually stored as javascript source in the installation, except for some "[native function]" functions?
because i guess javascript parses ridiculously quickly?
21:00 MasterDuke left
lizmat I've been toying with the idea of having a module in lib with all of the docs of core functionality, that could be loaded on demand by .WHY and the have it produce the right doc 21:14
21:32 aborazmeh joined, aborazmeh left, aborazmeh joined 21:38 rbt joined 21:39 wamba left 21:40 cpan-raku left 21:41 cpan-raku joined, cpan-raku left, cpan-raku joined 21:42 kensanata left 21:49 Cabanossi left 21:53 Cabanossi joined 21:56 lichtkind left 21:57 [Coke] left 22:01 Altai-man_ joined 22:05 sena_kun left 22:11 rbt left 22:12 rbt joined 22:16 finanalyst joined 22:26 rindolf joined 22:34 [Coke] joined
[Coke] returns from his brief power outage 22:35
wind must have knocked something down somewhere.
22:37 squashable6 left 22:41 squashable6 joined 22:42 aborazmeh left 23:07 rindolf left 23:12 patrickb left
timotimo knock knock 23:12
sjn who's there? 23:16
23:18 hungrydonkey joined
timotimo it's me, i don't know how knock knock jokes work 23:19
23:30 AlexDaniel left 23:34 finanalyst left 23:35 pecastro left
codesections Following up on our earlier discussion of how Raku can't currently print the source of a built-in function, I decided to write a helper function that would print the source. I'm sure this isn't super robust (did I mention that I'm just now discovering Raku) but I expect I'll find it helpful in testing things out in the REPL. I'll paste it here, in case anyone else is interested. 23:40
sub src($sub) {
my ($sub-name, $path) = ($sub.gist.substr(1), $sub.file);
$path ~~ s|'SETTING::'|/home/{$*USER}/rakudo/rakudo/|;
my $sources = (slurp $path) ~~ m:g/^^<([\w||\h]*?"$sub-name".*?\{.*?\})>/;
my $c = 1;
"&$sub-name defined {$sources.elems} times:\n\nDefintion #1:\n"
~ $sources.reduce({$^a ~ "\n\nDefintion #{ ++$c }:\n" ~ $^b})
}
23:51 AlexDaniel joined, AlexDaniel left, AlexDaniel joined