🦋 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.
Util m: { my @s = 1..2; for 1 { @s Z+= 5..6; }; say @s; } 05:33
camelia [6 8]
Util m: { my @s = 1..2; for 1 -> $j { @s Z+= 5..6; $++ }; say @s; }
camelia [6 8]
Util m: { my @s = 1..2; for 1 -> $j { @s Z+= 5..6; }; say @s; }
camelia [1 2]
Util [6 8] is the expected output. [1 2] is wrong. 05:34
Why would the effect of the Z+= operation be changed by the combination of binding the loop variable and not having a second line of code in the loop?
librasteve m: my @s = 1..2; do { @s Z+= 5..6; }; say @s; 09:17
evalable6 [6 8]
Raku eval [6 8]
librasteve Util: it's a bug
suggest you file a bug report
SmokeMachine lizmat: thanks for your suggestion on Configuration! 11:15
lizmat you're welcome!
SmokeMachine I agree that will be better to do that that way than needing to create an EXPORT function... 11:16
lizmat yeah, it wasn't until I was creating Slangify that I realized you can export an EXPORT sub 11:17
SmokeMachine I have played with something like that when discussing about this module (raku.land/zef:elcaro/Exportable#addendum (not my module))... but I hadn't realised Configuration could be beneficed by that until you mentioned... thank you 11:22
is there any other suggestion? My intention there was to have ide completitions on configuration files... but I wasn't able to do that... it seems Comma will not autocomplete attributes/methods from the class I'm exporting... :( any idea? 11:25
lizmat work on Comma when it is open sourced ?
:-)
SmokeMachine lizmat: Thats a good suggestion... but I don't think I'll have time for that... :( 11:26
and I'm more inclined to write Raku on my free time than Java (Comma is written in java, right?) 11:27
lizmat I understand it's a mix of many things
SmokeMachine and current I think I'm going to spend some time on Configuration and on App::RakuCron... 11:28
and even not autocompleting, et least giving errors when calling wrong methods seem to be good enough for now... 11:29
*at
tbrowder__ m: use Test; class A { has UInt $.etype:}; my $o = A.new: :etype(100); is $o.etype, 100; 13:25
camelia ===SORRY!=== Error while compiling <tmp>
Unexpected closing bracket
at <tmp>:1
------> use Test; class A { has UInt $.etype:⏏}; my $o = A.new: :etype(100); is $o.ety
tbrowder__ m: use Test; class A { has UInt $.e }; my $o = A.new: :e(100); is $e, 100 13:28
camelia ===SORRY!=== Error while compiling <tmp>
Variable '$e' is not declared. Perhaps you forgot a 'sub' if this was
intended to be part of a signature?
at <tmp>:1
------> UInt $.e }; my $o = A.new: :e(100); is ⏏$e, 100
tbrowder__ m: use Test; class A { has UInt $.e }; my $o = A.new: :e(100); is $o.e, 100; 13:32
camelia ok 1 -
ugexe SmokeMachine: I use VSCode + Raku Navigator extension (marketplace.visualstudio.com/items...navigator) which does some of what you want 18:03
it doesn't work well for doing core work though - it gets confused at how to resolve the core files and whatnot 18:04
aruniecrisps @SmokeMachine I'm currently working on a tree-sitter implementation which you can kind of think of as just the syntax highlighting part of it: github.com/arunvickram/tree-sitter-raku. I also wanna see what I can do with raku-navigator 18:21
leont SmokeMachine: that Exportable looks useful 19:27
SmokeMachine leont: I agree! Just to make it clear: that module is not mine. 19:29
ugexe: I have tested Raku Navigator with neovim... 19:30
SmokeMachine aruniecrisps: that's interesting... 19:32
antononcube @ugexe I am using @bscan 's plugin to VS Code a lot via "Jupyter::Chatbook". 19:46
bscan If anyone wants to improve on the Raku Navigator, I'd love pull requests. The Perl version does autocomplete on all imports, and I'm sure we could make it work in Raku as well. 19:59
aruniecrisps @bscan how exactly does the perl version get information for autocomplete on imports? 20:05
bscan For imported modules, it has a list of all modules available on the path and then is able to go-to-definition, display docs, etc. For implicitly imported functions, it's a bit trickier. It compiles the file using perl -c and then inspects the symbol table to see what was populated. 20:07
aruniecrisps Do you have a link to the code that does this? @bscan 20:14
bscan Sure. Here's the Raku version that compiles a file and dumps only the local symbols such as subs and variables (no imports) github.com/bscan/RakuNavigator/blo...gator.raku And here's the perl version that dumps local symbols and all imported functions. The structure is quite different, but similar concept. github.com/bscan/PerlNavigator/blo...uisitor.pm 20:17
aruniecrisps Looking at it I have a vague idea of how to go about it, but I'd have to figure out how to grab the package names and compile them and dump them in the current namespace 20:26
bscan For the Raku version, the script is entirely self-contained. Pipe in code over stdin and then get back a list of as many things as the script can figure out. If you can get package names, functions, or whatever else, let me know. I'm happy to help how I can. 20:31
aruniecrisps So wait if I were to just run cat test.raku > raku navigator.raku it would give me stuff? 20:35
SmokeMachine lizmat: just committed your suggestion, thanks! 20:43
bscan Yes, exactly. All I need is that script to dump out a list of everything in the file, and then the language server sorts through it and exposes it to vscode for goto definition, autocompletion, etc. 22:17
aruniecrisps okay i'm gonna play around with this @bscan 23:18