Why was SPREAD left out of initialization expressions?

  • Follow


I know RESHAPE is allowed in Fortran-95+ initialization expressions,
but why is its "cousin" SPREAD not allowed?

Al Greynolds
www.ruda-cardinal.com
0
Reply Al 6/17/2010 7:09:29 PM

On 6/17/10 2:09 PM, Al Greynolds wrote:
> I know RESHAPE is allowed in Fortran-95+ initialization expressions,
> but why is its "cousin" SPREAD not allowed?
>
> Al Greynolds
> www.ruda-cardinal.com
I'm not sure there is an answer (other than "that's the way people 
voted").  The list of allowed transformational intrinsics was
kept "small" to avoid making compile-time computations more
"complicated" than "necessary".  Probably nobody asked about
SPREAD or, if they did, it didn't make the cut to keep the list
small.

In Fortran 90 and 95 constant expressions and initialization
expressions were (hopelessly, IMO) muddled in the standard.
The term "constant expression" was never really used in F95, other
than as a way to describe other constant expressions (an array
constructor where every term in a constant expression is a
constant array constructor, duh!).  Whenever a value actually
had to be known at compile-time, "initialization expression" was
used.

By F2003 the term "constant expression" was removed from the
standard in favor of initialization and specification
expressions.  And both forms allow any intrinsic function as
long as the arguments are restricted enough.

IN F2008, constant expressions are back and initialization
expressions are out.  All of the reasonable transformational
intrinsics are allowed in constant expressions.

Stay tuned for the F2013 expression names!

Dick Hendrickson
0
Reply Dick 6/17/2010 9:12:21 PM


1 Replies
198 Views

(page loaded in 0.046 seconds)

Similiar Articles:













7/25/2012 2:43:05 AM


Reply: