Re: How to tie



Abble wrote:
Thanks, Lew, but I'd like if possible to not have to wrap my array.

On Dec 31, 9:53 am, Lew <l...@xxxxxxxxxxxxx> wrote:
Why not?

Abble <grg2@xxxxxxxxxxx> wrote:
Because I have about 60,000 lines of old code from C, C++, and FORTRAN
with array references like:
D[i] = A[ i ] + B[i] + C[ i ]; // use A B c
I think to objectize these the lines would look like:
D.setval( i, A.getval( i ) + B.getval( i ) + C.getval( i ) ); // use
A B c

Well List has shorter names, so it's:
D.set(i, A.get(i) + B.get(i) + C.get(i)); // use A B c

Which IMO isn't bad. But it's not the same as what you're asking for.

So the goal is to do whatever it takes so we can keep the natural
array notations and legibility of the expressions( which can get very
long), AND speed would be nice, as the native code C, C++ and FORTRAN
codes are already not as fast as one might like.

Maybe you should go a different direction. Write a mini-language that uses
whatever syntax you like, and convert that to java, in a way that lets you do
whatever optimizations you like.
--
Mark Rafn dagon@xxxxxxxxx <http://www.dagon.net/>
.