🦋 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:50 coleman left, coleman joined 00:54 coleman left, coleman joined, coleman left 00:58 coleman joined 01:06 coleman left 01:07 coleman joined 01:12 kylese left, kylese joined 01:16 jpn left 02:15 kylese left, kylese joined 03:25 itaipu left 04:15 thaewrap1 left 04:33 thaewrapt joined 04:38 thaewrapt left 04:46 bdju left 04:48 bdju joined 04:49 thaewrapt joined 04:56 thaewrapt left 05:03 bdju left, bdju joined 05:10 thaewrapt joined 05:15 thaewrapt left 05:26 thaewrapt joined 05:45 guifa left 05:47 thaewrapt left 06:00 thaewrapt joined 06:19 thaewrapt left 06:32 thaewrapt joined 06:37 thaewrapt left 06:49 thaewrapt joined 07:00 thaewrapt left 07:12 thaewrapt joined 07:17 thaewrapt left
ab5tract Ah, for some reason I thought you were generating both signatures 07:21
just at different times
07:29 thaewrapt joined
ab5tract regardless: 07:30
m: sub foo(Int $a, Str $b is raw) { }; my $ast = Q:qq| {&foo.signature.raku} |.AST; say $ast.statements[0].expression.signature.parameters
camelia (RakuAST::Parameter.new(
type => RakuAST::Type::Simple.new(
RakuAST::Name.from-identifier("Int")
),
target => RakuAST::ParameterTarget::Var.new(
name => "\$a"
)
) RakuAST::Parameter.new(
type => RakuAST::Type::Sim…
ab5tract note that .AST is currently considered "unofficial", but I personally can't imagine that we would ship 6.e without some way of converting expressions to AST 07:32
07:34 thaewrapt left 07:45 sena_kun joined, thaewrapt joined 07:51 thaewrapt left 07:52 wayland76 joined
wayland76 ab5tract: thanks! 07:53
08:01 thaewrapt joined 08:06 thaewrapt left 08:17 thaewrapt joined 08:24 thaewrapt left 08:27 jpn joined 08:36 thaewrapt joined 08:46 thaewrapt left 08:55 soverysour joined, soverysour left, soverysour joined 08:57 thaewrapt joined 08:59 soverysour left 09:04 thaewrapt left 09:14 thaewrapt joined 09:20 jpn left 09:21 thaewrapt left 09:22 thaewrapt joined 09:23 jpn joined 09:29 sena_kun left 10:02 quotable6 left, committable6 left, releasable6__ left, greppable6 left, evalable6 left, bisectable6 left, notable6 left, coverable6 left, tellable6 left, shareable6 left, benchable6 left, linkable6 left, nativecallable6 left, bloatable6 left, unicodable6 left, sourceable6 left 10:07 bisectable6 joined, unicodable6 joined, nativecallable6 joined, committable6 joined, coverable6 joined 10:08 sourceable6 joined, releasable6 joined, bloatable6 joined, tellable6 joined, evalable6 joined 10:09 linkable6 joined, shareable6 joined, quotable6 joined, greppable6 joined, benchable6 joined 10:10 notable6 joined 10:41 xinming joined, wayland76 left 10:44 wayland76 joined 10:48 xinming left 10:56 xinming joined
wayland76 m: sub foo(Int $a, Str $b is raw) { }; my $ast = Q:qq| {&foo.signature.raku} |.AST; say $ast.statements[0].expression.signature.return 11:16
camelia Attempt to return outside of any Routine
in block <unit> at <tmp> line 1
wayland76 m: sub foo(Int $a, Str $b is raw) { }; my $ast = Q:qq| {&foo.signature.raku} |.AST; say $ast.statements[0].expression.signature.returns
camelia (Node)
wayland76 Interesting! How do I get a programmatically-created signature to have a "returns" value like that one? 11:17
(the second one -- my first run had a bug)
11:30 jpn left
ab5tract the constructor RakuAST::Signature.new takes a list of RakuAST::Parameter objects (:$parameters) as well as a RakuAST::Node object (:$returns) 11:46
since RakuAST::Node is essentially the super-class of (almost) all RakuAST classes, that gives you a lot of leeway for what to return 11:47
11:47 itaipu joined
ab5tract m: use experimental :rakuast; sub foo(Int $a, Str $b is raw) { }; my $ast = Q:qq| {&foo.signature.raku} |.AST; my $ret-ast = Q| Int |.AST; dd RakuAST::Signature.new(parameters => $ast.statements[0].expression.signature.parameters, returns => $ret-ast) 11:49
camelia Int $a, Str $b is raw --> Int
11:56 jpn joined
xinming m: my constant role-a = role :: { method t () { "1".say; } }; role :: { "2".say; }; my constant T = anon class T { method t () { "t".say; } } but role-a; T.new.t; 11:59
camelia 1
xinming In this exampe, is it possible to make a list of of roles dynamically applies to the same class, and compose different "classes" ?
something like anon class T { method t () { "t".say } } but @role-list-enabled; 12:00
12:01 jpn left 12:03 guifa joined 12:26 bdju left 12:28 bdju joined 12:31 wayland joined 12:32 wayland76 left 13:03 jpn joined 13:42 soverysour joined, soverysour left, soverysour joined 14:15 soverysour left 15:00 bdju left 15:01 bdju joined 15:28 soverysour joined 15:36 xinming left 15:38 xinming joined 16:03 jpn left 16:16 jpn joined 16:31 soverysour left, soverysour joined 16:46 Xliff joined
Xliff \o 16:46
I'm trying to pick up all of the caps in a camel cased var.
I have this but it doesn't work.
m: say "MyWeirdlyCamelCasedVar" ~~ / (\w).+?[ <[a..z]>(<[A..Z]>) .+?]+ /
camelia ï½¢MyWeirdlyCaï½£
0 => ï½¢Mï½£
1 => ï½¢Cï½£
Xliff m: say "MyWeirdlyCamelCasedVar" ~~ / (\w).+?[ <[a..z]>+(<[A..Z]>) ]+ / 16:49
camelia ï½¢MyWeirdlyCamelCasedVï½£
0 => ï½¢Mï½£
1 => ï½¢Cï½£
1 => ï½¢Cï½£
1 => ï½¢Vï½£
Xliff Aha! 16:50
17:03 guifa left
ab5tract m: say "MyWeirdlyCamelCasedVar" ~~ / [(<:Lu>)<:Ll>+]+ / 17:08
camelia ï½¢MyWeirdlyCamelCasedVarï½£
0 => ï½¢Mï½£
0 => ï½¢Wï½£
0 => ï½¢Cï½£
0 => ï½¢Cï½£
0 => ï½¢Vï½£
17:09 guifa joined
ab5tract Xliff: your last example seems to be missing the 'W' 17:09
17:21 jpn left 17:28 guifa left
Xliff ab5tract: Thanks, I fixed that in the greater project. 17:29
ab5tract My pleasure 17:30
17:35 jpn joined 17:40 jpn left 17:50 sena_kun joined 18:00 soverysour left 18:01 guifa joined 18:11 coleman left 18:12 coleman joined 18:18 xinming left, samebchase joined 18:21 guifa left 18:26 xinming joined 18:28 guifa joined
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2024/05/27/2024-...-incoming/ 18:32
antononcube .seen bduggan 18:54
tellable6 antononcube, I saw bduggan 2023-03-14T18:02:06Z in #raku-dev: <bduggan> Okay, cool -- good to know, and thanks for the comments
18:56 jpn joined 19:26 guifa left 19:39 guifa joined, jpn left 19:42 jpn joined
tbrowder lizmat++, excellent weekly, as usual! 20:00
thanks so much! 20:01
lizmat yw :-)
20:19 jpn left 20:55 guifa left
tbrowder i just had a weird experience (maybe self-inflicted). my module tests fine locally, then, on github, zef install finds a pod error not found locally! 21:28
lizmat strange 21:29
tbrowder it could be a precompile issue. is there a way get raku or zef to recompile a lib path?
lizmat rm -rf ~/.raku/precomp 21:30
tbrowder yes, but i was hoping for a more friendly way for noobs 21:31
lizmat well... ideally it shouldn't be needed
[Coke] n00bs don't need it
tbrowder true
[Coke] Why do YOU need it? 21:32
tbrowder laziness
and avoid possibility of ff nuking stuff 21:33
gfldex .seen raiph 21:39
tellable6 gfldex, I saw raiph 2024-05-14T09:12:22Z in #raku: <raiph> m: say $*RAKU.compiler.version
21:43 itaipu left 21:49 jpn joined 21:55 jpn left 22:01 itaipu joined 22:03 kaskal joined 22:04 kaskal- left
tbrowder ok, i narrowed prob a bit. using zef and mi6 testing locally in the module repo work fine. 22:13
however, using "zef install . " fails and it finds the pod error. 22:14
so, how can that be fixed?
the remote testing was done with raku v2024.02 and v2024.04 22:15
[Coke] one of your own pod files? 22:18
you can add a test that verifies your pod?
github.com/Raku/doc/blob/main/t/02...d.rakutest 22:19
tbrowder i can probably use Pod::Load for one, but what is zef doing different on install vs test locally?
i'm sure i'm not the only person making subtle pod errors. 22:20
22:23 guifa joined
tbrowder thnx for the link, maybe mi6 and zef could add that test. 22:25
ab5tract anyone know if there is a path in Windows that is not writable by the default user and, if so, what it is? 22:27
22:33 xkr47 left, xkr47 joined
ab5tract I guess 'C:\Windows\system32' should work alright 22:45
22:46 jpn joined 22:51 jpn left 23:06 sena_kun left 23:16 jpn joined
ab5tract Never mind, found a better approach to generating failures 23:19
23:20 jpn left