Description
Formatting and pretty printing output is a usual task in any programming language. The Fortran format specifiers are a bit special because they are quite unique compared with other programming languages with C-like or Python-like format specifier. While Fortran's format specifiers are probably older than the C-like or Python-like format specifiers the later found wide adoption across several programming languages.
This raises the question if stdlib could offer a stdlib_format
module to allow formatting of strings using C-like and/or Python-like format specifiers.
Original post by @ivan-pi in #337 (comment):
Should the user formatting re-use the Fortran formatting conventions or do we want to adopt something like the Format Specification Mini-Language in Python?
Personally I would be in favor of having a function called
format
(like the Python.format()
or the C++ 20std::format
) for formatted string conversion, but I'm not sure we can really get there in standard Fortran. Probably we would need to limit the number of arguments and use theclass(*)
approach like inM_msg
.