Aleksandar Donev writes:
> Can someone please point to me why accessibility attributes can be set for
> all components in a derived data-type and not on an individual basis:
No, I doubt that anyone can. Other that the "usual" but unhelpful
answer to most questions about why the standard is some way - namely
because that's what is in the version that passed.
In this case, I really can't think of anything much more useful to
say on this. Perhaps the usefulness of such a thing hadn't been
clear to the committee at the time. Perhaps it was just one more
complication in a language already criticised for being complicated.
I don't know.
> I find the need to do this kind of per-component
> accessibility selection rather often...
"Need" seems like an overstatement here. Agree that it would be nice,
but in f95 it is only a nicety. You can always just make the
components public. The only thing it hurts is that the user of the
module now could possibly diddle with components that he shouldn't be.
The private accessibility is nice for protection against such
mistakes, but there isn't anything else that it actually achieves.
Components are different from top-level module names in this regard.
Makeing a top-level module name public can cause name conflicts, but
there can't be such name conflicts with components.
But I do agree that it is a useful feature. And its utility
increases (pretty much to a level that I'd agree was "need") with
the inheritance feature of f2k. F2k does allow such mixed
component accessibility. As to why f90/f95 didn't, I can provide
no further insight.
--
Richard Maine | Good judgement comes from experience;
[log in to unmask] | experience comes from bad judgement.
| -- Mark Twain
|