glen herrmannsfeldt <
g...@ugcs.caltech.edu> wrote:
>
edmondo.g...@gmail.com wrote:
> > Il giorno sabato 13 giugno 2015 17:50:56 UTC+2, Peng Yu ha scritto:
> >> C/C++ has +=. Is there something similar to it in fortran?
> > No, you should do:
> > i = i + 1
> Now, consider:
>
> X(complicated subscript expression)=X(complicated subscript
> expression)+1
>
> especially if the expression involves function calls.
As mece notes, see ASSOCIATE if you really have need for that.
Or for your particular example there is always
i = complicated subscript expression
x(i) = x(i) + 1
One doesn't actually need a whole new language feature, which comes with
a large number of complications and caveats for a special case as simply
handled as that. If you are looking to avoid rewriting the same
complicated expression multiple times - an admirable goal for many
reasons - might as well handle much more general cases instead of the
particular one of incrementation. See ASSOCIATE.
--
Richard Maine
email: last name at domain . net
dimnain: summer-triangle