This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: why (apply + (int[] 1 2 3)) won't work ?


On Jun 9, 2013, at 4:03 PM, Per Bothner <per@bothner.com> wrote:

>> Primitive arrays are not supported at all, though, since they are
>> disjoint from Object[].  I'm sure a patch would be welcome to allow
>> for them, but it'll be a hassle since you have to handle each
>> primitive type separately (and there are 8 of them).
> 
> Luckily, we can delegate this hassle to java.lang.reflect.Array.
> I just checked in a patch (along with some tests) to do that.

Oh, right.  I remembered its getBoolean(), getByte(), etc., but had
forgotten about the auto-boxing get().

That works, as long as it's deemed acceptable for the object
representations to be the standard Java number classes and not the
gnu.math types.  I suppose that already ought to be the case any
time that we'd be passing a primitive array to apply and expecting
it to do the right thing.

--
Jamison Hope
The PTR Group
www.theptrgroup.com




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]