-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unnamed array #307
Comments
Look into associate ( s => "abcdef") ; print *, s(3:3 ) ; end associate
associate ( s => ["a","b","c","d","e","f"] ) ; print *, s(3) ; end associate
associate ( n => [3,1,4,1,5,9] ) ; print *, n(3) ; end associate
end
So you can propose either a shortened version, say Or, if you seek even more compactness in the Fortran language, you can reach back to your original post where you propose even that be bypassed!! |
Also a function that returns an array:
Or any array expression like:
It becomes quite less readable quickly. The |
Thanks for your comments! Well,
(There might be better solutions for upper-case-ing a string, but that's not the point here.) So, due to pure analogy to that, I would like to have the same possibility for (constant) arrays, which appear only once in the whole source-code
Of course, if the size of the unnamed string/array (which therefore is not "absolutely constant") changes in the next version of the software, you have to change also the Probably internally (from the point of view of the compiler) strings and arrays might be pretty different objects/structures, but from the point of view of the user they are both bunches, lists, collections, ... of single objects of the same type, so I would like to be able to do the "same thing" with/to them. Giving them an intermediate name via |
@Sandwich-X, good points. Would you allow it for arrays from functions, or only constant arrays like |
Honestly said, I haven't thought about that yet. So, I guess, for the beginning I would be happy if it works for constant arrays (although - again honestly said - I have had only one case until now, where I really could have needed it) and maybe, if it turns out, that it might be also usefull for functions, it could get extended. |
Analogously to
PRINT *, "abcdef"(3:3)
it should be possible to have
PRINT *, ["a","b","c","d","e","f"](3)
or
PRINT *, [3,1,4,1,5,9](3)
and similar.
The text was updated successfully, but these errors were encountered: