Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

In these matters the only certainty is that there is nothing certain. -- Pliny the Elder


devel / comp.lang.fortran / Re: Modifying a constant actual argument

SubjectAuthor
* Fwd: Modifying a constant actual argumentRon Shepard
+* Re: Modifying a constant actual argumentgah4
|`* Re: Modifying a constant actual argumentThomas Koenig
| `* Re: Modifying a constant actual argumentgah4
|  `* Re: Modifying a constant actual argumentThomas Koenig
|   `* Re: Modifying a constant actual argumentgah4
|    `- Re: Modifying a constant actual argumentpehache
`- Re: Fwd: Modifying a constant actual argumentThomas Koenig

1
Fwd: Modifying a constant actual argument

<x2hqM.145977$fNr5.75695@fx16.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx16.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:102.0)
Gecko/20100101 Thunderbird/102.13.0
Subject: Fwd: Modifying a constant actual argument
Content-Language: en-US
References: <md5:tw3iFewIIXoeOxV4HTcuAQ==>
Newsgroups: comp.lang.fortran
From: nospam@nowhere.org (Ron Shepard)
In-Reply-To: <md5:tw3iFewIIXoeOxV4HTcuAQ==>
X-Forwarded-Message-Id: <md5:tw3iFewIIXoeOxV4HTcuAQ==>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 34
Message-ID: <x2hqM.145977$fNr5.75695@fx16.iad>
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Sat, 8 Jul 2023 12:30:04 -0500
X-Received-Bytes: 2936
 by: Ron Shepard - Sat, 8 Jul 2023 17:30 UTC

On 7/8/23 2:23 AM, gah4 wrote:
>> Fortran now has the VALUE attribute for dummy arguments. This does what
>> you are talking about, it requires the compiler to create a modifiable
>> copy of its actual argument. The dummy argument can be changed, while
>> the actual argument is never changed. I think this attribute requires an
>> explicit interface, since both the caller and the callee need to know
>> about it.
>
> Yes. Well, that is also needed to make C interoperability work, in the
> cases where the caller is C. But also, yes, it has to work when both
> are Fortran.

The C interoperability aspect is a different feature, although both use
the VALUE attribute to trigger the behavior. In the C case, the VALUE
attribute for an argument in the interface block determines whether the
address or the value of the modifiable copy is passed to the function.
In the fortran case, it will always be passed by address; it is like
copy-in/copy-out argument association, but without the copy-out step at
the end. So in the C case, it changes how the argument is passed, while
in the fortran case it is syntax sugar for using a variable to make a
temporary copy of the argument, and then ignoring the return value.

As for the idea that this would simplify the programmer's task if it
were the default behavior, I doubt that would be the case. Argument
association in fortran is normally a two-way street, whether it is done
by address association or by copy-in/copy-out. So to have the VALUE
attribute become the default, there would need to be a complicated set
of new rules about when the copy-out step is done and when it isn't. The
current rules and conventions are not complicated, so it is likely best
to leave this convention as is. While it is true that a programmer can
make a rare mistake, it is also true that with declared INTENT, the
compiler can detect many of those mistakes at compile time.

$.02 -Ron Shepard

Re: Modifying a constant actual argument

<3a0a47b5-e7a3-461e-ba74-53138157b7ban@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:6214:4402:b0:635:ef17:c453 with SMTP id oj2-20020a056214440200b00635ef17c453mr62020qvb.2.1688844084902;
Sat, 08 Jul 2023 12:21:24 -0700 (PDT)
X-Received: by 2002:a05:6a00:3988:b0:67c:3aeb:a47c with SMTP id
fi8-20020a056a00398800b0067c3aeba47cmr12109846pfb.5.1688844084318; Sat, 08
Jul 2023 12:21:24 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.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, 8 Jul 2023 12:21:23 -0700 (PDT)
In-Reply-To: <x2hqM.145977$fNr5.75695@fx16.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=66.212.64.182; posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 66.212.64.182
References: <md5:tw3iFewIIXoeOxV4HTcuAQ==> <x2hqM.145977$fNr5.75695@fx16.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3a0a47b5-e7a3-461e-ba74-53138157b7ban@googlegroups.com>
Subject: Re: Modifying a constant actual argument
From: gah4@u.washington.edu (gah4)
Injection-Date: Sat, 08 Jul 2023 19:21:24 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2641
 by: gah4 - Sat, 8 Jul 2023 19:21 UTC

On Saturday, July 8, 2023 at 10:30:09 AM UTC-7, Ron Shepard wrote:

(snip)

> As for the idea that this would simplify the programmer's task if it
> were the default behavior, I doubt that would be the case. Argument
> association in fortran is normally a two-way street, whether it is done
> by address association or by copy-in/copy-out. So to have the VALUE
> attribute become the default, there would need to be a complicated set
> of new rules about when the copy-out step is done and when it isn't. The
> current rules and conventions are not complicated, so it is likely best
> to leave this convention as is. While it is true that a programmer can
> make a rare mistake, it is also true that with declared INTENT, the
> compiler can detect many of those mistakes at compile time.
I wasn't suggesting that VALUE be the default, but that modifiable
temporaries be used for constants and expressions. I suppose there
is the rare case where a temporary can be used more than once:

CALL X(A+B)
CALL Y(A+B)

a compiler could use the same non-modified temporary variable.

Modifiable temporaries could have been added back to
Fortran 77 or 90 or any since. For expressions, there needs to
be a temporary somewhere. For constants there doesn't, but it
isn't that much more work for the compiler to generate one.

And it does make it just that much easier for the programmer.

Re: Fwd: Modifying a constant actual argument

<u8e0l6$cja3$1@newsreader4.netcologne.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-15fa-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.lang.fortran
Subject: Re: Fwd: Modifying a constant actual argument
Date: Sun, 9 Jul 2023 10:03:18 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <u8e0l6$cja3$1@newsreader4.netcologne.de>
References: <md5:tw3iFewIIXoeOxV4HTcuAQ==> <x2hqM.145977$fNr5.75695@fx16.iad>
Injection-Date: Sun, 9 Jul 2023 10:03:18 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-15fa-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:15fa:0:7285:c2ff:fe6c:992d";
logging-data="412995"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Sun, 9 Jul 2023 10:03 UTC

Ron Shepard <nospam@nowhere.org> schrieb:
> On 7/8/23 2:23 AM, gah4 wrote:
>>> Fortran now has the VALUE attribute for dummy arguments. This does what
>>> you are talking about, it requires the compiler to create a modifiable
>>> copy of its actual argument. The dummy argument can be changed, while
>>> the actual argument is never changed. I think this attribute requires an
>>> explicit interface, since both the caller and the callee need to know
>>> about it.
>>
>> Yes. Well, that is also needed to make C interoperability work, in the
>> cases where the caller is C. But also, yes, it has to work when both
>> are Fortran.
>
> The C interoperability aspect is a different feature, although both use
> the VALUE attribute to trigger the behavior. In the C case, the VALUE
> attribute for an argument in the interface block determines whether the
> address or the value of the modifiable copy is passed to the function.
> In the fortran case, it will always be passed by address;

This is actually not the case; gfortran chose a different
implementation.

module foo
implicit none
contains
real function add(x,y)
real, value :: x, y
add = x + y
end function add
end module foo

gets you

addss %xmm1, %xmm0
ret

so direct passing in registers is used.

The issue with OPTIONAL, VALUE arguments is solved via a hidden
argument.

Re: Modifying a constant actual argument

