-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Here's a little thing that I have frequently wanted: some syntax to allow a contained
procedure (say in a subroutine) to have a return
statement that applies to the calling procedure. This is to replace something like this:
subroutine main()
! do some stuff
if (error) then
call raise_error()
return !<--- have to remember to put this everywhere this routine is called
end if
! some other stuff
contains
subroutine raise_error()
! do some error handling stuff
end subroutine raise_error
end subroutine main
with:
subroutine main()
! do some stuff
if (error) call raise_error() <---- calling this returns from main
! some other stuff
contains
subroutine raise_error()
! do some error handling stuff
return main ! <- some kind of new syntax
end subroutine raise_error
end subroutine main
Metadata
Metadata
Assignees
Labels
No labels