Maybe we can bring them back in the form of something that approximates C++ lambdas. My first impression of lambdas is they shared some of the functionality of statement functions. As I tried to point out above they also can be used in some cases in the place of cpp logic and as you point out have the advantage of offering a greater possiblility of inlining. The biggest advantages I see of lambdas is they can be defined anywhere in the code and like block constructs can contain explicit typing. So maybe a lambda block construct would give us the advantages of statement functions without what I see is their biggest problem which is a potential for confusion with arrays and in general readability.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| A streamlined preprocessor written in Fortran | 15 | 2074 | April 7, 2022 | |
|
Metaprogramming vs. generic programming in Fortran
|
8 | 2695 | December 12, 2021 | |
|
202X feature: Conditional Expressions
|
30 | 2238 | June 28, 2021 | |
| Why no punch_unit in iso_fortran_env? | 59 | 1705 | June 22, 2022 | |
|
Implementing fypp like pre-processing functionality in fpm
|
12 | 1792 | July 4, 2024 |