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 ?


2013/6/9 Jamison Hope <jrh@theptrgroup.com>:
> On Jun 9, 2013, at 3:17 AM, Per Bothner <per@bothner.com> wrote:

> It seems like that should be "if (count == 1)", since it otherwise
> is completely dropping the first argument to apply (i.e. the actual
> procedure).
>
> (apply + 0 (object[] 1 2 3)) does work, as does
> (apply + 0 (integer[] 1 2 3)).

What a wonderful trick. Great Works.

>
> 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).
>

If all these arrays works the same way, the program would be much
easier to write. :)

I've seen this in Mathmatica, It's like Scheme but much more consistent.

Yes, some runtime penalty would be suffered. But it's not the
performance that all matters, isn't?
--
::::Do what you like
::::Like what you do


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