Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Fortran

Idiom #93 Pass a runnable procedure as parameter

Implement the procedure control which receives one parameter f, and runs f.

module x
  implicit none
contains
  subroutine control(f)
    interface
       subroutine f()
       end subroutine f
    end interface
    call f
  end subroutine control
end module x
procedure Control (F : access procedure) is
begin
   F.all;
end Control;

New implementation...
< >
programming-idioms.org