Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

FORTH IF HONK THEN


devel / comp.lang.fortran / Re: name resolution of components within derived type definition

SubjectAuthor
* name resolution of components within derived type definitionPeter Klausler US
+* Re: name resolution of components within derived type definitionFortranFan
|`* Re: name resolution of components within derived type definitionFortranFan
| `* Re: name resolution of components within derived type definitionPeter Klausler US
|  `* Re: name resolution of components within derived type definitionFortranFan
|   `* Re: name resolution of components within derived type definitionPeter Klausler US
|    `* Re: name resolution of components within derived type definitionFortranFan
|     `* Re: name resolution of components within derived type definitionPeter Klausler US
|      `- Re: name resolution of components within derived type definitionFortranFan
`* Re: name resolution of components within derived type definitiongah4
 `- Re: name resolution of components within derived type definitionPeter Klausler US

1
name resolution of components within derived type definition

<9dcab2f9-ed2d-4613-9fda-e0785500dab5n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2972&group=comp.lang.fortran#2972

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:6214:c42:b0:4b4:189:363d with SMTP id r2-20020a0562140c4200b004b40189363dmr5148576qvj.25.1665770316917;
Fri, 14 Oct 2022 10:58:36 -0700 (PDT)
X-Received: by 2002:ac8:5f47:0:b0:399:aa82:3c6f with SMTP id
y7-20020ac85f47000000b00399aa823c6fmr5243511qta.627.1665770306465; Fri, 14
Oct 2022 10:58:26 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Fri, 14 Oct 2022 10:58:26 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=12.154.207.45; posting-account=ZT-cAwoAAACx2tBPXm-WZoHIT8sjnGGy
NNTP-Posting-Host: 12.154.207.45
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9dcab2f9-ed2d-4613-9fda-e0785500dab5n@googlegroups.com>
Subject: name resolution of components within derived type definition
From: pklausler@nvidia.com (Peter Klausler US)
Injection-Date: Fri, 14 Oct 2022 17:58:36 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2678
 by: Peter Klausler US - Fri, 14 Oct 2022 17:58 UTC

F'2018 subclause 19.3.4 paragraph 1 says that "A component name has the scope of its derived-type definition" which seems pretty clear to me, but it doesn't seem to apply in the way that I would expect with many Fortran compilers. Shouldn't all of these uses of component names in a derived type definition resolve to the components with those names, rather than to the names in the enclosing scope?

implicit double precision(b)
integer, parameter :: k1 = selected_int_kind(1)
integer, parameter :: kd = kind(0)

integer(k1) :: foo

type t
integer(kd) foo
integer(kind(foo)) bar
integer(k1) :: baz = kind(foo)
integer :: quux = kind(baz)
end type
type(t) x

if (k1 == kd) stop 'rats'

if (kind(x%bar) == k1) then
print *, "kind(foo) resolves to outer foo for bar"
else if (kind(x%bar) == kd) then
print *, "kind(foo) resolves to inner foo for bar"
else
print *, "can't tell name resolution of foo for bar"
end if
if (x%baz == k1) then
print *, "kind(foo) resolves to outer foo for baz"
else if (x%baz == kd) then
print *, "kind(foo) resolves to inner foo for baz"
else
print *, "can't tell name resolution of foo for baz"
end if
if (k1 == kind(0.d0)) then
print *, "can't tell name resolution of baz for quux because k1 == kind(0.d0)"
else if (x%quux == k1) then
print *, "kind(baz) resolves to inner baz for quux"
else if (x%quux == kind(0.d0)) then
print *, "kind(baz) resolves to implicit outer baz for quux"
else
print *, "can't tell name resolution of baz for quux"
end if
end

Re: name resolution of components within derived type definition

<7448b810-a112-4a89-b64a-04202616e2dan@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2973&group=comp.lang.fortran#2973

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:622a:1394:b0:393:b004:3d15 with SMTP id o20-20020a05622a139400b00393b0043d15mr5433133qtk.436.1665772850418;
Fri, 14 Oct 2022 11:40:50 -0700 (PDT)
X-Received: by 2002:a05:620a:4414:b0:6ee:76e4:1b6d with SMTP id
v20-20020a05620a441400b006ee76e41b6dmr4600882qkp.360.1665772850231; Fri, 14
Oct 2022 11:40:50 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Fri, 14 Oct 2022 11:40:49 -0700 (PDT)
In-Reply-To: <9dcab2f9-ed2d-4613-9fda-e0785500dab5n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=136.226.53.28; posting-account=ZZXq9AoAAAAQEcA7zKAGm0UFQh4gMBv7
NNTP-Posting-Host: 136.226.53.28
References: <9dcab2f9-ed2d-4613-9fda-e0785500dab5n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7448b810-a112-4a89-b64a-04202616e2dan@googlegroups.com>
Subject: Re: name resolution of components within derived type definition
From: parekhvs@gmail.com (FortranFan)
Injection-Date: Fri, 14 Oct 2022 18:40:50 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2185
 by: FortranFan - Fri, 14 Oct 2022 18:40 UTC

On Friday, October 14, 2022 at 1:58:38 PM UTC-4, Peter Klausler US wrote:

> F'2018 subclause 19.3.4 paragraph 1 says that "A component name has the scope of its derived-type definition" which seems pretty clear to me, but it doesn't seem to apply in the way that I would expect with many Fortran compilers. Shouldn't all of these uses of component names in a derived type definition resolve to the components with those names, rather than to the names in the enclosing scope? ..

@Peter Klausler US,

There was a discussion at the J3 Fortran mailing list a couple of months ago whether the editor of the standard (and the chair of the /DATA subgroup) and the de facto final authority on such matters in the language chimed in and whose brief response I reckon covers your inquiry here also: you know the drill, for further details there is the standard and the words in it.

https://mailman.j3-fortran.org/pipermail/j3/2022-August/013836.html

Re: name resolution of components within derived type definition

<a0b7e3e3-3ddc-48f0-886f-0cdc1851f908n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2974&group=comp.lang.fortran#2974

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:622a:4cb:b0:388:aaf0:62bd with SMTP id q11-20020a05622a04cb00b00388aaf062bdmr5499736qtx.337.1665773339762;
Fri, 14 Oct 2022 11:48:59 -0700 (PDT)
X-Received: by 2002:a05:6214:ac5:b0:4b3:203b:7393 with SMTP id
g5-20020a0562140ac500b004b3203b7393mr5384721qvi.63.1665773339508; Fri, 14 Oct
2022 11:48:59 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Fri, 14 Oct 2022 11:48:59 -0700 (PDT)
In-Reply-To: <7448b810-a112-4a89-b64a-04202616e2dan@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=136.226.49.17; posting-account=ZZXq9AoAAAAQEcA7zKAGm0UFQh4gMBv7
NNTP-Posting-Host: 136.226.49.17
References: <9dcab2f9-ed2d-4613-9fda-e0785500dab5n@googlegroups.com> <7448b810-a112-4a89-b64a-04202616e2dan@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a0b7e3e3-3ddc-48f0-886f-0cdc1851f908n@googlegroups.com>
Subject: Re: name resolution of components within derived type definition
From: parekhvs@gmail.com (FortranFan)
Injection-Date: Fri, 14 Oct 2022 18:48:59 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2351
 by: FortranFan - Fri, 14 Oct 2022 18:48 UTC

On Friday, October 14, 2022 at 2:40:52 PM UTC-4, FortranFan wrote:
> ..
> There was a discussion at the J3 Fortran mailing list a couple of months ago *where* the editor of the standard (and the chair of the /DATA subgroup) and the de facto final authority on such matters in the language chimed in and whose brief response I reckon covers your inquiry here also: you know the drill, for further details there is the standard and the words in it.
>
> https://mailman.j3-fortran.org/pipermail/j3/2022-August/013836.html

The following example might help in that the editor, per the comments above, would convey the processor here conforms in what it does with the program:

implicit none !<-- note this
integer, parameter :: ik = kind(0)
type :: t
integer(kind=ik) :: foo
integer(kind=kind(foo)) :: bar !<-- what is 'foo' here?
end type
end

C:\temp>gfortran -c p.f90
p.f90:5:27:

5 | integer(kind=kind(foo)) :: bar
| 1
Error: Symbol 'foo' at (1) has no IMPLICIT type

Re: name resolution of components within derived type definition

<1b141ebb-a5ea-49c9-89ba-97669a29290an@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2975&group=comp.lang.fortran#2975

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a0c:dd06:0:b0:4b1:a51c:e7d8 with SMTP id u6-20020a0cdd06000000b004b1a51ce7d8mr5531295qvk.11.1665773787409;
Fri, 14 Oct 2022 11:56:27 -0700 (PDT)
X-Received: by 2002:a05:622a:15c4:b0:35b:b493:f8fb with SMTP id
d4-20020a05622a15c400b0035bb493f8fbmr5617324qty.300.1665773787255; Fri, 14
Oct 2022 11:56:27 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Fri, 14 Oct 2022 11:56:27 -0700 (PDT)
In-Reply-To: <a0b7e3e3-3ddc-48f0-886f-0cdc1851f908n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=12.154.207.45; posting-account=ZT-cAwoAAACx2tBPXm-WZoHIT8sjnGGy
NNTP-Posting-Host: 12.154.207.45
References: <9dcab2f9-ed2d-4613-9fda-e0785500dab5n@googlegroups.com>
<7448b810-a112-4a89-b64a-04202616e2dan@googlegroups.com> <a0b7e3e3-3ddc-48f0-886f-0cdc1851f908n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1b141ebb-a5ea-49c9-89ba-97669a29290an@googlegroups.com>
Subject: Re: name resolution of components within derived type definition
From: pklausler@nvidia.com (Peter Klausler US)
Injection-Date: Fri, 14 Oct 2022 18:56:27 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1698
 by: Peter Klausler US - Fri, 14 Oct 2022 18:56 UTC

19.3.4 "A component name has the scope of its derived-type definition. Outside the type definition, it may also appear within a designator of a component of a structure of that type or as a component keyword in a structure constructor for that type."

That first sentence must mean *something*, and the second sentence's "it may also appear" implies that a component name *can* appear with a derived type definition.

Re: name resolution of components within derived type definition

<eedba836-8f8a-477d-8439-ddd78e1f18c9n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2976&group=comp.lang.fortran#2976

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ac8:5dd3:0:b0:393:44ed:f9e6 with SMTP id e19-20020ac85dd3000000b0039344edf9e6mr5712910qtx.651.1665776785070;
Fri, 14 Oct 2022 12:46:25 -0700 (PDT)
X-Received: by 2002:ad4:5d48:0:b0:4b1:bbaf:bb53 with SMTP id
jk8-20020ad45d48000000b004b1bbafbb53mr5463644qvb.16.1665776784864; Fri, 14
Oct 2022 12:46:24 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Fri, 14 Oct 2022 12:46:24 -0700 (PDT)
In-Reply-To: <1b141ebb-a5ea-49c9-89ba-97669a29290an@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=136.226.61.22; posting-account=ZZXq9AoAAAAQEcA7zKAGm0UFQh4gMBv7
NNTP-Posting-Host: 136.226.61.22
References: <9dcab2f9-ed2d-4613-9fda-e0785500dab5n@googlegroups.com>
<7448b810-a112-4a89-b64a-04202616e2dan@googlegroups.com> <a0b7e3e3-3ddc-48f0-886f-0cdc1851f908n@googlegroups.com>
<1b141ebb-a5ea-49c9-89ba-97669a29290an@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <eedba836-8f8a-477d-8439-ddd78e1f18c9n@googlegroups.com>
Subject: Re: name resolution of components within derived type definition
From: parekhvs@gmail.com (FortranFan)
Injection-Date: Fri, 14 Oct 2022 19:46:25 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2326
 by: FortranFan - Fri, 14 Oct 2022 19:46 UTC

On Friday, October 14, 2022 at 2:56:29 PM UTC-4, Peter Klausler US wrote:

> 19.3.4 "A component name has the scope of its derived-type definition. Outside the type definition, it may also appear within a designator of a component of a structure of that type or as a component keyword in a structure constructor for that type."
>
> That first sentence must mean *something*, and the second sentence's "it may also appear" implies that a component name *can* appear with a derived type definition.

You can seek further clarification with the committee but chances are nearly 100% that

a) re: "That first sentence must mean *something*", the "something" will *not* extend to instructions such as 'integer(kind(foo)) bar' in the code snippet in your original post.

b) re: "the second sentence's "it may also appear"" does not refer to "type definition" but to a "structure" and a constructor for it where the "structure" - per the standard - is a scalar data object of a derived type.

Re: name resolution of components within derived type definition

<a59fa73d-6878-401a-b008-57a47f6a4ecbn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2977&group=comp.lang.fortran#2977

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:6214:1c44:b0:4b3:203b:7383 with SMTP id if4-20020a0562141c4400b004b3203b7383mr5392810qvb.69.1665777547445;
Fri, 14 Oct 2022 12:59:07 -0700 (PDT)
X-Received: by 2002:a0c:abc7:0:b0:4b4:8d4e:d2f8 with SMTP id
k7-20020a0cabc7000000b004b48d4ed2f8mr5641202qvb.43.1665777547308; Fri, 14 Oct
2022 12:59:07 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Fri, 14 Oct 2022 12:59:07 -0700 (PDT)
In-Reply-To: <eedba836-8f8a-477d-8439-ddd78e1f18c9n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=12.154.207.45; posting-account=ZT-cAwoAAACx2tBPXm-WZoHIT8sjnGGy
NNTP-Posting-Host: 12.154.207.45
References: <9dcab2f9-ed2d-4613-9fda-e0785500dab5n@googlegroups.com>
<7448b810-a112-4a89-b64a-04202616e2dan@googlegroups.com> <a0b7e3e3-3ddc-48f0-886f-0cdc1851f908n@googlegroups.com>
<1b141ebb-a5ea-49c9-89ba-97669a29290an@googlegroups.com> <eedba836-8f8a-477d-8439-ddd78e1f18c9n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a59fa73d-6878-401a-b008-57a47f6a4ecbn@googlegroups.com>
Subject: Re: name resolution of components within derived type definition
From: pklausler@nvidia.com (Peter Klausler US)
Injection-Date: Fri, 14 Oct 2022 19:59:07 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2752
 by: Peter Klausler US - Fri, 14 Oct 2022 19:59 UTC

On Friday, October 14, 2022 at 12:46:26 PM UTC-7, FortranFan wrote:
> On Friday, October 14, 2022 at 2:56:29 PM UTC-4, Peter Klausler US wrote:
>
> > 19.3.4 "A component name has the scope of its derived-type definition. Outside the type definition, it may also appear within a designator of a component of a structure of that type or as a component keyword in a structure constructor for that type."
> >
> > That first sentence must mean *something*, and the second sentence's "it may also appear" implies that a component name *can* appear with a derived type definition.
> You can seek further clarification with the committee but chances are nearly 100% that
>
> a) re: "That first sentence must mean *something*", the "something" will *not* extend to instructions such as 'integer(kind(foo)) bar' in the code snippet in your original post.
>
> b) re: "the second sentence's "it may also appear"" does not refer to "type definition" but to a "structure" and a constructor for it where the "structure" - per the standard - is a scalar data object of a derived type.

https://dictionary.cambridge.org/us/dictionary/english/also - adverb, "in addition to".

Further, type parameter names of a type are in exactly the same scope as its component names, and type parameter names obviously can be used in the scope of a type definition.

Re: name resolution of components within derived type definition

<b4ecf2b4-11ed-4509-ae2e-4a9d516906cfn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2978&group=comp.lang.fortran#2978

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:254f:b0:6cf:9b54:11dd with SMTP id s15-20020a05620a254f00b006cf9b5411ddmr5230663qko.55.1665781223338;
Fri, 14 Oct 2022 14:00:23 -0700 (PDT)
X-Received: by 2002:a05:620a:bc2:b0:6cf:468e:b8ce with SMTP id
s2-20020a05620a0bc200b006cf468eb8cemr5090284qki.699.1665781223042; Fri, 14
Oct 2022 14:00:23 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Fri, 14 Oct 2022 14:00:22 -0700 (PDT)
In-Reply-To: <9dcab2f9-ed2d-4613-9fda-e0785500dab5n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:40a9:7496:bb9c:93f7;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:40a9:7496:bb9c:93f7
References: <9dcab2f9-ed2d-4613-9fda-e0785500dab5n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b4ecf2b4-11ed-4509-ae2e-4a9d516906cfn@googlegroups.com>
Subject: Re: name resolution of components within derived type definition
From: gah4@u.washington.edu (gah4)
Injection-Date: Fri, 14 Oct 2022 21:00:23 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2477
 by: gah4 - Fri, 14 Oct 2022 21:00 UTC

On Friday, October 14, 2022 at 10:58:38 AM UTC-7, Peter Klausler US wrote:
> F'2018 subclause 19.3.4 paragraph 1 says that "A component name
> has the scope of its derived-type definition" which seems pretty clear to me,
> but it doesn't seem to apply in the way that I would expect with many
> Fortran compilers. Shouldn't all of these uses of component names in a
> derived type definition resolve to the components with those names,
> rather than to the names in the enclosing scope?

(snip

> type t
> integer(kd) foo
> integer(kind(foo)) bar
> integer(k1) :: baz = kind(foo)
> integer :: quux = kind(baz)
> end type
This isn't so obvious to me.

It might be that the foo inside the structure definition doesn't exist
until after the "end type".

There is a special rule in C that allows structures to have pointers
to their own struct type, even though the struct isn't defined yet.

I suspect you have to read the rules a lot more carefully, to know
exactly when the inside foo exists, enough for kind to apply.
(And as your example shows, it might be different for KIND
than for initializers.)

It is hard for compiler writers to get this right, and so
my best guess is 50% chance you are right and the compiler
wrong.

Re: name resolution of components within derived type definition

<e3558367-6955-4d93-9bf2-885e336ce545n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2981&group=comp.lang.fortran#2981

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:6214:518c:b0:4b1:88f8:b6a4 with SMTP id kl12-20020a056214518c00b004b188f8b6a4mr6204822qvb.0.1665785335036;
Fri, 14 Oct 2022 15:08:55 -0700 (PDT)
X-Received: by 2002:ac8:5208:0:b0:399:5248:aad2 with SMTP id
r8-20020ac85208000000b003995248aad2mr6077691qtn.449.1665785334884; Fri, 14
Oct 2022 15:08:54 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Fri, 14 Oct 2022 15:08:54 -0700 (PDT)
In-Reply-To: <b4ecf2b4-11ed-4509-ae2e-4a9d516906cfn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=12.154.207.45; posting-account=ZT-cAwoAAACx2tBPXm-WZoHIT8sjnGGy
NNTP-Posting-Host: 12.154.207.45
References: <9dcab2f9-ed2d-4613-9fda-e0785500dab5n@googlegroups.com> <b4ecf2b4-11ed-4509-ae2e-4a9d516906cfn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e3558367-6955-4d93-9bf2-885e336ce545n@googlegroups.com>
Subject: Re: name resolution of components within derived type definition
From: pklausler@nvidia.com (Peter Klausler US)
Injection-Date: Fri, 14 Oct 2022 22:08:55 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1489
 by: Peter Klausler US - Fri, 14 Oct 2022 22:08 UTC

On Friday, October 14, 2022 at 2:00:25 PM UTC-7, gah4 wrote:
> It is hard for compiler writers to get this right, and so
> my best guess is 50% chance you are right and the compiler
> wrong.

Well, I'm writing the compiler, so I hope that it's both or neither.

Re: name resolution of components within derived type definition

<843a2eec-5afc-4939-9a25-222275bfa1c7n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2986&group=comp.lang.fortran#2986

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a0c:df11:0:b0:4b4:ccd:ad5a with SMTP id g17-20020a0cdf11000000b004b40ccdad5amr2209744qvl.111.1665846584261;
Sat, 15 Oct 2022 08:09:44 -0700 (PDT)
X-Received: by 2002:a37:a98b:0:b0:6eb:c2c5:7af6 with SMTP id
s133-20020a37a98b000000b006ebc2c57af6mr2012216qke.409.1665846584006; Sat, 15
Oct 2022 08:09:44 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sat, 15 Oct 2022 08:09:43 -0700 (PDT)
In-Reply-To: <a59fa73d-6878-401a-b008-57a47f6a4ecbn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=108.52.103.144; posting-account=ZZXq9AoAAAAQEcA7zKAGm0UFQh4gMBv7
NNTP-Posting-Host: 108.52.103.144
References: <9dcab2f9-ed2d-4613-9fda-e0785500dab5n@googlegroups.com>
<7448b810-a112-4a89-b64a-04202616e2dan@googlegroups.com> <a0b7e3e3-3ddc-48f0-886f-0cdc1851f908n@googlegroups.com>
<1b141ebb-a5ea-49c9-89ba-97669a29290an@googlegroups.com> <eedba836-8f8a-477d-8439-ddd78e1f18c9n@googlegroups.com>
<a59fa73d-6878-401a-b008-57a47f6a4ecbn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <843a2eec-5afc-4939-9a25-222275bfa1c7n@googlegroups.com>
Subject: Re: name resolution of components within derived type definition
From: parekhvs@gmail.com (FortranFan)
Injection-Date: Sat, 15 Oct 2022 15:09:44 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2843
 by: FortranFan - Sat, 15 Oct 2022 15:09 UTC

On Friday, October 14, 2022 at 3:59:09 PM UTC-4, Peter Klausler US wrote:

> On Friday, October 14, 2022 at 12:46:26 PM UTC-7, FortranFan wrote:
> ..
> > b) re: "the second sentence's "it may also appear"" does not refer to "type definition" but to a "structure" and a constructor for it where the "structure" - per the standard - is a scalar data object of a derived type.
> https://dictionary.cambridge.org/us/dictionary/english/also - adverb, "in addition to".

The "standardese" charters its own course, it feels free to supersede the dictionary or ordinary usage of terms and phrases.

>
> Further, type parameter names of a type are in exactly the same scope as its component names, and type parameter names obviously can be used in the scope of a type definition.

In the case of a type parameter name, the standard states, "A type parameter may be used as a primary in a specification expression (10.1.11) in the derived-type-def . A kind type parameter may also be used as a primary in a constant expression (10.1.12) in the derived-type-def ." This will likely be pointed out as being applicable and also different from the case with the component name, the latter i.e., the component name being used for example in 'integer(kind(foo)) bar' in the code snippet in the original post:

Re: name resolution of components within derived type definition

<22609017-97a1-4a6a-b082-8706ba596ac2n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2989&group=comp.lang.fortran#2989

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:622a:18d:b0:39a:b98e:3d2b with SMTP id s13-20020a05622a018d00b0039ab98e3d2bmr3248314qtw.465.1665866679820;
Sat, 15 Oct 2022 13:44:39 -0700 (PDT)
X-Received: by 2002:a05:620a:4414:b0:6ee:76e4:1b6d with SMTP id
v20-20020a05620a441400b006ee76e41b6dmr2745447qkp.360.1665866679669; Sat, 15
Oct 2022 13:44:39 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sat, 15 Oct 2022 13:44:39 -0700 (PDT)
In-Reply-To: <843a2eec-5afc-4939-9a25-222275bfa1c7n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=50.53.73.155; posting-account=ZT-cAwoAAACx2tBPXm-WZoHIT8sjnGGy
NNTP-Posting-Host: 50.53.73.155
References: <9dcab2f9-ed2d-4613-9fda-e0785500dab5n@googlegroups.com>
<7448b810-a112-4a89-b64a-04202616e2dan@googlegroups.com> <a0b7e3e3-3ddc-48f0-886f-0cdc1851f908n@googlegroups.com>
<1b141ebb-a5ea-49c9-89ba-97669a29290an@googlegroups.com> <eedba836-8f8a-477d-8439-ddd78e1f18c9n@googlegroups.com>
<a59fa73d-6878-401a-b008-57a47f6a4ecbn@googlegroups.com> <843a2eec-5afc-4939-9a25-222275bfa1c7n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <22609017-97a1-4a6a-b082-8706ba596ac2n@googlegroups.com>
Subject: Re: name resolution of components within derived type definition
From: pklausler@nvidia.com (Peter Klausler US)
Injection-Date: Sat, 15 Oct 2022 20:44:39 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1916
 by: Peter Klausler US - Sat, 15 Oct 2022 20:44 UTC

On Saturday, October 15, 2022 at 8:09:45 AM UTC-7, FortranFan wrote:
> > https://dictionary.cambridge.org/us/dictionary/english/also - adverb, "in addition to".
> The "standardese" charters its own course, it feels free to supersede the dictionary or ordinary usage of terms and phrases.

Ok, if you've altered the meaning of the word "also" in the standard, what does it now mean in this context?

Re: name resolution of components within derived type definition

<f2738850-4bb5-4db5-b554-b8daa5e7c3e9n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2990&group=comp.lang.fortran#2990

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:10a8:b0:6ee:cb4a:4c46 with SMTP id h8-20020a05620a10a800b006eecb4a4c46mr3263109qkk.579.1665880536762;
Sat, 15 Oct 2022 17:35:36 -0700 (PDT)
X-Received: by 2002:ad4:5f47:0:b0:4ac:b8de:1484 with SMTP id
p7-20020ad45f47000000b004acb8de1484mr3647414qvg.77.1665880536562; Sat, 15 Oct
2022 17:35:36 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Sat, 15 Oct 2022 17:35:36 -0700 (PDT)
In-Reply-To: <22609017-97a1-4a6a-b082-8706ba596ac2n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=108.52.103.144; posting-account=ZZXq9AoAAAAQEcA7zKAGm0UFQh4gMBv7
NNTP-Posting-Host: 108.52.103.144
References: <9dcab2f9-ed2d-4613-9fda-e0785500dab5n@googlegroups.com>
<7448b810-a112-4a89-b64a-04202616e2dan@googlegroups.com> <a0b7e3e3-3ddc-48f0-886f-0cdc1851f908n@googlegroups.com>
<1b141ebb-a5ea-49c9-89ba-97669a29290an@googlegroups.com> <eedba836-8f8a-477d-8439-ddd78e1f18c9n@googlegroups.com>
<a59fa73d-6878-401a-b008-57a47f6a4ecbn@googlegroups.com> <843a2eec-5afc-4939-9a25-222275bfa1c7n@googlegroups.com>
<22609017-97a1-4a6a-b082-8706ba596ac2n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f2738850-4bb5-4db5-b554-b8daa5e7c3e9n@googlegroups.com>
Subject: Re: name resolution of components within derived type definition
From: parekhvs@gmail.com (FortranFan)
Injection-Date: Sun, 16 Oct 2022 00:35:36 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2516
 by: FortranFan - Sun, 16 Oct 2022 00:35 UTC

On Saturday, October 15, 2022 at 4:44:41 PM UTC-4, Peter Klausler US wrote:

> On Saturday, October 15, 2022 at 8:09:45 AM UTC-7, FortranFan wrote:
> > > https://dictionary.cambridge.org/us/dictionary/english/also - adverb, "in addition to".
> > The "standardese" charters its own course, it feels free to supersede the dictionary or ordinary usage of terms and phrases.
> Ok, if you've altered the meaning of the word "also" in the standard, what does it now mean in this context?

Not sure what you're getting at, however re: the component name, again here's what you can review:

--- text on the J3 mailing list reply from the Editor ---
".. A “bare” type component name can appear only

1. as the name of the component being defined by a component definition statement;
2. as a keyword in a structure constructor for that type.
..."
--- end text ---

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor