Logo

Programming-Idioms

  • Kotlin
  • Fortran
elemental subroutine foo(x)
  real, intent(in) :: x
end subroutine foo

call foo(x)
for (x in items) doSomething(x)
items.forEach { doSomething(it) }
items.forEach(::doSomething)

Using a function reference.
for Item of Items loop
   Do_Something (Item);
end loop;

New implementation...