Fortran 2023 standard

@FortranFan try this in LPython:

parts: list[str]
parts = [ "valve", "compressor", "etc." ]
print(parts)
part: str
for part in parts:
    print(part)

It gives:

$ lpython a.py
['valve', 'compressor', 'etc.']
valve
compressor
etc.

So LFortran internally already has a support for lists and strings like this.

Why don’t you come up with some good Fortran syntax for this? We can easily create a prototype for this, since we already did the hard work of making it working in the middle end and backends.

One way is to emulate a list using some derived type and provide a Fortran implementation, but the syntax will not be the best. Alternatively we can extend Fortran to have lists of strings.

2 Likes