J3/97-157
Date: 97 April 08
To: J3
From: Loren P. Meissner
Subject: Syntax and Edits for M.6: Extend Initialization Expressions
References: X3J3/96-165
PROPOSAL:
Permit all elemental itrinsics in an initialization expression EXCEPT the math
functions ABS(z), ACOS, ASIN, ATAN, ATAN2, COS, COSH, EXP, LOG, LOG10, SIN,
SINH, SQRT, TAN, TANH.
SYNTAX:
Permit all elemental intrinsic functions in an initialization expression
except ABS with complex argument, ACOS, ASIN, ATAN, ATAN2, COS, COSH, EXP,
LOG, LOG10, SIN, SINH, SQRT, TAN, and TANH.
EDITS:
In 7.1.6.1 under initialization expression replace numbered paragraph (4) with
the following:
(4) A reference to the elemental intrinsic function ABS where the argument is
an initialization expression of type integer or real; or a reference to an
elemental intrinsic function other than ABS, ACOS, ASIN, ATAN, ATAN2, COS,
COSH, EXP, LOG, LOG10, SIN, SINH, SQRT, TAN, or TANH where each argument is an
initialization expression.
BACKGROUND:
At Meeting 138, J3 approved a proposal to permit the conversion intrinsics
INT, REAL, DBLE, and CMPLX in initialization exressions. It was later
suggested that additional intrinsic functions be permitted in initialization
expressions.
At Meeting 139 (see X3J3/96-180, item 2.7), this question was considered
further. The following points were noted: The only intrinsics at question are
the elementals; others except ALLOCATABLE are already permitted. Fortran 95
permits all elemental intrinsics (as well as user-defined PURE functions) in
specification expressions. A traditional viewpoint has been that the compiler
should not be required to have access to the math library; however, this is
perhaps no longer a major concern. Another concern is cross compilation: a
small computer might have trouble simulating complicated operations for
initialization on a larger computer, for example.
The following levels of extension were considered:
1. As in Fortran 95: permit elemental intrinsics that have arguments and
results of integer or character type;
2. As approved at meeting 138, add INT, REAL, DBLE, and CMPLX
3. As above PLUS all other conversion intrinsics: AIMAG, AINT, ANINT, CEILING,
FLOOR, and NINT;
4. All elemental itrinsics EXCEPT the math functions ABS(z), ACOS, ASIN, ATAN,
ATAN2, COS, COSH, EXP, LOG, LOG10, SIN, SINH, SQRT, TAN, TANH;
5. All elemental intrinsics
A series of straw votes favored "at least" level 3 (15-0-1), level 4 (10-2-3),
level 5 (6-7-3); a motion was adopted by unanimous consent to adopt level 4 as
the specification for this requirement. It was noted that this item subsumes
Minor Technical Item M.9: Allow MERGE in constant expressions.