J3/13-210
To: J3
From: Van Snyder
Subject: Mixed-kind character concatenation
Date: 2013 December 19
Reference: 12-183r5(9)
Title: Mixed-kind character concatenation
Submitted by: Van Snyder
Status: For consideration
Basic functionality: Allow to concatenate characters of different
kinds, provided the set of characters of the kind with the smaller set
is a subset of the set of characters of the kind with the larger set.
Rationale: Reduces the need for an intermediate named temporary variable
and explicit assignment.
Estimated impact: Minor
Markham M6 conformance: Remove simple deficiency and discrepancy.
Detailed specification: Allow to concatenate characters of different
kinds, provided the set of characters of the kind with the smaller set
is a subset of the set of characters of the kind with the larger set.
Draft edits: To estimate scope of project
Under "Fortran 2008 compatibility", which will presumably be subclause
1.6.2, insert "Prior standards prohibited mixed-kind character
concatenation, and therefore allowed to define the character
concatenation operation for operands of character type with different
kind type parameter values. This standard defines mixed-kind character
concatenation, and therefore prohibits a program to define the character
concatenation operation for operands of character type with different
kind type parameter values if the set of characters of one kind is a
subset of characters of the other kind."
Alternatively (more restrictively): "Prior standards prohibited
mixed-kind character concatenation, and therefore allowed to define the
character concatenation operation for operands of character type with
different kind type parameter values. This standard defines character
concatenation if one operand is of ASCII or default kind and the other
is of ISO 10646 kind, and therefore prohibits a program to define the
character concatenation operation if one operand is of ASCII or default
kind and the other is of ISO 10646 kind."
Alternatively (less restrictively): Replace the final sentence of
12.4.3.4.2p1 ("If the operator is an ...") with "If
the operator is an (R306), the number of function
arguments shall be consistent with the intrinsic uses of that operator
{so far, no change}. If the operator is a unary operator, the type or
kind type parameter values of the dummy argument shall differ from those
required for the intrinsic operation (7.1.5). If the operator is a
binary operator, the dummy arguments shall not both be of numeric type
or not both be of logical type."
In 7.1.5.1p4 replace "with the same kind type parameter." with ". If
the kind type parameters of the operands do not have the same values,
the set of characters of one kind shall be a subset of the set of
characters of the other kind."
Alternatively (more restrictively) in 7.1.5.1p4 after "with the same
kind type parameter" insert ", or one is of ASCII or default kind and
the other is of ISO 10646 kind".
In 7.1.5.3.1p1 replace "with the same kind type parameter." with ". If
the kind type parameters of the operands do not have the same values,
the set of characters of one kind shall be a subset of the set of
characters of the other kind."
Alternatively (more restrictively) in 7.1.5.3p1 after "with the same
kind type parameter" insert ", or one is of ASCII or default kind and
the other is of ISO 10646 kind".
In the first list item in 7.1.9.3p4 replace "and the kind ... x_2" by ".
The kind type parameter of the result is that of x_2 if the set of
characters of the kind of x_2 is larger than the set of characters of
the kind of x_1, or the kind type parameter of x_1 otherwise.
Alternatively (more restrictively) in the first list item in 7.1.9.3p4
replace "and the kind ... x_2" by ". If the kind type parameters of x_1
and x_2 are the same the kind type parameter of the result is that of
x_1, and ISO 10646 otherwise."
If primary (not alternative) edits are used, replace items(5-6) in
7.2.1.2p1 with
"(5) If the variable is of type character, the kind of shall be
the same as the kind of , or of a kind for which the
set of characters is a subset of the set of characters of the
kind of .