I used to think it is nice in Fortran 90 to extent the idea of
array size to include zero size. Now I realize it may be not as
trivial as it seems to a programmer, thanks for this discussion!
Clearly it may be a very useful concept to some applications, it is
also true that for many applications, an array of size zero might just
not the programmer had in mind when he/she wrote the code. I would
bet that in many cases, the programmer won't even think about its
possible implications to their programs. I did not until this
discussion. It seems to me that not all runtime library developers
have realized the implication yet. It won't surprise me if some popular
ready-to-use source codes for numerical algorithms turned out to be
problematic with zero-sized array arguments.
The basic fact is, a zero-sized array used to be an _exception_, but
not any more! An application program used to crash on zero-sized
arrays, may now keep going and may even give a result. (It is good
or bad, depends on your applications.)
For a progammer, for the least, he/she may have to add addtional lines
to assert the conditions of the argument sized zeroes, if he/she
happens to understand the implications and happens to know the
algorithm's applicability with zero-sized arrays.
I have no intention to either suggest if the language feature is right
or wrong, or even to say I like it or not (I don't know). I mearly want
to state a fact that I noticed only after this discussion. (Which may
not have much to do with MATMUL() anymore, I am sorry!)
Humm, I thought I knew Fortran 90 already!
Jing
--
________________________________ _-__-_-_ _-___---
Jing Guo, [log in to unmask], (301)805-8333(o), (301)805-7960(fx)
Data Assimilation Office, Code 910.3, NASA/GSFC, Greenbelt, MD 20771
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|