🦋 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.
Homer_Simpson is there a way to type a string liteal and then make a n identifier from it 03:05
eg 'item' in $item 03:06
literal* an* 03:07
Nemokosch yes there is but you should really ask yourself why you want to do it 03:10
you can ask the symbol table accessed by `::` - that can give you symbols that exist but it cannot store new symbols 03:13
docs.raku.org/language/packages#Pseudo-packages 03:16
the lookup story starts right below: docs.raku.org/language/packages#Lo...g_up_names 03:17
Homer_Simpson awesome 03:35
so like this: my $::'foo'; or like this: my $str = 'bar'; $::$str; 03:37
I can't get it to work 03:53
my $::('foo'); 03:54
my $bar = 'bar'; my $::($bar);
Homer_Simpson maybe replit just sucks 03:55
I wish there was an android raku compiler
with an ide 03:56
Homer_Simpson replit app has stopped working even after resetting/reinstall 03:56
Homer_Simpson usercontent.irccloud-cdn.com/file/SnRDC2Co/.jpg 04:10
Homer_Simpson oh ok they are only package scoped 04:53
jaguart m: constant undef="not-defined"; say undef; 07:32
camelia ===SORRY!=== Error while compiling <tmp>
Unsupported use of undef as a value. In Raku please use: something
more specific: an undefined type object such as Any or Int, :!defined as
a matcher, Any:U as a type constraint, Nil as the absence…
jaguart m: our Str constant undef="not-defined"; say undef; 07:33
camelia ===SORRY!=== Error while compiling <tmp>
Unsupported use of undef as a value. In Raku please use: something
more specific: an undefined type object such as Any or Int, :!defined as
a matcher, Any:U as a type constraint, Nil as the absence…
jaguart oh - but case sensitive :) whew 09:15
m: constant UNDEF = "nope"; say "lala ", UNDEF;
camelia lala nope
Voldenet I wouldn't use UNDEF 09:28
I'd do something like `class foo { default { foo.new }}; foo.default` 09:30
or `class y { our sub default { y.new } }; y::default.say` 09:32
Nemokosch Homer_Simpson: as I said, you cannot create new variables to all symbol tables. You can create for ones that have a Stash, as opposed to a PseudoStash 09:43
Voldenet: I guess it's rather the principle that is funny 09:45
That you naively do something and the compiler "misguesses" what your motives are 09:46
Perhaps it shouldn't shut you down if you yourself created a term called undef 09:47
Geth ecosystem/main: 8f8740e49b | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | META.list
Just a couple to go
09:53
Nemokosch by the way... I'd like to gather allies for a somewhat similar, fairly fundamental issue 09:55
Grammars have regexes and tokens which are installed as methods, right? 09:56
This wouldn't necessarily be a problem - if they weren't downright installed with completely unmarked names, hence instantly name-conflicting with all methods that a Grammar class has 09:57
leont: perhaps you can empathize with this problem; I think this is much like the problem of lexical exports, except in a somewhat closer world 09:59
however, it seems to me that the offered remedies are also worse, basically "just know by heart what methods your Grammar can have and avoid those names" 10:00
closer->more closed
lizmat weekly: www.reddit.com/r/rakulang/comments...session_2/ 11:10
notable6 lizmat, Noted! (weekly)
melezhik testing the bridge ... 18:13
Anton Antonov <@779471841270038528> How? 🙂 18:40
melezhik Anton, maybe this sounds "silly" I wanted to make it sure that messages from discord raku-bridge also appears here )) 18:55
I just need done it before )) 18:56
need -> never
Anton Antonov 👍 19:22
pippo m: my @a=[:level(1)]; class A {has $.level}; my $instance=A.new(@a.shift); 20:55
camelia Default constructor for 'A' only takes named arguments
in block <unit> at <tmp> line 1
pippo my @a=[:level(1)]; @a.shift ~~ :level(1); 20:58
my @a=[:level(1)]; say @a.shift ~~ :level(1);
evalable6 True
pippo my @a=[:level(1)]; say @a.shift ~~ :level(1); class A {has $.level}; my $i = A.new(:level(1)); say $i; my $j = A.new(@a.shift); 20:59
my @a=[:level(1)]; say @a.shift ~~ :level(1); class A {has $.level}; my $i = A.new(:level(1)); say $i; my $j = A.new(@a.shift); say $j; 21:00
m: my @a=[:level(1)]; say @a.shift ~~ :level(1); class A {has $.level}; my $i = A.new(:level(1)); say $i; my $j = A.new(@a.shift); say $j;
camelia True
Default constructor for 'A' only takes named arguments
in block <unit> at <tmp> line 1

A.new(level => 1)
pippo m: my @a=[:level(1)]; class A {has $.level}; my $i = A.new(@a.shift); say $i; 21:01
camelia Default constructor for 'A' only takes named arguments
in block <unit> at <tmp> line 1
pippo ^^ anybody could explain me why this does not work please? 21:02
guifa The default constructor for a class is .new(:$attr, :$attr…) 21:23
the problem is
you're passing the Pair as a positional argument
Nemokosch guifa: maybe you know how to pass a pair as a positional argument to a _sub-signature_? 21:27
pippo: I have something for you based on what guifa said 21:34
NemokoschKiwi m: my @a=[:level(1)]; class A {has $.level}; my $i = A.new(|(@a.shift)); say $i; 21:35
camelia A.new(level => 1)
NemokoschKiwi 🥳
pippo Uaaaaaaaaaaa!!! thank you!!!!!!!!!!!!!
NemokoschKiwi you're welcome. Everybody learns something :D 21:38
pippo me many! Cheers 21:39
Manifest0 Hi. I made a little script in raku, but from time to time the script core dumps. 21:55
I have no idea why. Is anybody interested in the coredump file? Should i open a github issue with just the coredump? 21:56
Nemokosch What is the script doing, if I may? 21:57
Iirc I only got a dump once, in a situation with heavy use of junctions 21:58
so basically some concurrent access
Manifest0 It's a console rss reader. It will use cro-http to get the rss, and write it to a sqlite db. 22:00
Nemokosch if the dump should happen while invoking Cro, it might be a good idea to delegate the issue directly there; it can be more visible and most knowledgeable implementors tend to have Cro affiliations anyway 22:03
Manifest0 i don't know if it's while invoking cro. It's possible. I have a react loop that reacts every 120s to update the feeds, and also reacts for a key press (i have a text interface). The crash seems to happen when i press the keys to navigate while the cro is extracting the url. 22:10
I'm going to ask in #raku-dev 22:11
Nemokosch Yes, unfortunately, that's a complex and errorprone part, react blocks, that is. Perhaps it takes someone with a good grasp of the internals to say if you did something wrong or it's just downright a bug. Until then, I'd say make sure to check out docs.raku.org materials, including the "traps" section 22:15
Geth ecosystem/main: 48cdc93d9f | thundergnat++ (committed using GitHub Web editor) | META.list
Migrate modules to fez ecosystem
23:33