It might be inefficient, though. If you change from an array to a linked
list, you could still use an indexed kind of query, but that could be very
inefficient for the linked list and not so for the array.
It's not insurmountable, but if the code was written e.g. assuming that
random access to entries was essentially free, such an assumption would have
to be revisited - and you end up coding differently anyway. So what did the
accessor gain you, then? Of course, if properly written, you wouldn't be
hopping around too much anyway... I don't know. It seems that it's not that
easy to isolate the repercussions of such changes in underlying assumptions.
Alvaro Fernandez
-----Original Message-----
From: Fortran 90 List [mailto:[log in to unmask]] On Behalf Of
Drew McCormack
Sent: Wednesday, March 03, 2004 2:00 AM
To: [log in to unmask]
Subject: Re: Symbols
> Did every one of your abstractions need to be represented by
> procedures?
No, very few. That's why I could get away with not using them. But, if
in the future the implementation changes, I will be back to the old
situation of scanning through the code looking for all references to
the data.
>
> The point of my message <[log in to unmask]>
> was that you don't need to write the accessors until you decide that
> the abstractions can't be represented as components, i.e., not until
> you need to represent them with the equivalent of C# get/put functions/
> updaters. Until then, you don't need the one-liners that bulk up the
> code, increasing development and maintenance costs, and slowing things
> down. To achieve this, uniform syntax of reference is crucial.
> Updaters
> on their own aren't useful unless they have the same syntax of
> reference
> as would the abstractions they implement if they were represented as
> data
> objects.
I fully agree. I like the idea of these updaters. Unfortunately they
are not available in fortran, and I have to make do with hand written
accessors for all data, if I want to garner the benefits of indirection
between data and data access.
Maybe updaters are something for F2013 ;-)
Drew
========================================
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
|