Re: operation on module arguments
- From: nospam@xxxxxxxxxxxxx (Richard E Maine)
- Date: Thu, 21 Sep 2006 16:03:16 -0700
<gottoomanyaccounts@xxxxxxxxx> wrote:
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. -_-
I was attempting to be humorous. There is absolutely no way that you
would really want to do this. It would probably take thousands of lines
of code, depending on how thorough you wanted to be. That's if it can
actually be made to work as you'd want, which would take a bit of work
to figure out for sure. It was more of a random thought about a possible
trick than a serious, considered answer. In the unlikely case that you
actually do want to do as much work as would be required, then...
well... I'm afraid that I don't. :-( It would be a lot of work even
thinking through all the potential issues, much less explaining it to
someone else. More work than I'm willing to put into it. Sorry.
The suggestion made elsethread of using a function is much more
practical. As noted, it has limitations, but it is at least simple to do
if it can meet the need. It isn't an automatic variable updater, but
might well be better for whatever end purpose you have in mind.
--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
.
- Follow-Ups:
- Re: operation on module arguments
- From: Brooks Moses
- Re: operation on module arguments
- References:
- operation on module arguments
- From: gottoomanyaccounts
- Re: operation on module arguments
- From: Richard E Maine
- Re: operation on module arguments
- From: Rich Townsend
- Re: operation on module arguments
- From: Richard E Maine
- Re: operation on module arguments
- From: gottoomanyaccounts
- operation on module arguments
- Prev by Date: Re: operation on module arguments
- Next by Date: Re: operation on module arguments
- Previous by thread: Re: operation on module arguments
- Next by thread: Re: operation on module arguments
- Index(es):