@@ -350,19 +350,30 @@ UTI: The following section was well intended but cast too large of a
350
350
<constant-expr> is syntactically equivalent."
351
351
352
352
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)
353
363
...
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
360
365
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
363
368
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
365
375
376
+ template tmpl(C)
366
377
367
378
* 11.1.11.1 Purpose and form of the SELECT TYPE construct
368
379
@@ -403,37 +414,56 @@ UTI: spelling of <inline-instantiate> vs <inline-instantiation>
403
414
<<or>> <deferred-proc>
404
415
<<or>> <inline-instantiate>
405
416
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.
408
419
409
420
3. Edits required for templates and instantiation
410
421
=================================================
411
422
412
423
* 5.1 High level syntax
413
424
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>
421
454
<<is>> <function-subprogram>
422
455
<<or>> <subroutine-subprogram>
423
456
<<or>> <templated-subroutine-subprogram>
424
- <<or>> <templated-function-subprogram>
457
+ <<or>> <templated-function-subprogram>"
425
458
426
459
427
460
* 8.7 IMPLICIT Statement
428
461
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
437
467
- a program unit, or
438
468
- an interface body outside a template scoping unit or templated
439
469
subprogram
@@ -447,72 +477,77 @@ UTI: spelling of <inline-instantiate> vs <inline-instantiation>
447
477
The mapping for a template construct, a templated subprogram, or
448
478
an interface body that appears within a template or templated
449
479
subprogram is the null mapping.
480
+ "
450
481
451
482
* 8.8p2 IMPORT Statement
452
483
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."
470
498
471
499
472
500
* 14.2.1 Module syntax and semantics
473
501
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>
476
506
<<is>> <function-subprogram>
477
507
<<or>> <subroutine-subprogram>
478
508
<<or>> <separate-module-subprogram>
479
509
<<or>> <templated-function-subprogram>
480
- <<or>> <templated-subroutine-subprogram>
510
+ <<or>> <templated-subroutine-subprogram>"
481
511
482
512
* 15.4.3.2 Interface block
483
513
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"
491
520
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:
495
523
524
+ "An interface block without ABSTRACT, DEFERRED, or a generic
525
+ specification is a specific interface block."
496
526
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. >>>
501
535
502
536
* 15.4.3.4.5 Restrictions on generic declarations
503
537
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.
505
544
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."
509
550
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.
516
551
517
552
{ Is "depends on" acceptable terminology here? }
518
553
0 commit comments