🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel! Set by lizmat on 6 September 2022. |
|||
00:17
Manifest0 left
01:23
hulk joined,
kylese left
02:00
discord-raku-bot left,
discord-raku-bot joined
02:15
hulk left,
kylese joined
02:35
DarthGandalf left
04:11
[Coke] left
04:14
[Coke] joined
05:30
Sgeo left
05:31
thaewrapt left
05:44
thaewrapt joined
06:09
jpn joined,
thaewrapt left
06:21
jpn left,
thaewrapt joined
06:41
thaewrapt left
06:52
thaewrapt joined
06:53
jpn joined
06:57
thaewrapt left
07:05
jpn left
07:09
thaewrapt joined
07:14
thaewrapt left
07:22
thaewrapt joined
07:33
jpn joined
07:34
thaewrapt left
07:39
sena_kun joined
07:43
jpn left
07:47
thaewrapt joined
07:52
thaewrapt left
08:01
dakkar joined
08:02
DarthGandalf joined
08:03
thaewrapt joined
08:09
thaewrapt left
08:11
tirnanog joined
08:21
thaewrapt joined
08:27
jpn joined
08:31
bdju left
08:33
thaewrapt left
08:44
thaewrapt joined
08:49
thaewrapt left
08:50
jpn left
08:55
jpn joined
08:58
bdju joined
09:01
thaewrapt joined
09:06
thaewrapt left
09:17
thaewrapt joined
09:18
sena_kun left
09:29
thaewrapt left
09:41
thaewrapt joined
09:47
thaewrapt left
09:49
thaewrapt joined
11:24
jpn left
11:27
jpn joined
11:40
jpn left
12:14
drewjose left
12:42
perlbot left,
simcop2387 left,
jpn joined
12:44
MasterDuke left
13:21
tirnanog left
13:27
jpn left
13:35
ceux_ is now known as ceux
13:37
simcop2387 joined
13:39
perlbot joined
13:42
jpn joined
14:57
El_Che left,
El_Che joined
|
|||
[Coke] | is there a way to create a shortcut for editing in vim? (e.g. if I'm on a word, I want to insert a C< before the word and a > after, without caring what the word is - I know I can redo the last edit, but that typically turns into two edits if I do it manually) | 15:16 | |
ab5tract | [Coke]: I *think* that's the general use case for vim macros, but I haven't done much with them myself | 15:17 | |
[Coke] | ab5tract: thanks, that's enough for me to google what I need. Wish I had done this 500 edits ago. :) | 15:20 | |
15:23
jpn left
15:29
soverysour joined
|
|||
Voldenet | [Coke]: vim-surround, point on the word, type in `ysiw>iC` and you're done | 15:50 | |
[Coke] | ... that's harder than doing it manually, for me. | 15:51 | |
Voldenet | then | 15:53 | |
type in `qxysiw>iCq` | |||
afterwards @x | |||
erm | 15:54 | ||
`qxysiw>iC{esc}q` | |||
[Coke] | ... This is not helping. :) | ||
Voldenet | :> | ||
@x will replay the macro recorded by qx{anything}q | 15:55 | ||
vim-surround is here github.com/tpope/vim-surround?tab=...stallation | 15:56 | ||
once you set up macros, it's almost as nice as emacs | 15:57 | ||
[Coke] | vim-surround++ | 16:00 | |
Voldenet: ok, was able to grok that and create a saved macro called @c that now does wraps a word in C<>. Thank you! | 16:04 | ||
Voldenet | happy to help | ||
[Coke] | now to make it work on Foo::Bar also. :) | 16:05 | |
ab5tract | [Coke]: `vE` should extend a selection across all of Foo::Bar | 16:06 | |
ah, sorry, just caught up on the convo :) | |||
[Coke] | I'm not sure which of Voldenet's macro suggestion would be replaced with vE | 16:07 | |
ab5tract | yeah, I don't know anything about vim-surround, but with a bare macro I would expect `vE` to work | ||
but I've heard good things about vim-surround, so maybe that's a better bet | 16:08 | ||
[Coke] | Might have to do this without vim-surround, but having this work for even 1/3 of my cases is a time saver. | ||
Voldenet | [Coke]: ysiW>iC | 16:12 | |
(WORD is delimited by ws, word is delimited by anything non-wordy) | 16:14 | ||
`BiC<{esc}Ea>` would do similar thing | 16:17 | ||
16:36
dakkar left
|
|||
lizmat | And yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2024/05/20/2024-...ry-primed/ | 16:36 | |
[Coke] | Voldenet++ | 16:37 | |
huh. found some pod that didn't complain but is weird: C<thing|other thing> - for a L<> the | is special, but for C<> it's just a literal. | 16:39 | ||
lizmat | seems to parse ok in RakuAST | 16:40 | |
[Coke] | Yup - it's fine, just found two doc snippets like C<Foo|/type/Foo> which weren't setting off any author test alarms. | 16:41 | |
lizmat | ah.. ok :-) | 16:42 | |
[Coke] | Glad I happened to see them (searched, didn't find any others) | ||
Voldenet: so W is too aggressive for me. | |||
it works on the Foo::Bar cases, but L<Foo::bar|/type/Foo::Bar>, where I want L<C<Foo::Bar>|/type/Foo::Bar>, I instead get C<L<Foo::Bar|/type/Foo:Bar>> | 16:44 | ||
so I might need to do it manually. By the time I sort this out, I will be mostly done with this exercise, though. the 'w' version gets me 90% of the way there. | |||
Voldenet | I like that currying -> priming change, makes me realize that currying can be added too | 17:08 | |
m: sub curry($fn, *@a) { my @args; sub inner-call(*@n) { @args.push(|@n); $fn.arity > @args ?? &inner-call !! $fn(|@args) }; inner-call(@a) }; curry( -> $a, $b, $c { say "$a $b $c" }, 1)(2, 3) | 17:15 | ||
camelia | 1 2 3 | ||
17:17
jpn joined
17:39
jpn left
|
|||
[Coke] | codesections++ | 17:39 | |
17:44
jpn joined
18:06
jpn left
18:18
sena_kun joined
18:52
jpn joined
18:54
sadome joined,
sadome left
18:57
jpn left
19:12
jpn joined
19:19
jpn left
19:25
jpn joined
19:54
jpn left
|
|||
ab5tract | Voldenet: that's a cool example! | 20:11 | |
20:16
jpn joined
20:20
soverysour left
20:21
jpn left
|
|||
antononcube | I assume some special (new) rakudo version is needed for Voldenet's example to work? | 20:36 | |
lizmat | bisectable6: old=2023.01 sub curry($fn, *@a) { my @args; sub inner-call(*@n) { @args.push(|@n); $fn.arity > @args ?? &inner-call !! $fn(|@args) }; inner-call(@a) }; curry( -> $a, $b, $c { say "$a $b $c" }, 1)(2, 3) | 20:42 | |
bisectable6 | lizmat, Cannot find revision “2023.01” (did you mean “2024.01”?) | ||
lizmat | bisectable6: old=2023.02 sub curry($fn, *@a) { my @args; sub inner-call(*@n) { @args.push(|@n); $fn.arity > @args ?? &inner-call !! $fn(|@args) }; inner-call(@a) }; curry( -> $a, $b, $c { say "$a $b $c" }, 1)(2, 3) | ||
bisectable6 | lizmat, On both starting points (old=2023.02 new=cf87ccf) the exit code is 0 and the output is identical as well | ||
lizmat, Output on both points: «1 2 3» | |||
lizmat | antononcube seems to work for quite a while already :-) | ||
antononcube | @lizmat Ok, good to know. (Cannot make in VS Code + notebook.) | 20:44 | |
21:13
jpn joined
|
|||
[Coke] | Voldenet: given C<FOO>, how can I wrap that to get L<C<FOO>|/type/FOO> with a macro? :) | 21:52 | |
22:12
jpn left
22:13
Sgeo joined,
Xliff joined
|
|||
Xliff | \o | 22:13 | |
Does anyone know if there are Raku source definitions for SourceView or GEdit? | 22:14 | ||
lucs | [Coke]: Between the pointies in C<Foo>, do you expect to have only alpha characters? | 22:24 | |
[Coke] | lucs: could be :'s also | 22:28 | |
C<IO::Path>, e.g. | |||
but even one that just did alpha would get me a huge time savings | |||
lucs | And that should expand to L<C<IO::Path>|/type/IO::Path> ? | 22:29 | |
Have this in your vimrc, or enter it on the ex command line ( :... ): | 22:35 | ||
:let @r = "F<lvf>hyf>a|/type/\<esc>pa>\<esc>F<\<esc>hiL<\<esc>2f>" | |||
Now in command mode, when your cursor is between the pointies, pressing @r will do what you want. | 22:36 | ||
22:36
sena_kun left
|
|||
lucs | You can see how it works by pressing those keys interactively: F< moves back to the opening < , l moves right one space, v begins highlight mode, etc. | 22:38 | |
And it works with any characters between the pointies (well, except other pointies, eh). | 22:39 | ||
(I said "Now in command mode...", I meant "normal" mode.) | 22:40 | ||
[Coke] | lucs++! | 22:42 | |
I also just accidentally found that @@ is repeat last macro, apparently | |||
lucs | Oh, I'd forgotten about that one :) | 22:43 | |
[Coke] | Voldenet, lucs, thanks so much! | 22:45 | |
lucs | You're very welcome. | ||
23:03
jpn joined
23:09
jpn left
|