I've been toying with the idea of creating a simple fortran runtime to
implement messaging, and thereby basic OO features. (Yes, I know
Fortran2000 is OO, but I can't wait. Besides, I'm really just
interested to see if it can be done, rather than having any greater
motivation.)
I think it can be done, because there was once a form of fortran called
Objective Fortran in the early 90's, though I suspect the runtime was
written in C.
What I need are the following features:
1) A means of storing pointers to procedures in a data structure. I
know this is not directly supported, but is there some back door to
achieving this (other than C)?
2) Procedures that effectively take generic pointers (ie like C's
void*) to memory as arguments. Since Fortran is pass by reference, I
should be able to achieve this as long as I avoid using an explicit
interface, which will enforce strong typing. I will need to be able to
get the memory address of the passed arguments though. Is there an
official fortran function to get the memory address of a variable?
3) Procedures that can have a variable number of arguments (like "..."
in C). I know you can do this with the 'optional' keyword from f90, but
it requires an explicit interface (right?), and that conflicts with (2)
above.
Can anyone give me pointers or suggested solutions to one or more of
these requirements?
Regards,
Drew McCormack
========================================
Dr. Drew McCormack (Kmr. R153)
Afd. Theoretische Chemie
Faculteit Exacte Wetenschappen
Vrije Universiteit Amsterdam
De Boelelaan 1083
1081 HV Amsterdam
The Netherlands
Email [log in to unmask]
Telephone +31 20 44 47623
Mobile +31 6 483 21307
Fax +31 20 44 47629
|