Re: A problem with native CArrays

2018-10-01 Thread Fernando Santagata
Thank you for the clarification! On Mon, Oct 1, 2018, 05:54 Brad Gilbert wrote: > The [+] works because of an optimization. > > If you use the core :<+> it instead calls the .sum() method. > > Since CArray has a sum method, that gets called instead. > On Sun, Sep 30, 2018 at 4:28 AM Fernando

Re: A problem with native CArrays

2018-09-30 Thread Brad Gilbert
The [+] works because of an optimization. If you use the core :<+> it instead calls the .sum() method. Since CArray has a sum method, that gets called instead. On Sun, Sep 30, 2018 at 4:28 AM Fernando Santagata wrote: > > Hi, > > I was hunting for a bug in my code, this one: > > my @a :=

Re: A problem with native CArrays

2018-09-30 Thread JJ Merelo
El dom., 30 sept. 2018 a las 15:54, Fernando Santagata (< nando.santag...@gmail.com>) escribió: > What I was pointing out is that the '*' operator outputs an error, and I > was expecting that, while the '+' doesn't. > Besides, the '+' delivers the correct result, which apparently indicates > that

Re: A problem with native CArrays

2018-09-30 Thread Brandon Allbery
Might be because there's a prefix form of + with a wider type? "Every DWIM has a WAT" On Sun, Sep 30, 2018 at 9:55 AM Fernando Santagata < nando.santag...@gmail.com> wrote: > What I was pointing out is that the '*' operator outputs an error, and I > was expecting that, while the '+' doesn't. >

Re: A problem with native CArrays

2018-09-30 Thread Fernando Santagata
What I was pointing out is that the '*' operator outputs an error, and I was expecting that, while the '+' doesn't. Besides, the '+' delivers the correct result, which apparently indicates that the two operators are treated differently. I was trying to understand whether this behavior is inherent

Re: A problem with native CArrays

2018-09-30 Thread JJ Merelo
This works: my int32 $a = 3; my int32 $b = 7; say $a * $b # OUTPUT: «21␤» El dom., 30 sept. 2018 a las 11:28, Fernando Santagata (< nando.santag...@gmail.com>) escribió: > Hi, > > I was hunting for a bug in my code, this one: > > my @a := CArray[int32].new: 6,3; > say [+] @a; # it should be