From owner-sc22wg5+sc22wg5-dom9=www.open-std.org@open-std.org  Thu Sep 19 04:04:37 2024
Return-Path: <owner-sc22wg5+sc22wg5-dom9=www.open-std.org@open-std.org>
X-Original-To: sc22wg5-dom9
Delivered-To: sc22wg5-dom9@www.open-std.org
Received: by www.open-std.org (Postfix, from userid 521)
	id 5C94F357045; Thu, 19 Sep 2024 04:04:37 +0200 (CEST)
Delivered-To: sc22wg5@open-std.org
Received: from nag-j.co.jp (bvdeuz19.secure.ne.jp [180.222.80.19])
	by www.open-std.org (Postfix) with SMTP id A2713356FA7
	for <sc22wg5@open-std.org>; Thu, 19 Sep 2024 04:04:34 +0200 (CEST)
Received: (qmail 78123 invoked from network); 19 Sep 2024 11:04:31 +0900
Received: from unknown (HELO Maru10) (218.42.159.105)
  by 0 with SMTP; 19 Sep 2024 11:04:31 +0900
From: "Malcolm Cohen" <malcolm@nag-j.co.jp>
To: "'WG5'" <sc22wg5@open-std.org>
References: <LV3PR12MB90956B210D8135B74A486302CB622@LV3PR12MB9095.namprd12.prod.outlook.com> <20240918092035.40F30357023@www.open-std.org> <LV3PR12MB90956BC67608F7113F8985D2CB622@LV3PR12MB9095.namprd12.prod.outlook.com> <SA3PR12MB7998861FA4DFD31AA1F454EAF6632@SA3PR12MB7998.namprd12.prod.outlook.com>
In-Reply-To: <SA3PR12MB7998861FA4DFD31AA1F454EAF6632@SA3PR12MB7998.namprd12.prod.outlook.com>
Subject: RE: [J3] [SC22WG5.6608] RE:  RE: [ukfortran] intent(in) and value
Date: Thu, 19 Sep 2024 11:04:30 +0900
Message-ID: <002301db0a38$44312780$cc937680$@nag-j.co.jp>
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_0024_01DB0A83.B41D8A70"
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQH/9fLaKj7MZ/xChKmAc+pwsbYi4AL6IgZnAXKjyD4C2KYDnrHaWKKg
Content-Language: ja
Sender: owner-sc22wg5@open-std.org
Precedence: bulk

This is a multipart message in MIME format.

------=_NextPart_000_0024_01DB0A83.B41D8A70
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

Yes.

 

INTENT(IN) makes the dummy argument non-definable. This may be useful e.g.
so that later on, in program maintenance, someone doesn't try to change the
dummy argument in the expectation that it would change the actual argument.

 

Cheers,

-- 

..............Malcolm Cohen, NAG Oxford/Tokyo.

 

From: J3 <j3-bounces@mailman.j3-fortran.org> On Behalf Of Klemm, Michael via
J3
Sent: Thursday, September 19, 2024 10:34 AM
To: Jeff Hammond <jehammond@nvidia.com>; General J3 interest list
<j3@mailman.j3-fortran.org>; 'WG5' <sc22wg5@open-std.org>
Cc: Klemm, Michael <Michael.Klemm@amd.com>; Malcolm Cohen
<malcolm@nag-j.co.jp>
Subject: [J3] [SC22WG5.6608] RE: RE: [ukfortran] intent(in) and value

 

Hi folks,

 

Thanks for the clarification!

 

One more thing: Is it then sensible to have a variable have the attributes
VALUE and INTENT(IN) at the same time?

 

From: Jeff Hammond <jehammond@nvidia.com <mailto:jehammond@nvidia.com> > 
Sent: Wednesday, September 18, 2024 7:29 PM
To: General J3 interest list <j3@mailman.j3-fortran.org
<mailto:j3@mailman.j3-fortran.org> >; 'WG5' <sc22wg5@open-std.org
<mailto:sc22wg5@open-std.org> >
Cc: Malcolm Cohen <malcolm@nag-j.co.jp <mailto:malcolm@nag-j.co.jp> >
Subject: Re: [J3] [SC22WG5.6606] RE: [ukfortran] intent(in) and value

 

	
Caution: This message originated from an External Source. Use proper caution
when opening attachments, clicking links, or responding. 

 

