(j3.2006) (SC22WG5.3625) [ukfortran] A comment on John Wallin's comments on Nick MacLaren's comments
Van Snyder
Van.Snyder
Wed Nov 5 19:00:38 EST 2008
On Wed, 2008-11-05 at 15:28 -0800, N.M. Maclaren wrote:
> Anyway, I regard the right solution to this is that every derived type
> should have code and decode primitives, and that you should transfer
> the encoded form. You need them for a great many purposes, including
> unformatted I/O, not just MPI.
>
> > The important thing to note is that every time a grad student adds a
> > single element to the data structure, you have to alter the block
> > counts and sizes by hand.
>
> Sorry, but no. There are better solutions. I agree that none are
> pretty, and all involve enforcing strict discipline on the
> programmers, but they have been known since time immemorial.
> Parameterisation is the key.
Clause 9 of the Fortran standard already does this. It makes my head
hurt to write the encode and decode primitives for every derived type,
and then rewrite them whenever a tiny detail changes. I suppose I could
use internal I/O, which on some systems many years ago was provided by
ENCODE and DECODE statements. I'd rather use coarrays, and if they're
not available I'd rather use unformatted I/O.
--
Van Snyder | What fraction of Americans believe
Van.Snyder at jpl.nasa.gov | Wrestling is real and NASA is fake?
Any alleged opinions are my own and have not been approved or
disapproved by JPL, CalTech, NASA, the President, or anybody else.
More information about the J3
mailing list