Skip to content

Commit 052de18

Browse files
committed
Updates from subgroup 2025-04-21
1 parent 44ffd76 commit 052de18

File tree

1 file changed

+106
-71
lines changed

1 file changed

+106
-71
lines changed

J3-Papers/edits/25-112_misc.txt

Lines changed: 106 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -350,19 +350,30 @@ UTI: The following section was well intended but cast too large of a
350350
<constant-expr> is syntactically equivalent."
351351

352352
deferred integer, parameter :: C
353+
deferred integer, parameter :: R
354+
integer, parameter :: R2 = C
355+
356+
real, rank(R), allocatable :: x
357+
358+
select rank (x)
359+
rank is (0)
360+
rank is (1)
361+
rank is (2)
362+
rank is (3)
353363
...
354-
integer :: i
355-
i = 5
356-
do i = 1, 10
357-
if (C == i) ...
358-
if (C == C) ...
359-
end do
364+
end select rank
360365

361-
deferred integer, parameter :: C1
362-
deferred integer, parameter :: C2 = C1 + 1 - 1
366+
real, rank(C), allocatable :: y
367+
real, rank(R2), allocatable :: z
363368

364-
if (C1 == C2) then ...
369+
if (rank(x) == rank(y)) then
370+
...
371+
end if
372+
if (rank(z) == rank(y)) then
373+
...
374+
end if
365375

376+
template tmpl(C)
366377

367378
* 11.1.11.1 Purpose and form of the SELECT TYPE construct
368379

@@ -403,37 +414,56 @@ UTI: spelling of <inline-instantiate> vs <inline-instantiation>
403414
<<or>> <deferred-proc>
404415
<<or>> <inline-instantiate>
405416

406-
407-
<<< we got to here on 2025-04-14 >>>>>
417+
UTI - the section disction between 2 & 3 here are probably fiction at
418+
this point.
408419

409420
3. Edits required for templates and instantiation
410421
=================================================
411422

412423
* 5.1 High level syntax
413424

414-
Extend R508 <specification-construct> to include:
415-
<<or>> <template>
416-
<<or>> <requirement>
417-
<<or>> <instantiate-stmt>
418-
419-
Extend R512 to be:
420-
R512 <internal-subprogram>
425+
Extend R508 <specification-construct> to include new syntax terms:
426+
<template>, <require-stmt>, <requirement> and
427+
<instantiation-stmt>, such that it now reads:
428+
429+
"R508 <specification-construct> <<is>> <derived-type-def>
430+
<<or>> <enum-def>
431+
<<or>> <enumeration-type-def>
432+
<<or>> <generic-stmt>
433+
<<or>> <interface-block>
434+
<<or>> <parameter-stmt>
435+
<<or>> <procedure-declaration-stmt>
436+
<<or>> <other-specification-stmt>
437+
<<or>> <type-declaration-stmt>
438+
<<or>> <template>
439+
<<or>> <require-stmt>
440+
<<or>> <requirement>
441+
<<or>> <instantiate-stmt>
442+
"
443+
444+
{ Allowing REQUIRE outside of templates is not something that has been
445+
discussed in plenary, but seems to be a natural thing to allow to
446+
generics subgroup. It would provide a means for library developer
447+
to ensure that their product meets certain requirements without
448+
regard to any specific (external) template.}
449+
450+
Extend R512 to include templated procedures such that it now reads:
451+
452+
453+
"R512 <internal-subprogram>
421454
<<is>> <function-subprogram>
422455
<<or>> <subroutine-subprogram>
423456
<<or>> <templated-subroutine-subprogram>
424-
<<or>> <templated-function-subprogram>
457+
<<or>> <templated-function-subprogram>"
425458

426459

427460
* 8.7 IMPLICIT Statement
428461

429-
Modify last sentence in para 3 on page 127 from:
430-
If a mapping is not specified for a letter, the default
431-
for a program unit or an interface body is default integer if the
432-
letter is I, J, ..., or N and default real otherwise, and the default
433-
for a BLOCK construct, internal subprogram, or module subprogram is
434-
the mapping in the host scoping unit.
435-
To:
436-
If a mapping is not specified for a letter, the default mapping of
462+
Change last sentence of paragraph 3 on page 127 and add 2 new
463+
paragraphs to specify that there is no default mapping inside
464+
templates and templated procedures. It should now read:
465+
466+
"If a mapping is not specified for a letter, the default mapping of
437467
- a program unit, or
438468
- an interface body outside a template scoping unit or templated
439469
subprogram
@@ -447,72 +477,77 @@ UTI: spelling of <inline-instantiate> vs <inline-instantiation>
447477
The mapping for a template construct, a templated subprogram, or
448478
an interface body that appears within a template or templated
449479
subprogram is the null mapping.
480+
"
450481

