j3-fortran / fortran_proposals

Proposals for the Fortran Standard Committee
175 stars 14 forks source link

Alternative array access with [ ] #114

Closed Leonard-Reuter closed 4 years ago

Leonard-Reuter commented 4 years ago

Allow for alternative array acess:

my_array[3]

instead of

my_array(3)

in order to distinguish between array access and function call.

cmacmackin commented 4 years ago

This would conflict with coarray indexing. Also, frankly, the last thing Fortran needs is more ways to do the same thing. It is already full of those and it makes the source a devil to parse and analyse.

Leonard-Reuter commented 4 years ago

This would conflict with coarray indexing. Also, frankly, the last thing Fortran needs is more ways to do the same thing. It is already full of those and it makes the source a devil to parse and analyse.

I never worked with coarrays, so I did not know this. Thanks for the clarification =)

certik commented 4 years ago

Yes, the a[3] syntax is already taken, so this would be very hard to do.