<u8e47f$clru$1@newsreader4.netcologne.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-15fa-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.lang.fortran
Subject: Re: Modifying a constant actual argument
Date: Sun, 9 Jul 2023 11:04:15 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <u8e47f$clru$1@newsreader4.netcologne.de>
References: <md5:tw3iFewIIXoeOxV4HTcuAQ==>
<x2hqM.145977$fNr5.75695@fx16.iad>
<3a0a47b5-e7a3-461e-ba74-53138157b7ban@googlegroups.com>
Injection-Date: Sun, 9 Jul 2023 11:04:15 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-15fa-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:15fa:0:7285:c2ff:fe6c:992d";
logging-data="415614"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Sun, 9 Jul 2023 11:04 UTC

gah4 <gah4@u.washington.edu> schrieb:

> I wasn't suggesting that VALUE be the default, but that modifiable
> temporaries be used for constants and expressions. I suppose there
> is the rare case where a temporary can be used more than once:
>
> CALL X(A+B)
> CALL Y(A+B)
>
> a compiler could use the same non-modified temporary variable.
>
> Modifiable temporaries could have been added back to
> Fortran 77 or 90 or any since. For expressions, there needs to
> be a temporary somewhere. For constants there doesn't, but it
> isn't that much more work for the compiler to generate one.
>
> And it does make it just that much easier for the programmer.

What would this bring that is not covered with

no intent
INTENT(IN)
INTENT(OUT)
INTENT(INOUT)
VALUE
INTENT(IN), VALUE

?

Re: Modifying a constant actual argument

<0de596ac-a8e3-4e29-9cd5-415a25bd1620n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:294a:b0:767:2c6f:dc49 with SMTP id n10-20020a05620a294a00b007672c6fdc49mr30928qkp.6.1688962225051;
Sun, 09 Jul 2023 21:10:25 -0700 (PDT)
X-Received: by 2002:a17:903:1313:b0:1b8:1323:4692 with SMTP id
iy19-20020a170903131300b001b813234692mr9677711plb.10.1688962224593; Sun, 09
Jul 2023 21:10:24 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.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: Sun, 9 Jul 2023 21:10:23 -0700 (PDT)
In-Reply-To: <u8e47f$clru$1@newsreader4.netcologne.de>
Injection-Info: google-groups.googlegroups.com; posting-host=98.232.94.215; posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 98.232.94.215
References: <md5:tw3iFewIIXoeOxV4HTcuAQ==> <x2hqM.145977$fNr5.75695@fx16.iad>
<3a0a47b5-e7a3-461e-ba74-53138157b7ban@googlegroups.com> <u8e47f$clru$1@newsreader4.netcologne.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0de596ac-a8e3-4e29-9cd5-415a25bd1620n@googlegroups.com>
Subject: Re: Modifying a constant actual argument
From: gah4@u.washington.edu (gah4)
Injection-Date: Mon, 10 Jul 2023 04:10:25 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2427
 by: gah4 - Mon, 10 Jul 2023 04:10 UTC

On Sunday, July 9, 2023 at 4:04:19 AM UTC-7, Thomas Koenig wrote:

(snip, I wrote)

> > Modifiable temporaries could have been added back to
> > Fortran 77 or 90 or any since. For expressions, there needs to
> > be a temporary somewhere. For constants there doesn't, but it
> > isn't that much more work for the compiler to generate one.
> > And it does make it just that much easier for the programmer.
> What would this bring that is not covered with
> no intent
> INTENT(IN)
> INTENT(OUT)
> INTENT(INOUT)
> VALUE
> INTENT(IN), VALUE
It could have been added before INTENT, but wasn't.

It could still be added for the no intent case, and for the INTENT(INOUT) case.

In both cases, it indicates ignoring of any returned (modified) values.

There are some cases, maybe not so many, when an argument needs to
be passed, constant or expression, but any changed value isn't needed.

That is, it is in some cases but not all cases.

One could write separate subroutines for the two, but that is extra work.

One could write ENTRY points, but those are deprecated.

Re: Modifying a constant actual argument

