🦋 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 getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
Od1n method col:sym<quoted> ($/) { make S:g/'""'/'"'/ with ~$/ } 00:12
hello people. 00:13
i just copied docs.raku.org/language/regexes#ind...bstitution
and adapted it for what i think will make my <quoted> by replacing "" by "
"Cannot assign to a readonly variable or a value" 00:14
i don't get it: wasn't ~$/ a new string that is made from $/ ?
Nemokosch what did you copy actually? 00:20
it doesn't scroll there
Od1n say S/o .+ d/new/ with 'old string'; 00:29
evalable6 new string
Od1n I just adapted it, I guess
Nemokosch 😂 00:32
and what exactly went wrong?
oh 00:33
now I see it
Od1n: did it not complain about using $/ as the parameter? 00:35
Od1n well. raku don't want to assign a readonly
Od1n i guess not: i copied it in another variable explicitly. still doesn't work 00:35
Nemokosch I don't know this sym thing but assuming it's basically still a method, this seems like a bad idea 00:36
I mean using a magic variable as your parameter
Od1n <sym> is an alternative for a term in a grammar
when you declare a action class, you have to keep the same name for the rule and the method 00:37
i just want to transform ""hello"" in "hello" 00:40
Od1n i'll write the question on the mailing list 00:48
Nemokosch If you aren't sure about using $/ as a parameter, I'd say don't 00:58
Od1n this also is a copy-paste from the grammar documentation 00:59
Od1n docs.raku.org/language/grammars#in...ry-Actions 01:01
Nemokosch well that's an oof 01:02
Od1n oof ? 01:03
www.urbandictionary.com/define.php?term=oof ? 01:06
Nemokosch xdd 01:07
Od1n (as xml declarative description ?) 01:09
thanks for helping. i'm going to sleep now 01:10
bye everyone
Nemokosch you are funny 01:15
😄
good night
frost hello all. 09:58
when i install a module using zef, i got an error "Type check failed for return value; expected IO::Path but got Any (Any)" 09:59
what does that mean? 10:00
elcaro It sounds like the module you're trying to install is failing one of it's test 10:12
You can tell zef to skip tests, but there's a risk the module won't work properly. 10:13
zef should tell you which module it's testing before the failure occurs
frost Hey, @elcaro, it stops with that error message even not starting to install:( 10:20
El_Che elcaro: what version of raku/zef are you running? I remember zef breakage with a raku change some time ago 10:38
elcaro El_Che: It's not me having the issue, it's frost (or frost#6297 via the discord bot) 10:44
frost: What OS are you on?
and yeah, as El_Che asked... what version of Raku (and zef) are you using? 10:45
tbrowder .tell ugexe zef is noticeably faster now, nice! 10:54
tellable6 tbrowder, I'll pass your message to ugexe
frost El_Che i'm running it on manjaro with linux 5.14 and the zef is from the 2021.10 bin release of linux 10:59
El_Che that's recent, then 11:00
frost It may also be a specific module problem, since I can install other modules successfully 11:01
I'm not going to try any more now, thanks elcaro El_Che 11:02
El_Che np 11:08
tbrowder frost: it might be helpful if the module author knew about your problem 11:56
frost @tbr 12:29
tbrowder thanks, i know why it fails, since there is no META6.json, now I try to add one 12:31
tbrowder frost: you should investigate using App::Mi6 for module creation and maintenance--saves a lot of work 12:32
RaycatWhoDat When making a grammar, what is the correct way to look for delimited block if the delimiters are on separate lines? 12:33
tbrowder lizmat uses it, and i too, and many others
frost tbrowder thank you, but i haven't learn how to make a module, i‘ll try later 12:34
tbrowder okey dokey 12:36
El_Che okey donkey? 13:05
patrickb Do people consider the following a WAT? 13:50
m: try run("nonexisting")
camelia The spawned command 'nonexisting' exited unsuccessfully (exit code: 1, signal: 0)
in block <unit> at <tmp> line 1
13:51
patrickb In contrast to:
m: run("nonexisting").so
camelia ( no output )
tbrowder El_Che: okey dokey, kind of country or southern friendly slang for "okay" 13:54
tbrowder patrickb: pls remind me what does WAT mean 13:59
m: say run("nonexisting").so 14:03
camelia False
tbrowder that's my choice
patrickb WAT means an unexpected behavior that negatively surprises the programmer: "WAT?! That's how it behaves?!?" 14:06
nine Everyone: please reset your local rakudo master branches to the current origin/master. We had a confusion in the repository that required a force push. Sorry for the inconvenience! 14:14
CIAvash patrickb: github.com/rakudo/rakudo/issues/1590 14:59
patrickb CIAvash: That's not optimal. But my point was not about the program not existing, but the `try` being uneffective. 15:01
ugexe the process errors when it gets sunk 15:09
tellable6 2021-11-19T10:54:07Z #raku <tbrowder> ugexe zef is noticeably faster now, nice!
ugexe if you avoid sinking it it wont error 15:10
m: my $a = try run("nonexisting"); say $a.exitcode 15:11
camelia 1
patrickb but then I can leave the try off just as well 15:13
is this an error vs exception thing?
ugexe yep, you'd `try` around whatever would sink it
tbrowder patrickb: thnx for the reminder. i assume it’s WAT instead of WHAT due to raku mop and it’s also comedic and phonetic!
patrickb Ah, so the error (aka a contact bomb) passes through the try untouched as it's not a live exception and then gets sunk which triggers it? 15:14
ugexe yea, although it might be a failure not an exception (i forget) 15:15
patrickb thanks for explaining! 15:16
tbrowder: I guess so.
El_Che tbrowder: don't destruy my silly puns :P 15:51
tbrowder El_Che: sorry, i forgot you're the SNL wannabe :-D 16:11
japhb WAT is from a talk on JavaScript foibles that got rapidly adopted by other programming language communities. 17:22
[Coke] thouoght it was related to knowyourmeme.com/memes/wat 17:48
[Coke] does Audrey have a minister-blog? 18:06
tonyo are you people on windows using the WSL to run raku or compiling directly? 18:10
[Coke] i''m compiing directly 18:17
japhb [Coke]: I'd forgotten, it's JavaScript *and* Ruby: www.destroyallsoftware.com/talks/wat 18:20
Xliff_ Waht determines order of INIT blocks? 19:47
[Coke] m: INIT {say 2}; INIT { say 1}; 19:48
camelia 2
1
[Coke] Guessing it's source order.
(my sample is unhelpful, sorry. ;) 19:51
Xliff_ [Coke]: Kinda hard to determine that when you are using multiple compunits. ;) 19:53
Skarsnik Any idea why raku can't find my module in ./ ? I have a SNES-SLANG.rakumod and when I do raku -I ./ -M SNES-SLANG -e 'some code' it can't find the module :( 19:54
copying it to another dir and doing -I dir work x) 19:57
tbrowder ref WAT: i think [Coke] is on to the truth...
ugexe is there a META6.json in ./ ? 20:00
if so then that module would needed to be listed in it 20:01
Skarsnik hoo 20:02
Since when META6.json is used by something else than zef xD
ugexe rakudo has used it for 5+ years 20:03
its used it in this specific way for ~3 years
Skarsnik maybe should clarify the error message? 20:05
ugexe im pretty sure it tells you exactly what the issue is 20:06
"Please note that a 'META6.json' file was found in '.', of which the 'provides' section was used to determine if a dependency is available or not. Perhaps you need to add 'AdADL' in the <provides> section of that file? Or need to specify a directory that does *not* have a 'META6.json' file?
at -e:1"
ugexe did you read the whole error message? 20:07
Skarsnik skarsnik@DESKTOP-UIA12T1:/mnt/f/Project/QUsb2snes/tests/usb2snes-tests/raku-tests$ raku -v 20:08
This is Rakudo version 2020.08.2 built on MoarVM version 2020.08
This is probably why?
ugexe probably, the newer error message is newish but i thought it was older than that. guess not 20:09
Skarsnik Doing a SLANG is tricky, it's hard to tell if your grammar is called or not :( 20:11
[Coke] Always reminds me of meeting Raku folks in Germany.... got a case of shrinkwrapped stroopwafel today. (nowhere near as good as the fresh stuff) 20:17
Skarsnik I am not sure what is wrong with my slang. gist.github.com/Skarsnik/b6ada1e52...373d8f1e8c using with like raku -M SNES-SLANG -e 'SNES lda $42:sta $69:rtl:;' does not work 20:22
I realise the say "export" does not happen 20:27
[Coke] here it hangs.
Skarsnik let update raku x) 20:29
[Coke] I'm on 2021.10 here 20:32
Skarsnik the first token is probably missing something to not mess up with raku grammar? 20:33
github is sloowww today 20:36
Skarsnik the say in my export sub does not run, I just get a compile error x) 21:04
patrickb m: sub s(List :@l, Str :$a) { }; s(:a(1)); 21:31
camelia Type check failed in binding to parameter '@l'; expected Positional[List] but got Array ([])
in sub s at <tmp> line 1
in block <unit> at <tmp> line 1
patrickb Is this a rakudobug?
japhb patrickb: Are you wanting to say "a Positional that contains a bunch of Lists"? 21:35
(Er, because that's what you are currently saying)
patrickb Actually I think the signature is bogus and should be corrected. But the error is about an optional param I'm not passing...
wait 21:36
positional?
japhb The '@' sigil indicates that a type `does Positional`
[Coke] first has a : so not a positional, I think.
patrickb ah you are refering to the variable, not the signature
japhb [Coke]: It's a named argument whose value is a Positional containing Lists 21:37
patrickb agreed
That is bogus, I agree, but the error it throws is wrong, right? 21:38
japhb I'm guessing the problem is that the default value for an optional Positional is an empty Array
patrickb It should complain that $a is not a string, but instead complains about an optional I didn't pass.
japhb Are you asking if the default should change to be Array[List]?
First argument caused a binding failure, so had already errored. 21:39
patrickb If I turn the `1` into a `"1"` the error goes away.
japhb m: sub s(Str :$a, List :@l) { }; s(:a(1));
camelia Type check failed in binding to parameter '$a'; expected Str but got Int (1)
in sub s at <tmp> line 1
in block <unit> at <tmp> line 1
patrickb m: sub s(List :@l, Str :$a) { }; s(:a("1"));
camelia ( no output )
japhb I think the fact that it complains about the @l binding when the *other* argument doesn't match, but not when it does, is goofy. 21:40
So yeah, there's a bug there I think.
patrickb I'm not convinced that it should be possible to get type missmatch errors for optionals I didn't pass.
japhb patrickb: Since you didn't supply a default for @l, either Raku should intuit the type for the "default default", or it should error. I think you're arguing for the former. 21:41
Er ... am I understanding you correctly? 21:42
patrickb I think you understand correctly.
m: my List @l; dd @l; 21:43
camelia Array[List] @l = Array[List].new()
patrickb default working fine, or is this something different?
japhb m: sub s(List @l?, Str :$a) { }; s(:a("1")); 21:44
camelia ( no output )
japhb m: sub s(List @l?, Str :$a) { dd @l }; s(:a("1"));
camelia Array[List] element = Array[Mu].new()
patrickb m: sub s(List @l?, Str :$a) { }; s(:a(1));
camelia Type check failed in binding to parameter '@l'; expected Positional[List] but got Array ([])
in sub s at <tmp> line 1
in block <unit> at <tmp> line 1
japhb Yeah, I think that's a bug
patrickb rakudobugs
m: sub s(Str :@l, Str :$a) { }; s(:a(1)); 21:54
camelia Type check failed in binding to parameter '@l'; expected Positional[Str] but got Array ([])
in sub s at <tmp> line 1
in block <unit> at <tmp> line 1
patrickb Does it even for the more common Str list.
Kaiepi i can get the correct error to throw locally by modifying &handle_optional in the signature binder to consider the type parameters of @/%s 22:55
let's see what roast thinks...
m: sub s(Str @l?, Str :$a) { }; s(:a(1)) 22:57
camelia Type check failed in binding to parameter '@l'; expected Positional[Str] but got Array ([])
in sub s at <tmp> line 1
in block <unit> at <tmp> line 1
22:58
Kaiepi m: sub s(Str %h?, Str :$a) { }; s(:a(1))
camelia Type check failed in binding to parameter '%h'; expected Associative[Str] but got Hash ({})
in sub s at <tmp> line 1
in block <unit> at <tmp> line 1
Kaiepi m: sub s(Str :%h, Str :$a) { }; s(:a(1))
camelia Type check failed in binding to parameter '%h'; expected Associative[Str] but got Hash ({})
in sub s at <tmp> line 1
in block <unit> at <tmp> line 1
Kaiepi ok so far 23:54
ok so far 23:56