From owner-sc22wg5+sc22wg5-dom8=www.open-std.org@open-std.org  Tue Jun 16 23:13:04 2015
Return-Path: <owner-sc22wg5+sc22wg5-dom8=www.open-std.org@open-std.org>
X-Original-To: sc22wg5-dom8
Delivered-To: sc22wg5-dom8@www.open-std.org
Received: by www.open-std.org (Postfix, from userid 521)
	id 09C573586E6; Tue, 16 Jun 2015 23:13:03 +0200 (CEST)
Delivered-To: sc22wg5@open-std.org
Received: from mail-yh0-f42.google.com (mail-yh0-f42.google.com [209.85.213.42])
	(using TLSv1 with cipher RC4-SHA (128/128 bits))
	(No client certificate requested)
	by www.open-std.org (Postfix) with ESMTP id 1018B3568C8
	for <sc22wg5@open-std.org>; Tue, 16 Jun 2015 23:13:03 +0200 (CEST)
Received: by yhak3 with SMTP id k3so20496302yha.2
        for <sc22wg5@open-std.org>; Tue, 16 Jun 2015 14:13:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type;
        bh=a3NYUmcSc2AhFXLE2QmeGezk7XZEC3d8jFBt/8/at7k=;
        b=cCYZqzgFecIVbHBRfcyxEOEgZm56M1L1PtNfzVJjaYpKsuMogIyG5zJbjdFEdbqMnc
         5o/CUjTZYnni6cic57HoPO7tHeZOAvk8WoJcKds8bSKmyRZs2PdF/kSkioDRtD7mqxdK
         Gub43tHC4M/EpPfE9Ker03yXKp1BmwIGCmqOFcr+hQA1kxxqfCFSC/4rkuAZCU18olzi
         mFQldwqKf3VTO/aRlK7N2KpcDzDd+iPRkT5tFi0nzlfAdS3u4jpKcJDFnaRLXRWx72M+
         N1DnQnyCFvCNIqM0mZ8iywDzOqDgJ+5/X+B1Y6SdKOTxllbQ3v4qZt3iyDkiqVZZ9J0k
         Kyxw==
MIME-Version: 1.0
X-Received: by 10.170.47.197 with SMTP id 188mr2876924ykp.62.1434489181908;
 Tue, 16 Jun 2015 14:13:01 -0700 (PDT)
Received: by 10.13.253.5 with HTTP; Tue, 16 Jun 2015 14:13:01 -0700 (PDT)
In-Reply-To: <CAPsJ1NayrHnG9WL_YtX7npUroY-Ee_uQkFi=xxbsgvJTYuZXJw@mail.gmail.com>
References: <CAPsJ1NayrHnG9WL_YtX7npUroY-Ee_uQkFi=xxbsgvJTYuZXJw@mail.gmail.com>
Date: Tue, 16 Jun 2015 14:13:01 -0700
Message-ID: <CAPsJ1Nb7_JC30WmfUu2S6WM7iUEQqYd9EdgPqvSxQ=RKhW2D9Q@mail.gmail.com>
Subject: Re: Assignment to ero-sized strings and arrays
From: Walt Brainerd <walt.brainerd@gmail.com>
To: fortran standards email list for J3 <j3@j3-fortran.org>, "sc22wg5@open-std.org" <sc22wg5@open-std.org>
Content-Type: multipart/alternative; boundary=001a1139e6aa1f38c20518a90a0f
Sender: owner-sc22wg5@open-std.org
Precedence: bulk

--001a1139e6aa1f38c20518a90a0f
Content-Type: text/plain; charset=UTF-8

OK, I agree with Malcolm that just because there are false
statements in the standard, it doesn't mean implementors
will follow them.

But to make the standard consistent, the following should be added:

No value is assigned to the variable if it is of type integer, real, or
complex and its value is zero.

And for completeness, we need to include the logical type.
What is the exceptional value for logical? I guess false is
the better candidate.

On Tue, May 26, 2015 at 3:27 PM, Walt Brainerd <walt.brainerd@gmail.com>
wrote:

