Re: array operations enhancements

2010-08-19 Thread ponce
pure double anyfunc(ref double x) { ... } pure double anyfunc(double[]) { ... } double[] c = anyfun(a[]) + 2.0*b[]; This proposal could be nice for making array operations more useful, but complicates overloading.

Re: array operations enhancements

2010-08-19 Thread Don
ponce wrote: pure double anyfunc(ref double x) { ... } pure double anyfunc(double[]) { ... } double[] c = anyfun(a[]) + 2.0*b[]; This proposal could be nice for making array operations more useful, but complicates overloading. Related example: double [] c = anyfun(a[]) * b[]; Is this

Re: array operations enhancements

2010-08-19 Thread KennyTM~
On Aug 18, 10 14:41, F. Almeida wrote: It is an excellent feature of D2 that one can do double a[]; double b[]; double c[]; //... c = a[] + 2.0*b[]; But this is still limited, as we cannot include function calls in these operations. What if the compiler was able to introduce them in the

Re: array operations enhancements

2010-08-19 Thread Kagamin
Don Wrote: ponce wrote: pure double anyfunc(ref double x) { ... } pure double anyfunc(double[]) { ... } double[] c = anyfun(a[]) + 2.0*b[]; This proposal could be nice for making array operations more useful, but complicates overloading. Related example: double [] c

Re: array operations enhancements

2010-08-19 Thread F. Almeida
== Quote from KennyTM~ (kenn...@gmail.com)'s article On Aug 18, 10 14:41, F. Almeida wrote: What if the compiler was able to introduce them in the assignment loop, provided that the functions pass ref double (in this case)? double anyfun(ref double x) { ... } c = anyfun(a[]) +

Re: array operations enhancements

2010-08-18 Thread Don
F. Almeida wrote: It is an excellent feature of D2 that one can do double a[]; double b[]; double c[]; //... c = a[] + 2.0*b[]; But this is still limited, as we cannot include function calls in these operations. What if the compiler was able to introduce them in the assignment loop,