🦋 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.
aruniecrisps so the reason i asked if you guys tried other languages is that my friend and i were talking about Raku, i'm currently interviewing and for the time being I'm going to be building a lot of stuff in Raku and posting it to my github page, and my friend basically said if you're gonna be talking about Raku I'd have to have a couple of selling points on Raku @librasteve 02:59
I'm running into a problem with this code: use v6.d; sub MAIN(Int :$port) { say "Start of LSP"; my $listen = IO::Socket::INET.new( :listen, :localhost<localhost>, :localport($port)); my $fh = "lsp-log.txt".IO.open: :a; $fh.print: "Start of LSP at port $port\n"; loop { my $conn = $listen.accept; try { 05:44
while my $buf = $conn.recv { "lsp-log.txt".IO.spurt: $buf; # $fh.put: "Request received\n"; # $fh.put: $buf; } } $conn.close; CATCH { default { "lsp-error.txt".IO.spurt: $_.payload } } } $fh.close; }
see whenever I run this, the problem is that the "lsp-log.txt".IO.spurt: $buf; works more consistently then the $fn.put commands below. for whatever reason, whether i use netcat to send messages to this server while it's running i'm not able to get $buf or "Request received" to consistently write to the file 05:46
and i've been wracking my brain trying to solve this 05:47
if anyone has any ideas as to what might be going on that would be great!
antononcube weekly: rakuforprediction.wordpress.com/20...interview/ 05:56
notable6 antononcube, Noted! (weekly)
HeikkiL I am running Rakudo™ v2024.01 and get an error message that I think is an error. 09:00
Define a subroutine: sub htest (Hash %h) {say %h};
Create a hash: my %first; 09:01
Call: htest %first;
Error: Type check failed in binding to parameter '%h'; expected Associative[Hash] but got Hash ({})
How could the subroutine expect 'Associative[Hash]'?
gfldex HeikkiL: You are asking for a Hash of Hash. `%h` is a type check of against the role Associative, which a Hash satisfies. 09:20
A Hash of Hash is to narrow of a type to pass that test.
m: sub foo(Hash %h) { dd %h; }; my Hash %h; foo(%h); 09:22
camelia Hash %h = (my Hash %)
HeikkiL OK. Thanks everyone. This turned out to be a newby question. Looks like I have to read more about passing arguments to subroutines in raku! 09:31
ab5tract HeikkiL It’s actually less about argument passing specifically than it is about how type declarations intersect with container types 14:11
m: my Str %h = %( :x(“y”) ); dd %h 14:16
camelia Str %h = (my Str % = :x("y"))
ab5tract m: my Str %h = %( :x ) 14:17
camelia Type check failed for an element of %h; expected Str but got Bool (Bool::True)
in block <unit> at <tmp> line 1
Geth Raku-Steering-Council/main: 57e17f10d9 | (Elizabeth Mattijsen)++ | minutes/20240210.md
Add RSC meeting minutes for 2024-02-10
17:28
Geth ecosystem/main: a07f7957b7 | (Elizabeth Mattijsen)++ | META.list
Remove JSON::Hjson

It now lives in the zef ecosystem
17:40
tbrowder__ hi, i have a new module in work using multiple sub run calls in a single test file. the test works fine 17:52
bscan @aruniecrisps, if you're still dealing with this, I asked ChatGPT. It suggested adding $fh.flush; I tested it and that fix worked for me. chat.openai.com/share/1ee4bed7-6d9...71845065e5
tbrowder__ pls disredard my issue, running mi6 with the verbose option did the trick 17:53
lizmat And yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2024/02/12/2024-07-dr-raku/ 19:35