<u8gbsa$e67c$1@newsreader4.netcologne.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-15fa-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.lang.fortran
Subject: Re: Modifying a constant actual argument
Date: Mon, 10 Jul 2023 07:27:06 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <u8gbsa$e67c$1@newsreader4.netcologne.de>
References: <md5:tw3iFewIIXoeOxV4HTcuAQ==>
<x2hqM.145977$fNr5.75695@fx16.iad>
<3a0a47b5-e7a3-461e-ba74-53138157b7ban@googlegroups.com>
<u8e47f$clru$1@newsreader4.netcologne.de>
<0de596ac-a8e3-4e29-9cd5-415a25bd1620n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 10 Jul 2023 07:27:06 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-15fa-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:15fa:0:7285:c2ff:fe6c:992d";
logging-data="465132"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Mon, 10 Jul 2023 07:27 UTC

gah4 <gah4@u.washington.edu> schrieb:
> On Sunday, July 9, 2023 at 4:04:19 AM UTC-7, Thomas Koenig wrote:
>
> (snip, I wrote)
>
>> > Modifiable temporaries could have been added back to
>> > Fortran 77 or 90 or any since. For expressions, there needs to
>> > be a temporary somewhere. For constants there doesn't, but it
>> > isn't that much more work for the compiler to generate one.
>
>> > And it does make it just that much easier for the programmer.
>> What would this bring that is not covered with
>
>> no intent
>> INTENT(IN)
>> INTENT(OUT)
>> INTENT(INOUT)
>> VALUE
>> INTENT(IN), VALUE
>
> It could have been added before INTENT, but wasn't.
>
> It could still be added for the no intent case, and for the INTENT(INOUT) case.
>
> In both cases, it indicates ignoring of any returned (modified) values.

How is that different from VALUE?

Re: Modifying a constant actual argument

<d3f36aa5-aade-4a52-8aa5-86e584041c89n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:c4e:b0:767:420d:cec2 with SMTP id u14-20020a05620a0c4e00b00767420dcec2mr29502qki.5.1688975404920;
Mon, 10 Jul 2023 00:50:04 -0700 (PDT)
X-Received: by 2002:a05:6a00:1ad2:b0:67a:1788:7653 with SMTP id
f18-20020a056a001ad200b0067a17887653mr15209454pfv.1.1688975404657; Mon, 10
Jul 2023 00:50:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Mon, 10 Jul 2023 00:50:04 -0700 (PDT)
In-Reply-To: <u8gbsa$e67c$1@newsreader4.netcologne.de>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:f9bc:3a95:476e:54f9;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:f9bc:3a95:476e:54f9
References: <md5:tw3iFewIIXoeOxV4HTcuAQ==> <x2hqM.145977$fNr5.75695@fx16.iad>
<3a0a47b5-e7a3-461e-ba74-53138157b7ban@googlegroups.com> <u8e47f$clru$1@newsreader4.netcologne.de>
<0de596ac-a8e3-4e29-9cd5-415a25bd1620n@googlegroups.com> <u8gbsa$e67c$1@newsreader4.netcologne.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d3f36aa5-aade-4a52-8aa5-86e584041c89n@googlegroups.com>
Subject: Re: Modifying a constant actual argument
From: gah4@u.washington.edu (gah4)
Injection-Date: Mon, 10 Jul 2023 07:50:04 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: gah4 - Mon, 10 Jul 2023 07:50 UTC

On Monday, July 10, 2023 at 12:27:09 AM UTC-7, Thomas Koenig wrote:
> gah4 <ga...@u.washington.edu> schrieb:
> > On Sunday, July 9, 2023 at 4:04:19 AM UTC-7, Thomas Koenig wrote:

(snip)

> >> What would this bring that is not covered with
> >
> >> no intent
> >> INTENT(IN)
> >> INTENT(OUT)
> >> INTENT(INOUT)
> >> VALUE
> >> INTENT(IN), VALUE
> > It could have been added before INTENT, but wasn't.
> > It could still be added for the no intent case, and for the INTENT(INOUT) case.

> > In both cases, it indicates ignoring of any returned (modified) values.

> How is that different from VALUE?

If you call with a variable, you get the changed value.

With a constant, expression, or variable in parentheses, the latter being
a form of expression, you don't get the new value.

