Hi!
> $ed.data.head($ed.data_size)
Unfortunately, i get the error "Error
X::AdHoc+{X::Await::Died}+{X::React::Died}: Don't know how many
elements a C array returned from a library"
> > my uint8 @data = $ed.data[0..$ed.data_size-1].Array;
> > my Blob $bindata = Blob[uint8].new(@data);
>
> Afaict
> Unfortunately, i get the error "Error
> X::AdHoc+{X::Await::Died}+{X::React::Died}: Don't know how many
elements a C array returned from a library"
I googled the error message and got a bunch of matches including this:
https://stackoverflow.com/questions/51081475/getting-data-out-of-native-poi
Super!
That what i was looking for, i changed the code to:
my Instant $init = DateTime.now.Instant;
my Blob $blob = blob-from-carray($ed.data, size=>$ed.data_size);
say "bindata = {DateTime.now.Instant-$init}";
Output:
Bindata= 0.00060054
So it passed from approx 1.1 to 0.0006 secs. That's q
Shorter, and much more readable, I'd say:
my Blob $blob = blob-from-carray($ed.data, size=>$ed.data_size);
say "bindata = { now - INIT now }";
The term "now" is short for "DateTime.now.Instant"
The INIT phaser is run when the program is started: it returns the value that
was obtained f
> It doesn't have to be an assertion. Just a code block would do the same.
Yes, good point.
In the docs, in the section Regex Interpolation, they don't mention
that feature, presumably because it literally does no interpolation,
but I'd argue that the null case is worth including in this table:
Brad Gilbert wrote:
> You don't want to use <{…}>, you want to use ""
> if $line ~~ / (^P\d+) \s+ {} "%products{$0}" / {
Well, as contrived examples go this one could be
improved. Instead of directly dereferencing a
hash, maybe I should've used a sub call.
> Note that {} is there to update
On 6/15/20, yary wrote:
> The Match docs can be clearer on when to use {} and when it isn't needed,
I agree, in fact I'm inclined to think this is an actual bug (design error?).
It's pretty strange that the two kinds of code interpolation behave so
differently:
$(...) requires you to do somethin
Just wondering if the docs describe how to access an "inner" capture
once saved to a variable? If not maybe the code below would be helpful
(from yary's last example, REPL output):
> my $capture = "1122" ~~ /(\d) {} :my $c=$0; ($c (\d) $0)/
「1122」
0 => 「1」
1 => 「122」
0 => 「2」
> say $capture
「1
Hi Joe,
1. I got your first "if" line (below) from June 14th to work, the one
you said, "it's not a complete solution":
1> if $line ~~ / (^P\d+) \s+ <{ %products{$0}.subst(/\s+/, '\s', :g) }> / {
2. I got Brad's "if" line (below) from June 15th to work:
2> if $line ~~ / (^P\d+) \s+ {} "%products{