🦋 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:00 reportable6 left 00:01 reportable6 joined 00:40 derpydoo joined 00:58 teatime left 00:59 teatime joined 01:30 nine left, m_athias left, nine joined, m_athias joined 02:17 teatwo joined 02:20 teatime left 02:29 derpydoo left 02:30 derpydoo joined
kybr do we have -Werror ? my program is throwing a warning and i cant catch it 02:40
MasterDuke try `use fatal` 02:54
or try catching with `CONTROL { ... }` instead of `CATCH { ... }` 02:55
lucs Let's say I'm printing out the elements of an array holding arbitrary values. 03:19
If an element is undefined, how would you suggest I represent it: 'Nil', 'Any', 'undef', something else?
03:30 evalable6 left, linkable6 left 03:31 linkable6 joined, evalable6 joined 03:48 xinming joined 04:48 squashable6 left, bisectable6 left, statisfiable6 left, notable6 left, releasable6 left, sourceable6 left, evalable6 left, bloatable6 left, committable6 left, quotable6 left, reportable6 left, nativecallable6 left, shareable6 left, benchable6 left, tellable6 left, unicodable6 left, coverable6 left, linkable6 left, greppable6 left, reportable6 joined, unicodable6 joined 04:49 squashable6 joined, quotable6 joined, nativecallable6 joined, tellable6 joined, coverable6 joined, benchable6 joined, shareable6 joined, evalable6 joined 04:50 bloatable6 joined, sourceable6 joined, statisfiable6 joined, greppable6 joined, bisectable6 joined, releasable6 joined, committable6 joined 04:51 linkable6 joined, notable6 joined 04:56 deoac left 05:12 Xliff joined
Xliff m: my $c = 0; start { $c++ }; $*SCHEDULER.cue( every => 2, -> *@a { $c.say }); sleep 10 05:13
camelia 1
1
1
1
1
05:49 Xliff left 05:58 jpn joined 06:00 reportable6 left, reportable6 joined 06:35 ProperNoun left 06:59 kjp left 07:00 jpn left, tadzik left, Matthew|m left, CIAvash left, uzl[m] left 07:02 kjp joined 07:09 abraxxa joined, japhb left 07:52 japhb joined 07:53 Sgeo left 07:57 sena_kun joined, japhb left 08:03 abraxxa left 08:16 derpydoo left 08:35 jpn joined 08:41 CIAvash joined 08:43 japhb joined 08:47 japhb left 08:50 abraxxa joined 09:10 Xliff joined
Xliff \o 09:11
I know this might be the wrong channel, but could someone explain what this means: "dataLabels?: CommonDataLabelBoxTheme &"
When used in this context: github.com/nhn/tui.chart/blob/main...art-pie.md
I'm trying to write Raku wrappers for it.
09:23 bdju left 09:26 abraxxa left 09:31 bdju joined
guifa_ My guess is it's a very odd choice for an OR equivalent 10:03
holmdunc its type is a new type that's the merger of the named type CommonDataLabelBoxTheme and the anonymous/structural type that follows the ampersand. It can also have the value undefined thanks to the question mark
10:31 evalable6 left, linkable6 left 10:32 evalable6 joined 10:33 linkable6 joined 11:15 codesections joined 11:45 codesections left
Voldenet Xliff: it's an optional field of intersection type obviously 11:47
11:47 Matthew|m joined, tadzik joined, uzl[m] joined
Voldenet in raku it would be: class CommonDataLabelBoxTheme { has Bool $.useSeriesColor; … }; class DataLabels is CommonDataLabelBoxTheme { has CommonDataLabelBoxTheme $.pieSeriesName; … }; 11:51
and `has DataLabels $.dataLabels` 11:52
12:00 reportable6 left 12:01 reportable6 joined 12:08 squashable6 left, squashable6 joined 12:30 japhb joined 12:42 japhb left 12:59 [Coke]_ joined 13:01 [Coke] left 13:02 [Coke]_ is now known as [Coke] 13:03 euandreh joined 13:43 japhb joined
Xliff `Voldenet: Thanks. That's what I ended up going with. S 14:06
Voldenet btw, funny that type intersection has all the fields, but type union has only intersection of fields… :D 14:07
Xliff Yes, and the syntax is horrible! 14:12
14:12 Sgeo joined 14:14 euandreh left 14:16 euandreh joined 14:17 tea3po joined 14:18 tea3po left, tea3po joined 14:20 tea3po left, tea3po joined, teatwo left 14:36 TieUpYourCamel left 14:38 peder left 14:57 TieUpYourCamel joined 15:02 peder joined 15:05 xinming left 15:07 xinming joined 15:50 rf joined 16:21 deoac joined
Voldenet m: my $x = 42; given $x { when Int { say "nope" }; default { say "obviously" }} 16:33
camelia nope
Voldenet m: my $x = 42; given $x -> $y { when Int { say "nope" }; default { say "obviously" }}
camelia obviously
Voldenet I'm left with puzzled face 16:34
m: my $x = 42; given my $y = $x { when Int { say "nope" }; default { say "obviously" }} 16:36
camelia nope
Nemokosch m: my $x = 42; given $x { .&dd }; given $x -> $y { .&dd }; given my $y = $x { .&dd } 16:38
Raku eval Int $x = 42 Any $_ = Any Int $y = 42
Nemokosch it's not that surprising tbh, if you think that the block of given is indeed a Raku block 16:39
if you specify the parameter to be $y, why would it be passed as $_?
Voldenet Well yes, obviously :) 16:40
16:49 TieUpYourCamel left 16:55 deoac left
RaycatWhoDat Does anything prevent MoarVM from being ported to WASM? 17:08
I would imagine it would be pretty slow 17:09
[Coke] I would imagine rather than porting moarvm, you might want a WASM backend to NQP 17:29
Someone asked recently about maybe a nativecall-esque interface to wasm in moarvm also 17:33
patrickb In general the performance of software written in C and compiled to WASM is not as bad as one might think. It's an approach multiple 3D game engines (unity, unreal) have taken. They perform acceptably fast.
tonyo interesting 17:41
17:54 daxim left 18:00 reportable6 left 18:01 reportable6 joined 18:08 daxim joined 18:51 drudge joined
drudge Hello all! Have a quick question on phasers, as mine aren't doing what I expect. Do `repeat while` statements support the LAST phaser? I can't find precedent for my issue 18:53
it appears my LAST block is executing in tandem with FIRST when inside a `repeat while` block combination
hastebin.com/share/ivepiromoy.perl I'm simply printing every three numbers in a range and adding "+" x 10 18:54
I should've read the sticky first, this is likely more appropriate for #raku-beginner 18:55
I'm on Rakudo v2023.04
Voldenet m: my $iter = 12;repeat {FIRST say "+" x 10;FIRST {say "$iter"};say "{$iter += 3}";LAST say "+" x 10;} while $iter < 75; 19:00
camelia ++++++++++
12
15
18
21
24
27
30
33
36
39
42
45
48
51
54
57
60
63
66
69
72
75
++++++++++
Voldenet …works for me?
if your output isn't the same, then it sounds like some kind of bug 19:01
m: sub foo { my $iter = 12;repeat {FIRST say "+" x 10;FIRST {say "$iter"};say "{$iter += 3}";LAST say "+" x 10;} while $iter < 75; }; foo 19:03
camelia ++++++++++
++++++++++
12
15
18
21
24
27
30
33
36
39
42
45
48
51
54
57
60
63
66
69
72
75
Voldenet m: sub foo { my $i = 1; repeat { say $i; LAST say "end"; } while $i++ < 5 ; }; foo 19:05
camelia end
No such method '!capture_phasers' for invocant of type 'Code'
in block <unit> at <tmp> line 1
Voldenet sub foo { while False { LAST say "foo" } }; foo 19:07
evalable6 foo
Voldenet sub foo { repeat { LAST say "foo" } while False }; foo
m: sub foo { repeat { LAST say "foo" } while False }; foo 19:08
camelia foo
No such method '!capture_phasers' for invocant of type 'Code'
in block <unit> at <tmp> line 1
[Coke] I have pressed the button to change master to main on MoarVM/MoarVM 19:13
drudge when i write it one liner like you provided it works e.g. my $iter = 12;repeat {FIRST say "+" x 10;FIRST {say "$iter"};say "{$iter += 3}";LAST say "+" x 10;} while $iter < 75;
[Coke] might need to update rakubrew
drudge I'm using `rakudo-pkg` on Ubuntu 19:14
ok, when I take it out of the MAIN subroutine it works 19:16
literally just deleted sub MAIN () {}
I'm calling it via `raku path/to/file`
weird, I'll assume this is a bug rather than me not knowing what I'm doing this time :P 19:17
thank you much for your help 19:21
[Coke] try wrapping it just a {} instead of a sub MAIN() { } - I suspect the phasers are triggering when in either block vs. no block? 19:38
drudge wrapping in {} works 19:40
adding main again breaks it
[Coke] can you gist it? 19:45
want to see if it fails the same way here. 19:46
drudge m: sub MAIN () {my $iter = 12;repeat {FIRST say "+" x 10;FIRST {say "$iter"};say "{$iter += 3}";LAST say "+" x 10;} while $iter < 75;} 19:49
camelia ++++++++++
++++++++++
12
15
18
21
24
27
30
33
36
39
42
45
48
51
54
57
60
63
66
69
72
75
drudge hopefully that's what you mean by gist it 19:50
{my $iter = 12;repeat {FIRST say "+" x 10;FIRST {say "$iter"};say "{$iter += 3}";LAST say "+" x 10;} while $iter < 75;}
evalable6 ++++++++++
12
15
18
21
24
27
30
33
36
39
42
45
48
51
54
57
60
63
66
69
72
75
++++++++++
19:51 linkable6 left, evalable6 left 19:53 linkable6 joined 19:54 evalable6 joined
gfldex drudge: this is where gists go: gist.github.com/ 20:04
there are CLI tool too ofc 20:05
Voldenet m: sub foo { for 1 { repeat { LAST say "foo" } while False } }; foo 20:22
camelia foo
Voldenet the workaround is fairly easy, but ugly 20:23
tonyo m: state $i = 0; repeat { $i++; say $i; LAST { say "last"; }; } while $i < 12; 20:38
camelia 1
2
3
4
5
6
7
8
9
10
11
12
last
20:46 ismustachio left
leont What's the right JSON implementation to use nowadays? JSON::Fast? 20:53
Nemokosch yes, pretty much
most maintained at least
21:01 ismustachio joined 21:05 drudge left
gfldex lolibloggedalittle: gfldex.wordpress.com/2023/05/10/co...-coercion/ 21:35
also, my head hurts a little :)
tonyo gfldex: is the COERCE what you ended up with for the .T ? 21:37
gfldex aye
tonyo pretty cool
21:40 ProperNoun joined 22:02 sena_kun left 23:02 bisectable6 left, tellable6 left, linkable6 left, bloatable6 left, unicodable6 left, quotable6 left, reportable6 left, greppable6 left, sourceable6 left, squashable6 left, releasable6 left, notable6 left, evalable6 left, statisfiable6 left, committable6 left, nativecallable6 left, coverable6 left, shareable6 left, benchable6 left 23:03 committable6 joined, releasable6 joined, bloatable6 joined, statisfiable6 joined, quotable6 joined, squashable6 joined 23:04 unicodable6 joined, sourceable6 joined, bisectable6 joined, evalable6 joined, notable6 joined, coverable6 joined, nativecallable6 joined 23:05 reportable6 joined, benchable6 joined, linkable6 joined, tellable6 joined, greppable6 joined, shareable6 joined 23:11 theklesk joined 23:12 theklesk left 23:14 euandreh left