Re: operation on module arguments




Richard E Maine wrote:
Rich Townsend <rhdt@xxxxxxxxxxxxxxxxxxx> wrote:

Unless you made a, b and c module variables of a derived type that have
special code called whenever they appear in an assignment. To hide this
'magic', you could define all of the operations necessary for them to
appear in normal arithmetic expressions. So nobody would know!

I actually thought of that kind of thing (which I see that Brooks
mentioned also), but decided not to "go there". Somehow, I suspect that
if the OP didn't want the extra bother of manually updating c when
needed... well... I didn't want to be responsible for the medical
problems likely to result when he saw what this trick would take. :-(


Actually, before I posted the question, I was reading Fortran 90/95
Explained, Ch5.5. One of examples is show the interface operation
operating a derived type, but, well, I didn't quite get it. I will be
happy to know any method that enables me get rid of manual updating. I
will try my best to stay cool. -_-

.