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: alternative array syntax


Bruce Lewis wrote:
To be clear, I don't think arrays and vectors should be viewed as
functions; I merely think they should be allowed in the first position
as functions are, with the semantics one would expect.

I'd think it that they are both members of an Applicable "interface". (Of course Java arrays don't implement an Applicable interface, in the Java sense, but we can act as if they do.)

Yes there will
be people occasionally confused as to why they can't pass arrays to
higher-order functions that expect procedures as arguments, but that
cost is worth the benefit.

No reason you can't pass an array to a higher-order function that expects an Applicable - and unless you do an explicit type test, no reason it wouldn't work automatically. E.g. we'd probably want to generalize map and for-each to work on Applicable objects. -- --Per Bothner per@bothner.com http://per.bothner.com/


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