[gfortran] Support for [...] style array constructors

Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
Mon Apr 18 22:55:00 GMT 2005


Richard E Maine wrote:
> It is possible for there to be nested array constructors. You have to 
> make sure that the end delimiter is correctly matched in such nested 
> cases. I don't know the right C terms (hey, I haltingly speak a little 
> bit of C, but it is Fortran that I am fluent in), but in Fortran I'd 
> say that it was important that the end-delim thing better be a distinct 
> variable for each recursive instance of the procedure. Probably it is, 
> but I don't speak C well enough to know.

It is, that's one of the few things that C got right :-)

> I.e., in something like
> 
>    (/ [ ... ] /)
> 
> you need to be back to looking for a "/)" to match the "(/" and not get 
> thrown off by the nested "[]". Just an obvious kind of thing to put in 
> the test.

Yes, among a bunch of others liek implied do-loops, array-valued expressions
inside the ocnstructor etc.

- Tobi



More information about the Gcc-patches mailing list