Thanks.  This is useful context and a helpful explanation.

 

Jeff

 

From: J3 <j3-bounces@mailman.j3-fortran.org
<mailto:j3-bounces@mailman.j3-fortran.org> > on behalf of Malcolm Cohen via
J3 <j3@mailman.j3-fortran.org <mailto:j3@mailman.j3-fortran.org> >
Date: Wednesday, 18. September 2024 at 12.20
To: 'WG5' <sc22wg5@open-std.org <mailto:sc22wg5@open-std.org> >
Cc: Malcolm Cohen <malcolm@nag-j.co.jp <mailto:malcolm@nag-j.co.jp> >
Subject: [J3] [SC22WG5.6606] RE: [ukfortran] intent(in) and value


External email: Use caution opening links or attachments 

 

Hi Jeff,

 

It is called "unspecified INTENT" not "default INTENT". That is because it
is not a default, it is that it is not specified. (ASIDE: I don't think we
use the phrase in the standard itself, but we do when talking about it.)

 

R828 by itself does not define the INTENT attribute, it defines some syntax
- and that is the syntax for specified intent (it's even called
"intent-spec". The whole of 8.5.10 defines the INTENT attribute, and indeed,
there is a paragraph about unspecified intent.

 

INTENT(INOUT) is very different indeed from unspecified intent. In
particular, INOUT requires that the actual argument be a definable variable.
There is no such requirement for unspecified intent. With unspecified intent
you simply have to get it right, viz not reference the dummy argument unless
it is defined, and not define the dummy argument unless it is definable.
This is the world before the invention of INTENT.

 

To summarise: with no intent-spec, the intent is not "INOUT", or "INOUT
except stuff", it is "unspecified", and has the same capabilities and
limitations that it had before Fortran 90.

 

Cheers,

-- 

..............Malcolm Cohen, NAG Oxford/Tokyo.

 

From: owner-sc22wg5@open-std.org <mailto:owner-sc22wg5@open-std.org>
<owner-sc22wg5@open-std.org <mailto:owner-sc22wg5@open-std.org> > On Behalf
Of Jeff Hammond
Sent: Wednesday, September 18, 2024 4:12 PM
To: WG5 <sc22wg5@open-std.org <mailto:sc22wg5@open-std.org> >
Subject: [ukfortran] [SC22WG5.6604] intent(in) and value

 

8.5.10 R828 says that INTENT is IN, OUT or INOUT.

 

8.5.19 C868 says that VALUE cannot be INTENT(OUT) or INTENT(INOUT)

 

Should I understand that dummy arguments without an INTENT do not have an
implicit intent corresponding to any of the explicit INTENT types?  I have
always assumed that the default INTENT was INOUT, but that cannot be true
since that would conflict with VALUE in the example below.  It seems the
default INTENT is "INOUT, unless VALUE, in which case it's
IN-but-also-assignable".

 

subroutine foo(a,b)

    implicit none

    integer, value, intent(in) :: a

    integer, value :: b

    ! integer, value, intent(inout) :: c ! not allowed

    ! integer, value, intent(out) :: d ! not allowed

    ! a = 21 ! can't assign because intent(in)

    b = 23 ! can assign

end subroutine foo

 

Thanks

 

Jeff


------=_NextPart_000_0024_01DB0A83.B41D8A70
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta =
http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii"><meta name=3DGenerator content=3D"Microsoft Word 15 =
(filtered medium)"><style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:"Yu Gothic";
	panose-1:2 11 4 0 0 0 0 0 0 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Verdana;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
	{font-family:Aptos;}
@font-face
	{font-family:"Yu Gothic";
	panose-1:2 11 4 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	font-size:10.0pt;
	font-family:"Aptos",sans-serif;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:#467886;
	text-decoration:underline;}
span.19
	{mso-style-type:personal-reply;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;
	mso-ligatures:none;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DEN-GB =
link=3D"#467886" vlink=3D"#96607D" style=3D'word-wrap:break-word'><div =
class=3DWordSection1><p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>Yes.<o:p></o:=
p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p>&nbsp;</=
o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>INTENT(IN) =
makes the dummy argument non-definable. This may be useful e.g. so that =
later on, in program maintenance, someone doesn&#8217;t try to change =
the dummy argument in the expectation that it would change the actual =
argument.<o:p></o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p>&nbsp;</=
o:p></span></p><p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>Cheers,<o:p><=
/o:p></span></p><div><p class=3DMsoNormal =
style=3D'text-align:justify;text-justify:inter-ideograph'><span =
lang=3DEN-US =
style=3D'font-size:10.5pt;font-family:"Calibri",sans-serif'>-- =
</span><span =
style=3D'font-size:10.5pt;font-family:"Calibri",sans-serif'><o:p></o:p></=
span></p><p class=3DMsoNormal =
style=3D'text-align:justify;text-justify:inter-ideograph'><span =
lang=3DEN-US =
style=3D'font-size:10.5pt;font-family:"Calibri",sans-serif'>.............=
.Malcolm Cohen, NAG Oxford/Tokyo.</span><span =
style=3D'font-size:10.5pt;font-family:"Calibri",sans-serif'><o:p></o:p></=
span></p></div><p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p>&nbsp;</=
o:p></span></p><div><div style=3D'border:none;border-top:solid #E1E1E1 =
1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=3DMsoNormal><b><span =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span><=
/b><span style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'> J3 =
&lt;j3-bounces@mailman.j3-fortran.org&gt; <b>On Behalf Of </b>Klemm, =
Michael via J3<br><b>Sent:</b> Thursday, September 19, 2024 10:34 =
AM<br><b>To:</b> Jeff Hammond &lt;jehammond@nvidia.com&gt;; General J3 =
interest list &lt;j3@mailman.j3-fortran.org&gt;; 'WG5' =
&lt;sc22wg5@open-std.org&gt;<br><b>Cc:</b> Klemm, Michael =
&lt;Michael.Klemm@amd.com&gt;; Malcolm Cohen =
&lt;malcolm@nag-j.co.jp&gt;<br><b>Subject:</b> [J3] [SC22WG5.6608] RE: =
RE: [ukfortran] intent(in) and value<o:p></o:p></span></p></div></div><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal><span =
lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Arial",sans-serif'>Hi =
folks,<o:p></o:p></span></p><p class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Arial",sans-serif'><o:p>&nbsp;</o:=
p></span></p><p class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Arial",sans-serif'>Thanks for the =
clarification!<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Arial",sans-serif'><o:p>&nbsp;</o:=
p></span></p><p class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Arial",sans-serif'>One more =
thing: Is it then sensible to have a variable have the attributes VALUE =
and INTENT(IN) at the same time?<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US><o:p>&nbsp;</o:p></span></p><div =
style=3D'border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm =
4.0pt'><div><div style=3D'border:none;border-top:solid #E1E1E1 =
1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=3DMsoNormal><b><span =
lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span><=
/b><span lang=3DEN-US =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'> Jeff =
Hammond &lt;<a =
href=3D"mailto:jehammond@nvidia.com">jehammond@nvidia.com</a>&gt; =
<br><b>Sent:</b> Wednesday, September 18, 2024 7:29 PM<br><b>To:</b> =
General J3 interest list &lt;<a =
href=3D"mailto:j3@mailman.j3-fortran.org">j3@mailman.j3-fortran.org</a>&g=
t;; 'WG5' &lt;<a =
href=3D"mailto:sc22wg5@open-std.org">sc22wg5@open-std.org</a>&gt;<br><b>C=
c:</b> Malcolm Cohen &lt;<a =
href=3D"mailto:malcolm@nag-j.co.jp">malcolm@nag-j.co.jp</a>&gt;<br><b>Sub=
ject:</b> Re: [J3] [SC22WG5.6606] RE: [ukfortran] intent(in) and =
value<o:p></o:p></span></p></div></div><p class=3DMsoNormal><span =
lang=3DEN-US><o:p>&nbsp;</o:p></span></p><table class=3DMsoNormalTable =
border=3D0 cellspacing=3D0 cellpadding=3D0 align=3Dleft width=3D"100%" =
style=3D'width:100.0%'><tr><td style=3D'background:#FFB900;padding:5.0pt =
2.0pt 5.0pt 2.0pt'></td><td width=3D"100%" =
style=3D'width:100.0%;background:#FFF8E5;padding:5.0pt 4.0pt 5.0pt =
12.0pt'><div><p class=3DMsoNormal =
style=3D'mso-element:frame;mso-element-frame-hspace:2.25pt;mso-element-wr=
ap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizo=
ntal:column;mso-height-rule:exactly'><b><span =
style=3D'font-size:12.0pt;color:#222222'>Caution:</span></b><span =
style=3D'font-size:12.0pt;color:#222222'> This message originated from =
an External Source. Use proper caution when opening attachments, =
clicking links, or responding. =
<o:p></o:p></span></p></div></td></tr></table><p class=3DMsoNormal><span =
lang=3DEN-US =
style=3D'font-size:12.0pt'><o:p>&nbsp;</o:p></span></p><div><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:12.0pt'>Thanks.&nbsp; This is useful context and a =
helpful explanation.<o:p></o:p></span></p><p class=3DMsoNormal><span =
lang=3DEN-US style=3D'font-size:12.0pt'><o:p>&nbsp;</o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:12.0pt'>Jeff<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:12.0pt'><o:p>&nbsp;</o:p></span></p><div =
id=3Dmail-editor-reference-message-container><div><div><div =
style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm =
0cm 0cm'><p class=3DMsoNormal style=3D'margin-bottom:12.0pt'><b><span =
style=3D'font-size:12.0pt;color:black'>From: </span></b><span =
style=3D'font-size:12.0pt;color:black'>J3 &lt;<a =
href=3D"mailto:j3-bounces@mailman.j3-fortran.org">j3-bounces@mailman.j3-f=
ortran.org</a>&gt; on behalf of Malcolm Cohen via J3 &lt;<a =
href=3D"mailto:j3@mailman.j3-fortran.org">j3@mailman.j3-fortran.org</a>&g=
t;<br><b>Date: </b>Wednesday, 18. September 2024 at 12.20<br><b>To: =
</b>'WG5' &lt;<a =
href=3D"mailto:sc22wg5@open-std.org">sc22wg5@open-std.org</a>&gt;<br><b>C=
c: </b>Malcolm Cohen &lt;<a =
href=3D"mailto:malcolm@nag-j.co.jp">malcolm@nag-j.co.jp</a>&gt;<br><b>Sub=
ject: </b>[J3] [SC22WG5.6606] RE: [ukfortran] intent(in) and =
value<o:p></o:p></span></p></div><table class=3DMsoNormalTable =
border=3D1 cellpadding=3D0 style=3D'background:#FFEB9C'><tr><td =
style=3D'padding:.75pt .75pt .75pt .75pt'><p class=3DMsoNormal><b><span =
style=3D'font-size:7.5pt;font-family:"Verdana",sans-serif;color:black'>Ex=
ternal email: Use caution opening links or attachments</span></b><span =
style=3D'font-size:7.5pt;font-family:"Verdana",sans-serif;color:black'> =
</span><span =
style=3D'font-size:12.0pt'><o:p></o:p></span></p></td></tr></table><p =
class=3DMsoNormal><span =
style=3D'font-size:12.0pt'><o:p>&nbsp;</o:p></span></p><div><div><p =
class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>Hi =
Jeff,</span><span style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>&nbsp;</span>=
<span style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>It is called =
&#8220;unspecified INTENT&#8221; not &#8220;default INTENT&#8221;. That =
is because it is not a default, it is that it is not specified. (ASIDE: =
I don&#8217;t think we use the phrase in the standard itself, but we do =
when talking about it.)</span><span =
style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>&nbsp;</span>=
<span style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>R828 by =
itself does not define the INTENT attribute, it defines some syntax =
&#8211; and that is the syntax for specified intent (it&#8217;s even =
called &#8220;intent-spec&#8221;. The whole of 8.5.10 defines the INTENT =
attribute, and indeed, there is a paragraph about unspecified =
intent.</span><span style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>&nbsp;</span>=
<span style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>INTENT(INOUT)=
 is very different indeed from unspecified intent. In particular, INOUT =
requires that the actual argument be a definable variable. There is no =
such requirement for unspecified intent. With unspecified intent you =
simply have to get it right, viz not reference the dummy argument unless =
it is defined, and not define the dummy argument unless it is definable. =
This is the world before the invention of INTENT.</span><span =
style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>&nbsp;</span>=
<span style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>To =
summarise: with no intent-spec, the intent is not &#8220;INOUT&#8221;, =
or &#8220;INOUT except stuff&#8221;, it is &#8220;unspecified&#8221;, =
and has the same capabilities and limitations that it had before Fortran =
90.</span><span style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>&nbsp;</span>=
<span style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>Cheers,</span=
><span style=3D'font-size:12.0pt'><o:p></o:p></span></p><div><p =
class=3DMsoNormal =
style=3D'text-align:justify;text-justify:inter-ideograph'><span =
lang=3DEN-US =
style=3D'font-size:10.5pt;font-family:"Calibri",sans-serif'>-- =
</span><span style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal =
style=3D'text-align:justify;text-justify:inter-ideograph'><span =
lang=3DEN-US =
style=3D'font-size:10.5pt;font-family:"Calibri",sans-serif'>.............=
.Malcolm Cohen, NAG Oxford/Tokyo.</span><span =
style=3D'font-size:12.0pt'><o:p></o:p></span></p></div><p =
class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>&nbsp;</span>=
<span style=3D'font-size:12.0pt'><o:p></o:p></span></p><div><div =
style=3D'border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm =
0cm 0cm'><p class=3DMsoNormal><b><span =
style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span><=
/b><span style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'> <a =
href=3D"mailto:owner-sc22wg5@open-std.org">owner-sc22wg5@open-std.org</a>=
 &lt;<a =
href=3D"mailto:owner-sc22wg5@open-std.org">owner-sc22wg5@open-std.org</a>=
&gt; <b>On Behalf Of </b>Jeff Hammond<br><b>Sent:</b> Wednesday, =
September 18, 2024 4:12 PM<br><b>To:</b> WG5 &lt;<a =
href=3D"mailto:sc22wg5@open-std.org">sc22wg5@open-std.org</a>&gt;<br><b>S=
ubject:</b> [ukfortran] [SC22WG5.6604] intent(in) and value</span><span =
style=3D'font-size:12.0pt'><o:p></o:p></span></p></div></div><p =
class=3DMsoNormal><span =
style=3D'font-size:12.0pt'>&nbsp;<o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:12.0pt'>8.5.10 =
R828 says that INTENT is IN, OUT or INOUT.</span><span =
style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:12.0pt'>&nbsp;</span><span =
style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:12.0pt'>8.5.19 =
C868 says that VALUE cannot be INTENT(OUT) or INTENT(INOUT)</span><span =
style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:12.0pt'>&nbsp;</span><span =
style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:12.0pt'>Should I =
understand that dummy arguments without an INTENT do not have an =
implicit intent corresponding to any of the explicit INTENT types?&nbsp; =
I have always assumed that the default INTENT was INOUT, but that cannot =
be true since that would conflict with VALUE in the example below.&nbsp; =
It seems the default INTENT is &#8220;INOUT, unless VALUE, in which case =
it&#8217;s IN-but-also-assignable&#8221;.</span><span =
style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:12.0pt'>&nbsp;</span><span =
style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:12.0pt'>subroutine foo(a,b)</span><span =
style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:12.0pt'>&nbsp;&nbsp;&nbsp; implicit none</span><span =
style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:12.0pt'>&nbsp;&nbsp;&nbsp; integer, value, intent(in) =
:: a</span><span style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:12.0pt'>&nbsp;&nbsp;&nbsp; integer, value :: =
b</span><span style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:12.0pt'>&nbsp;&nbsp;&nbsp; ! integer, value, =
intent(inout) :: c ! not allowed</span><span =
style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:12.0pt'>&nbsp;&nbsp; &nbsp;! integer, value, =
intent(out) :: d ! not allowed</span><span =
style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:12.0pt'>&nbsp;&nbsp;&nbsp; ! a =3D 21 ! can't assign =
because intent(in)</span><span =
style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:12.0pt'>&nbsp;&nbsp;&nbsp; b =3D 23 ! can =
assign</span><span style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US style=3D'font-size:12.0pt'>end =
subroutine foo</span><span =
style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:12.0pt'>&nbsp;</span><span =
style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:12.0pt'>Thanks</span><span =
style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:12.0pt'>&nbsp;</span><span =
style=3D'font-size:12.0pt'><o:p></o:p></span></p><p =
class=3DMsoNormal><span lang=3DEN-US =
style=3D'font-size:12.0pt'>Jeff</span><span =
style=3D'font-size:12.0pt'><o:p></o:p></span></p></div></div></div></div>=
</div></div></div></div></body></html>
------=_NextPart_000_0024_01DB0A83.B41D8A70--