451482
* 8.8p2 IMPORT Statement
452483

453-
Modify sentence 2 in p2 from:
454-
This is the default for an interface body that is not a module
455-
procedure interface body.
456-
To:
457-
This is the default for an interface body that is not a module
458-
procedure interface body or an interface body that appears in a
459-
deferred interface block.
460-
461-
Modify sentence 2 in p4 from:
462-
This is the default for a derived-type definition, internal
463-
subprogram, module procedure interface body, module subprogram,
464-
or submodule.
465-
To:
466-
This is the default for a derived-type definition, internal
467-
subprogram, module procedure interface body, module subprogram,
468-
submodule, or an interface body that appears in a deferred
469-
interface block.
484+
Modify sentence 2 in p2 to include deferred interface blocks, such
485+
that it now reads:
486+
487+
"This is the default for an interface body that is not a module
488+
procedure interface body or an interface body that appears in a
489+
deferred interface block."
490+
491+
Modify sentence 2 in p4 to include deferred interface blocks, such
492+
that it now reads:
493+
494+
"This is the default for a derived-type definition, internal
495+
subprogram, module procedure interface body, module subprogram,
496+
submodule, or an interface body that appears in a deferred
497+
interface block."
470498

471499

472500
* 14.2.1 Module syntax and semantics
473501

474-
Modify R1408 to become:
475-
R1408 <module-subprogram>
502+
Extend list in R1408 to include templated procedures, such that it
503+
now reads:
504+
505+
"R1408 <module-subprogram>
476506
<<is>> <function-subprogram>
477507
<<or>> <subroutine-subprogram>
478508
<<or>> <separate-module-subprogram>
479509
<<or>> <templated-function-subprogram>
480-
<<or>> <templated-subroutine-subprogram>
510+
<<or>> <templated-subroutine-subprogram>"
481511

482512
* 15.4.3.2 Interface block
483513

484-
Change R1503 from:
485-
R1503 <interface-stmt> <<is>> INTERFACE [ <generic-spec> ]
486-
<<or>> ABSTRACT INTERFACE
487-
To:
488-
R1503 <interface-stmt> <<is>> INTERFACE [ <generic-spec> ]
489-
<<or>> ABSTRACT INTERFACE
490-
<<or>> DEFERRED INTERFACE
514+
Extend list in R1503 to include deferred interface, such that it
515+
now reads:
516+
517+
"R1503 <interface-stmt> <<is>> INTERFACE [ <generic-spec> ]
518+
<<or>> ABSTRACT INTERFACE
519+
<<or>> DEFERRED INTERFACE"
491520

492-
Change final sentence in para 2 such that the sentence reads:
493-
An interface block without ABSTRACT, DEFERRED, or a generic
494-
specification is a specific interface block.
521+
Change last sentence of para 2 to include DEFERRED interfaces such
522+
that it now reads:
495523

524+
"An interface block without ABSTRACT, DEFERRED, or a generic
525+
specification is a specific interface block."
496526

497-
Add after para 2:
498-
An interface block introduced by DEFERRED INTERFACE is a deferred
499-
interface block. An interface body in a deferred interface block
500-
specifies a deferred procedure.
527+
528+
After para 2, insert new paragraph:
529+
530+
"An interface block introduced by DEFERRED INTERFACE is a deferred
531+
interface block. An interface body in a deferred interface block
532+
specifies a deferred procedure."
533+
534+
<<< Got here on 2024-04-21. Need to decide right section for below. >>>
501535

502536
* 15.4.3.4.5 Restrictions on generic declarations
503537

504-
[317:10+] Insert new paragraphs:
538+
[317:10+] Insert new paragraphs to address deferred arguments:
539+
540+
"An entity with a kind-type parameter whose value depends on a
541+
deferred argument is only TKR compatible with another entity,
542+
if that entity has the same kind-type parameter declared with
543+
a syntactically equivalent expression.
505544

506-
An entity whose kind depends on a deferred argument does not have
507-
the same kind as any other entity, unless that entity has its kind
508-
defined with a syntactically equivalent expression.
545+
An entity whose rank depends on a deferred argument is only TKR
546+
compatible with another entity, if that entity has its rank
547+
declared with a syntactically equivalent expression. If the rank
548+
of an implied-rank entity is not declared with a rank clause, it
549+
does not have the same rank as any other entity."
509550

510-
An entity whose rank depends on a deferred argument does not have
511-
the same rank as any other entity, unless that entity has its rank
512-
defined with a syntactically equivalent expression. If the rank of
513-
an implied-rank entity is not declared with a rank clause, it is
514-
considered to have no expression for its rank, and therefore does
515-
not have the same rank as any other entity.
516551

517552
{ Is "depends on" acceptable terminology here? }
518553

0 commit comments

Comments
 (0)