|
From: James Giles on 1 Feb 2008 16:41 James Giles wrote: .... > The following has been discussed before and I think was determined > to be non-standard for the same reason: > > Real :: X(5), Y(size(x)) By Steve's response it's clear that I mis-remembered the case. The one that I recalled must have been something like: Real :: X(4) = size(X) I still stand by the observation: > Even if such things were standard, I would avoid then for legibility > reasons. -- J. Giles "I conclude that there are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies." -- C. A. R. Hoare
From: Tobias Burnus on 1 Feb 2008 04:55 On Jan 31, 10:23 pm, Steve Lionel <steve.lio...(a)intel.com> wrote: > On Jan 31, 7:38 am, Tobias Burnus <bur...(a)net-b.de> wrote: > > Is the following code valid or not? [...] > We've been here before. Here's the text of Interp 00090 against F95 > discussing this issue. The text was clarified in F2003. Thanks for the pointer. Then I initially read the standard correctly but as all compilers allowed more - even those regarded as picky, I thought that I misread the standard and tried to make sense of of it - with little success. > I'll comment for the record that Intel Fortran doesn't get all the cases > right either in that we accept and do not warn about certain non-standard > usages. We intend to fix that in a future release. Ditto for gfortran. On Jan 31, 10:41 pm, "James Giles" <jamesgi...(a)worldnet.att.net> wrote: > James Giles wrote: > I still stand by the observation: > > Even if such things were standard, I would avoid then for legibility > > reasons. Well, my question was motivated by deciding whether gfortran needs to be fixed (for -std=f95/f2003 at least). I did and do not intent to use such constructs. Although I have to admit that I find things like the following rather convenient: real :: a(1,1,1,2) = reshape( [1.0, 2.0], shape(a) ) Thanks again Steve and James! Tobias
From: James Giles on 1 Feb 2008 13:43 Tobias Burnus wrote: .... > Although I have to admit that I find things like the following rather > convenient: > > real :: a(1,1,1,2) = reshape( [1.0, 2.0], shape(a) ) Yes it is irritating that it doesn't work. It's a peculiar asymmetry that [ARRAY] is valid regardless of the rank of ARRAY, but ARRAY = [anything] is not valid if ARRAY is not rank 1. I think that array constructors should interoperate with arrays of any rank provided the size is correct. Elements line up in array element order, of course. -- J. Giles "I conclude that there are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies." -- C. A. R. Hoare
|
Pages: 1 Prev: computing Bernoulli numbers Next: Which direction is Fortran going? |