🦋 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.
Xliff_ m: my @a[2; 2]; @a[1;0] = 1; @a.gist.say; 00:13
camelia [[(Any) (Any)]
[1 (Any)]]
Xliff_ Is there a way I can define a multidim array as a reference? 00:14
Xliff_ m: my $a = [ [1, 0], [0, 1] ]; $a[1;0.gist.say 00:15
camelia ===SORRY!=== Error while compiling <tmp>
Unable to parse expression in subscript; couldn't find final ']' (corresponding starter was at line 1)
at <tmp>:1
------> $a = [ [1, 0], [0, 1] ]; $a[1;0.gist.say⏏<EOL>
expecting any …
Xliff_ m: my $a = [ [1, 0], [0, 1] ]; $a[1;0].gist.say
camelia 0
Xliff_ m: my $a = [ [1, 0], [0, 1] ]; $a[1;1].gist.say
camelia 1
Xliff_ m: my $a = [2;2]; $a.gist.say 00:16
camelia [2 2]
Xliff_ m: my $a = @[2;2]; $a.gist.say
camelia [2 2]
Xliff_ m: my $a = [0 xx 2] xx 2; $a.gist.say 00:20
camelia ([0 0] [0 0])
Xliff_ m: my $a = [0 xx 2] xx 2; $a.gist.say; $a[1;1] = 1; $a.gist.say
camelia ([0 0] [0 0])
([0 0] [0 1])
Xliff_ I guess that'll do.
guifa_ What do you mean by "as a reference"? you mean setting an initial value? 00:21
What do you mean by "as a reference"? you mean setting an initial value? 00:22
m: my @a[2;2] is default(0); say @a
camelia ===SORRY!=== Error while compiling <tmp>
is default on shaped Array not yet implemented. Sorry.
at <tmp>:1
------> my @a[2;2] is default(0)⏏; say @a
expecting any of:
constraint
guifa_ err I guess that's NYI haha
Xliff_ guifa: Yes, you can do that, but if I wanted a distinct array each time I entered that block, that wouldn't work. 00:28
m: my %h; sub a { my @a[2; 2]; @a[1;1] = $++; %h{$++} = @a }; a; a; %h.gist.say; 00:30
camelia {0 => [[(Any) (Any)]
[(Any) 0]], 1 => [[(Any) (Any)]
[(Any) 1]]}
Xliff_ m: my %h; sub a { my @a[2; 2]; @a[1;1] = $++; %h{$++} = @a }; a; %h{0}[0; 1] = 0; a; %h.gist.say; 00:31
camelia {0 => [[(Any) 0]
[(Any) 0]], 1 => [[(Any) (Any)]
[(Any) 1]]}
Xliff_ m: my %h; sub a { my @a[2; 2]; @a[1;1] = $++; %h{$++} = @a }; a; %h{0}[0; 1] = 0; a; %h.gist.say; %h{0}.WHERE.say; %h{1}.WHERE.say 00:32
camelia {0 => [[(Any) 0]
[(Any) 0]], 1 => [[(Any) (Any)]
[(Any) 1]]}
5915594278688
5915594343376
Xliff_ m: my %h; sub a { my @a[2; 2]; @a[1;1] = $++; %h{$++} := @a }; a; %h{0}[0; 1] = 0; a; %h.gist.say; %h{0}.WHERE.say; %h{1}.WHERE.say
camelia {0 => [[(Any) 0]
[(Any) 0]], 1 => [[(Any) (Any)]
[(Any) 1]]}
4283405733504
4283405794952
Xliff_ Huh! Maybe not.
guifa_ Just updated Polyglot::Regexen on fez 00:38
Massively improved support for ECMA262
and best of all.....it uses RakuAST :D :D :D
still need to push the code to Github 00:39
antononcube @guifa "Just updated Polyglot::Regexen on fez" -- Cannot install it! 😢 03:20
@guifa 4 tests out 12 failed : " # Failed test 'Exactly some number'" , " Failed test 'Frugal exactly some number'" , etc. 03:21
@guifa Sorry to be a the bearer of bad news...
poohman hello all, lets say I have a function sub test(@a, %b, %c){....}. Is there a way to say my $test_modified=test(@a=>@an_array), so that I can use $test_modified(%b,%c)? 03:39
I basically want to pass one argument before hand 03:42
siavash .tell poohman `my &test_modified = &test.assuming: @a;` 07:00
tellable6 siavash, I'll pass your message to poohman
guifa anton: update Rakudo, lizmat pushed an update to deparsing frugal indicators :-) 09:52
guifa unicode.org/reports/tr18/ <-- interesting. we support half of this 10:26
nemokosch which half? ^^ 10:28
guifa union intersection
Can basically do set/symetric difference by using & between two separate char class <[a..f+> & <[d..h]>, but to allow the nesting syntax they propose we'd have to ban [ + - ∖ ⊖ as literals which would be a breaking change 10:30
or actually 10:32
no 10:33
<([a..c]+[d..f])⊖[c..e]> 10:34
we could parentheses like that and that wouldn't be breaking at all
because they're currently invalid there
antononcube @guifa I can install “Polyglot::Regexen” on/in/with moar-blead? 10:37
nemokosch you could do a "triple" 10:41
rakubrew triple
builds Rakudo, MoarVM and NQP from HEAD
(by default)
guifa I've not used moar-blead. I just do the perl Configure.pl, make, make install on a freshly checked out version of rakudo from github. No need to update MoarVM, just Rakudo
guifa is off to $day-job 10:42
nemokosch m/[ \' ( .*?) \' ]+/; $0.join(Q/'/) 13:48
I think this is all it takes to process a Pascal-style string literal 13:49
Anyway, I think this is the simplest quoting structure without forbidden content 13:50
antononcube @librasteve Well, in my most recent post I (mis-)used "Physics::Unit". As you explained, "Physics::Measure" should have been used. 14:13
librasteve @antononcube - I will read and comment there then 16:45
antononcube I made both a Jupyter and a Mathematica notebooks from the Markdown of that post — I will upload them soon. So, proper use of “Physics::Measure” would appear there. 16:51