develooper Front page | perl.perl6.users | Postings from September 2018

A problem with native CArrays

Thread Next
Fernando Santagata
September 30, 2018 09:27
A problem with native CArrays
Message ID:

I was hunting for a bug in my code, this one:

my @a := CArray[int32].new: 6,3;
say [+] @a; # it should be "say [+] @a.list;"

That statement prints "9", while changing the '+' with a '*' it generates
an error, as it should:

Cannot resolve caller Numeric(NativeCall::Types::CArray[int32]: ); none of
these signatures match:
    (Mu:U \v: *%_)

Is this a bug, an inconsistency, or a necessary evil?

Fernando Santagata

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About