-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
Clause 11Standard Clause 11: Execution controlStandard Clause 11: Execution control
Description
Not sure if this has already been proposed or not. But I keep wishing Fortran had something like the python for style loops like this:
for x in [10, 23, 1]:
do_something(x)or with zip:
for x,y in zip([10,23,1], ['a', 'b', 'cc']):
do_something(x,y)of course, the fortran way would be something like that:
integer :: i ! just a counter
integer,dimension(3),parameter :: vals = [10, 23, 1]
character(len=2),dimension(3),parameter :: cals = ['a ', 'b ', 'cc']
do i = 1, 3
call do_something(vals(i), cals(i))
end doWhat do people think?
I don't know what the syntax would be...
for (x => [10, 23, 1], c => ['a ', 'b ', 'cc'])
call do_something(x,c)
end forcertik, awvwgk, samharrison7, e-kwsm, 14NGiestas and 3 more
Metadata
Metadata
Assignees
Labels
Clause 11Standard Clause 11: Execution controlStandard Clause 11: Execution control