Re: Modifying a constant actual argument

<gj4ga-l0y_PDBOTgf6JADAL78wg@jntp>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!news.nntp4.net!pasdenom.info!from-devjntp
Message-ID: <gj4ga-l0y_PDBOTgf6JADAL78wg@jntp>
JNTP-Route: news2.nemoweb.net
JNTP-DataType: Article
Subject: Re: Modifying a constant actual argument
References: <md5:tw3iFewIIXoeOxV4HTcuAQ==> <x2hqM.145977$fNr5.75695@fx16.iad>
<3a0a47b5-e7a3-461e-ba74-53138157b7ban@googlegroups.com> <u8e47f$clru$1@newsreader4.netcologne.de>
<0de596ac-a8e3-4e29-9cd5-415a25bd1620n@googlegroups.com> <u8gbsa$e67c$1@newsreader4.netcologne.de>
<d3f36aa5-aade-4a52-8aa5-86e584041c89n@googlegroups.com>
Newsgroups: comp.lang.fortran
JNTP-HashClient: 2UvSF_9fgQOaLtcU-Rb67NM2b1w
JNTP-ThreadID: md5:tw3iFewIIXoeOxV4HTcuAQ==
JNTP-Uri: http://news2.nemoweb.net/?DataID=gj4ga-l0y_PDBOTgf6JADAL78wg@jntp
User-Agent: Nemo/0.999a
JNTP-OriginServer: news2.nemoweb.net
Date: Mon, 10 Jul 23 09:25:33 +0000
Organization: Nemoweb
JNTP-Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0
Injection-Info: news2.nemoweb.net; posting-host="fd5675444fb2abe5cff243786215e1a6f7fd1bea"; logging-data="2023-07-10T09:25:33Z/8054867"; posting-account="44@news2.nemoweb.net"; mail-complaints-to="newsmaster@news2.nemoweb.net"
JNTP-ProtocolVersion: 0.21.1
JNTP-Server: PhpNemoServer/0.94.5
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-JNTP-JsonNewsGateway: 0.96
From: pehache.7@gmail.com (pehache)
 by: pehache - Mon, 10 Jul 2023 09:25 UTC

Le 10/07/2023 à 09:50, gah4 a écrit :
> On Monday, July 10, 2023 at 12:27:09 AM UTC-7, Thomas Koenig wrote:
>> gah4 <ga...@u.washington.edu> schrieb:
>> > On Sunday, July 9, 2023 at 4:04:19 AM UTC-7, Thomas Koenig wrote:
>
> (snip)
>
>> >> What would this bring that is not covered with
>> >
>> >> no intent
>> >> INTENT(IN)
>> >> INTENT(OUT)
>> >> INTENT(INOUT)
>> >> VALUE
>> >> INTENT(IN), VALUE
>
>> > It could have been added before INTENT, but wasn't.
>
>> > It could still be added for the no intent case, and for the INTENT(INOUT)
>> case.
>
>> > In both cases, it indicates ignoring of any returned (modified) values.
>
>> How is that different from VALUE?
>
> If you call with a variable, you get the changed value.
>
> With a constant, expression, or variable in parentheses, the latter being
> a form of expression, you don't get the new value.

The whole intent of INTENT() was to enable more compile-time error
detections. If a constant or an expression is given as the actual argument
when the dummy argument has INTENT(OUT) the compiler can infer this is an
error.

I get what you mean, for an INTENT(INOUT) dummy sometimes you are not
interested in the returned value, so passing a constant or an expression
could do. But at the end here it would mean less possible error detections
by the compiler.

I think the way to properly manage that with the current rules is to have
2 arguments instead of one: an "INTENT(IN), VALUE" dummy where you can
pass whatever you like, and an INTENT(OUT), OPTIONAL dummy for the return
value if desired. "VALUE" is important here to prevent aliasing in the
case the two actual arguments are the same object (but one should check if
it is permitted by the standard, anyway).

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor