Hi Neil!
I also thought about having a tb-procedure doing error handling.
Overriding that procedure would be obvious. However, as you already
pointed out, having a type bound procedure comes with some limitations.
Thinking about that lead to the idea of doing it more in the F90 style.
Simply using procedure pointers and even a detached error-module instead
of overloading procedures.
...
use error_mod
procedure(error), pointer :: error => simple_error
...
public :: ... error
...
program main
...
error => advanced_error
...
Well, for someone this comes at the cost of knowing a lot about Fortran
and particular implementations which is in opponent of OOP.
What do you think about that approach? (at a recent Fortran course I was
told strictly sticking with OOP paradigms and not using pointers)
All the best,
Stefan
|