> I am willing to try this one more time.
>
> Tell me I am crazy, stupid, or whatever; it has happened before.
>
> But to ignore this puzzles me. Is anybody going to correct this error?
>
> 7.2.1.3(1) of the F08 standard says:
>
> No value is assigned to the variable if it is of type character and zero
> length, or is an array of size zero.
>
> It is still in N2014, if that is the latest.
>
> Consider the program:
>
> program f
> character(len=:), allocatable :: c
> c = ""
> print *, len(c), "X"//C//"X"
> c = "QQQ"
> print *, len(c), "X"//C//"X"
> end program f
>
> The sentence quoted says that the second assignment does not
> assign the value QQQ because the length of c is zero. I don't
> think that is what is intended.
>
> Just delete the sentence' it was silly, but wasn't wrong in F95.
>
> --
> Walt Brainerd
>



-- 
Walt Brainerd

--001a1139e6aa1f38c20518a90a0f
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">OK, I agree with Malcolm that just because there are false=
<div>statements in the standard, it doesn&#39;t mean implementors</div><div=
>will follow them.</div><div><br></div><div>But to make the standard consis=
tent, the following should be added:</div><div><br></div><div><span style=
=3D"font-size:12.8000001907349px">No value is assigned to the variable if i=
t is of type integer, real, or</span><br></div><div><span style=3D"font-siz=
e:12.8000001907349px">complex and its value is zero.</span></div><div><span=
 style=3D"font-size:12.8000001907349px"><br></span></div><div><span style=
=3D"font-size:12.8000001907349px">And for completeness, we need to include =
the logical type.</span></div><div><span style=3D"font-size:12.800000190734=
9px">What is the exceptional value for logical? I guess false is</span></di=
v><div><span style=3D"font-size:12.8000001907349px">the better candidate.</=
span></div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">=
On Tue, May 26, 2015 at 3:27 PM, Walt Brainerd <span dir=3D"ltr">&lt;<a hre=
f=3D"mailto:walt.brainerd@gmail.com" target=3D"_blank">walt.brainerd@gmail.=
com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr=
">I am willing to try this one more time.<div><br></div><div>Tell me I am c=
razy, stupid, or whatever; it has happened before.<div><br></div><div>But t=
o ignore this puzzles me. Is anybody going to correct this error?</div><div=
><br></div><div><span style=3D"font-size:12.8000001907349px">7.2.1.3(1) of =
the F08 standard says:</span><div style=3D"font-size:12.8000001907349px"><b=
r></div><div style=3D"font-size:12.8000001907349px"><div>No value is assign=
ed to the variable if it is of type character and zero</div><div>length, or=
 is an array of size zero.</div><div><br></div><div>It is still in N2014, i=
f that is the latest.</div><div><br></div><div>Consider the program:</div><=
div><br></div><div><div style=3D"font-size:12.8000001907349px">program f</d=
iv><div style=3D"font-size:12.8000001907349px">character(len=3D:), allocata=
ble :: c</div><div style=3D"font-size:12.8000001907349px">c =3D &quot;&quot=
;</div><div style=3D"font-size:12.8000001907349px">print *, len(c), &quot;X=
&quot;//C//&quot;X&quot;</div><div style=3D"font-size:12.8000001907349px">c=
 =3D &quot;QQQ&quot;</div><div style=3D"font-size:12.8000001907349px">print=
 *, len(c), &quot;X&quot;//C//&quot;X&quot;</div><div style=3D"font-size:12=
.8000001907349px">end program f</div></div><div style=3D"font-size:12.80000=
01907349px"><br></div><div style=3D"font-size:12.8000001907349px">The sente=
nce quoted says that the second assignment does not</div><div style=3D"font=
-size:12.8000001907349px">assign the value QQQ because the length of c is z=
ero. I don&#39;t</div><div style=3D"font-size:12.8000001907349px">think tha=
t is what is intended.</div><div style=3D"font-size:12.8000001907349px"><br=
></div><div style=3D"font-size:12.8000001907349px">Just delete the sentence=
&#39; it was silly, but wasn&#39;t wrong in F95.</div></div></div><span cla=
ss=3D"HOEnZb"><font color=3D"#888888"><div><br></div>-- <br><div>Walt Brain=
erd</div>
</font></span></div></div>
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div class=
=3D"gmail_signature">Walt Brainerd</div>
</div>

--001a1139e6aa1f38c20518a90a0f--
