From owner-sc22wg5+sc22wg5-dom8=www.open-std.org@open-std.org  Tue Sep 26 23:42:03 2017
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 8D76D3587F5; Tue, 26 Sep 2017 23:42:03 +0200 (CEST)
Delivered-To: sc22wg5@open-std.org
Received: from mail-pf0-f179.google.com (mail-pf0-f179.google.com [209.85.192.179])
	(using TLSv1 with cipher AES128-SHA (128/128 bits))
	(No client certificate requested)
	by www.open-std.org (Postfix) with ESMTP id 95BB2358676
	for <sc22wg5@open-std.org>; Tue, 26 Sep 2017 23:42:02 +0200 (CEST)
Received: by mail-pf0-f179.google.com with SMTP id r68so6181431pfj.3
        for <sc22wg5@open-std.org>; Tue, 26 Sep 2017 14:42:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=sourceryinstitute.org; s=google;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version;
        bh=8DbyMy1+XgWJVftlVCguPbAeyyKcnu5NckHxx/duKJ4=;
        b=d9tSxMO34ncLdSAduguJPd6CwVDK0YesfnC5Yw/A8bRUlLy1yJHGg+nJuF9E4sc1Zo
         PQfLC7chStIVZn4939zfFOF8a97xlj6iCVgnMpjaZ92o4nS4lv61IcUNkWczOqIOI/v7
         73aG4LuK6EfnZRDWT2mcor5QE7c3Q3Zgh7FwjZgALVHgfuJgbgLVzyOJodoh27jsH4vR
         qji1p3o96eQKiGZE7NPgwKzShlkadz9Y4Wulevh16BN/8p+49s4khhZRUiNami3TBztC
         MaX8y6TEUFkLzdqNRPl7gFOj8x5xxU+bs4W20NEA7qnNu93qLFCDaCg9mKOHoKzsgCcx
         46lg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version;
        bh=8DbyMy1+XgWJVftlVCguPbAeyyKcnu5NckHxx/duKJ4=;
        b=Lnin1dHG23goNEAEkIkJczUr+Q0oMJaIBpI+e+yeIc9FYYtzHZT6AuYKAhHx/zvNRh
         bDfYeaZff8a71vq1UrPrgvMDGvZTZx4aLqiFtfpz2kHTm8IkwJEtrO0fvMjCoq2CBY+7
         YQXSKeFYGk/9hlte8gE3fyBAMXylsg6KHkISQJx7e0hdCWw4uiL/eR1w+W6kz2sY91XD
         yKKkJEXG6qTceSgJAt0bi3pNtEIeEMouBqyZP9MpePRCj6ww6CAwL7GZ01DoCcv8Rl2I
         3AVEFpOMg1GopeATgkELvZZP0zRDWanogqB3lmBDgHqRbOX8/1UFGrqW6GbestIklpfo
         fLCA==
X-Gm-Message-State: AHPjjUi3DVBVEFVMp2LWIYAwhp4VZJrj+Fy/8IRjlfG/20DehE5Wh0yq
	uQvptlf48nBhlatQKrgW7HpF/Q==
X-Google-Smtp-Source: AOwi7QAaIRp/XwartyA3F7O2nsUkCpEtvAUOCEUmgA38oMRxHyQcBJagYdWUyJyTdqP9XnkdQkZcSw==
X-Received: by 10.84.240.196 with SMTP id l4mr11692268plt.261.1506462120908;
        Tue, 26 Sep 2017 14:42:00 -0700 (PDT)
Received: from localhost.mail ([50.233.164.226])
        by smtp.gmail.com with ESMTPSA id l131sm18372563pga.24.2017.09.26.14.41.59
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 26 Sep 2017 14:41:59 -0700 (PDT)
Date: Tue, 26 Sep 2017 14:41:58 -0700
From: Damian Rouson <damian@sourceryinstitute.org>
To: Bill Long <longb@cray.com>, fortran standards email list for J3
 <j3@mailman.j3-fortran.org>
Cc: WG5 <sc22wg5@open-std.org>
Message-ID: <etPan.59cac9a6.83b4fb6.b1c@sourceryinstitute.org>
In-Reply-To: <20170926212625.B452F3587DC@www.open-std.org>
References: <20170926174021.A8F283587DC@www.open-std.org>
 <20170926212625.B452F3587DC@www.open-std.org>
Subject: Re: (j3.2006) (SC22WG5.5958) generic programming in F2020
X-Mailer: Airmail (442)
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="59cac9a6_5851525b_b1c"
Sender: owner-sc22wg5@open-std.org
Precedence: bulk

--59cac9a6_5851525b_b1c
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On September 26, 2017 at 2:26:29 PM, Bill Long (longb=40cray.com) wrote:
Hi WG5/J3,

Attached is a short write-up of a simpler version for templates that=E2=80=
=99s been informally discussed for a while.


Is it appropriate to comment on this write-up now or should discussion wa=
it until the meeting=3F =C2=A0I have =C2=A0question about the following t=
ext in the paper:

=225) Template procedures have to be defined in a MODULE=E2=80=A6=E2=80=9D=


Does =E2=80=9Cdefined=E2=80=9D include cases in which only an interface b=
ody is provided in the MODULE such as below=3F =C2=A0If so, maybe the sta=
tement should be that the procedure must be a module procedure.

=C2=A0 =C2=A0 =C2=A0 =C2=A0Example : =C2=A0
		module foo=5Fmod
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 contains
		=C2=A0 =C2=A0 template module function foo(x,y) result(w)
		=C2=A0 =C2=A0 =C2=A0 implicit none
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 real(*) :: x, y
	=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 type(same=5Fas(x)) :: w=

		=C2=A0 =C2=A0 end function foo
		 =C2=A0end module foo=5Fmod

		=C2=A0 submodule(foo=5Fmod) foo=5Fmod=5Fdefinition
		=C2=A0 contains
		=C2=A0 =C2=A0 template module procedure foo
		=C2=A0 =C2=A0 =C2=A0 w =3D x*y
		=C2=A0=C2=A0=C2=A0end procedure foo
		=C2=A0 end submodule

		 =C2=A0program test
		 =C2=A0use foo=5Fmod
		 =C2=A0real(8) :: a,b,c
		 =C2=A0a =3D 3.14=5F8
		 =C2=A0b =3D 2.7=5F8
		 =C2=A0c =3D foo(a,b)
		 =C2=A0print *, c
		 =C2=A0end program test

Damian
--59cac9a6_5851525b_b1c
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

<html><head><style>body=7Bfont-family:Helvetica,Arial;font-size:13px=7D</=
style></head><body style=3D=22word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;=22><div id=3D=22bloop=5Fcust=
omfont=22 style=3D=22font-family:Helvetica,Arial;font-size:13px; color: r=
gba(0,0,0,1.0); margin: 0px; line-height: auto;=22>On September 26, 2017 =
at 2:26:29 PM, Bill Long (<a href=3D=22mailto:longb=40cray.com=22>longb=40=
cray.com</a>) wrote:</div> <blockquote type=3D=22cite=22 class=3D=22clean=
=5Fbq=22><span><div><div></div><div>



<title></title>


<div class=3D=22Body=46ragment=22>
<div class=3D=22PlainText=22><font size=3D=222=22><span style=3D=22font-s=
ize:10pt;=22>Hi WG5/J3,<br>
<br>
Attached is a short write-up of a simpler version for templates
that=E2=80=99s been informally discussed for a while.<br>
<br></span></font></div></div></div></div></span></blockquote><br><div>Is=
 it appropriate to comment on this write-up now or should discussion wait=
 until the meeting=3F &nbsp;I have &nbsp;question about the following tex=
t in the paper:</div><div><br></div><div>=225) Template procedures have t=
o be defined in a MODULE=E2=80=A6=E2=80=9D</div><div><br></div><div>Does =
=E2=80=9Cdefined=E2=80=9D include cases in which only an interface body i=
s provided in the MODULE such as below=3F &nbsp;If so, maybe the statemen=
t should be that the procedure must be a module procedure.</div><div><br>=
</div><div>&nbsp; &nbsp; &nbsp; &nbsp;Example : &nbsp;</div><div><span cl=
ass=3D=22Apple-tab-span=22 style=3D=22white-space:pre=22>		</span>module =
foo=5Fmod</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; contains</div><div><span class=3D=22Apple-tab-span=22 style=3D=22=
white-space:pre=22>		</span>&nbsp; &nbsp; template module function foo(x,=
y) result(w)</div><div><span class=3D=22Apple-tab-span=22 style=3D=22whit=
e-space:pre=22>		</span>&nbsp; &nbsp; &nbsp; implicit none</div><div>&nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
real(*) :: x, y</div><div><span class=3D=22Apple-tab-span=22 style=3D=22w=
hite-space:pre=22>	</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; type(same=5Fas(x)) :: w</div><div><span class=3D=22Apple-tab-span=22 st=
yle=3D=22white-space: pre;=22>		</span>&nbsp; &nbsp; end function foo</di=
v><div><span class=3D=22Apple-tab-span=22 style=3D=22white-space:pre=22>	=
	</span> &nbsp;end module foo=5Fmod</div><div><br></div><div><span class=3D=
=22Apple-tab-span=22 style=3D=22white-space:pre=22>		</span>&nbsp; submod=
ule(foo=5Fmod) foo=5Fmod=5Fdefinition</div><div><span class=3D=22Apple-ta=
b-span=22 style=3D=22white-space:pre=22>		</span>&nbsp; contains</div><di=
v><div><span class=3D=22Apple-tab-span=22 style=3D=22white-space: pre;=22=
>		</span>&nbsp; &nbsp; template module procedure foo</div><div><span cla=
ss=3D=22Apple-tab-span=22 style=3D=22white-space: pre;=22>		</span>&nbsp;=
 &nbsp; &nbsp; w =3D x*y</div></div><div><span class=3D=22Apple-tab-span=22=
 style=3D=22white-space: pre;=22>		</span>&nbsp;&nbsp;&nbsp;end procedure=
 foo</div><div><span class=3D=22Apple-tab-span=22 style=3D=22white-space:=
pre=22>		</span>&nbsp; end submodule</div><div><br></div><div><span class=
=3D=22Apple-tab-span=22 style=3D=22white-space:pre=22>		</span> &nbsp;pro=
gram test</div><div><span class=3D=22Apple-tab-span=22 style=3D=22white-s=
pace:pre=22>		</span> &nbsp;use foo=5Fmod</div><div><span class=3D=22Appl=
e-tab-span=22 style=3D=22white-space:pre=22>		</span> &nbsp;real(8) :: a,=
b,c</div><div><span class=3D=22Apple-tab-span=22 style=3D=22white-space:p=
re=22>		</span> &nbsp;a =3D 3.14=5F8</div><div><span class=3D=22Apple-tab=
-span=22 style=3D=22white-space:pre=22>		</span> &nbsp;b =3D 2.7=5F8</div=
><div><span class=3D=22Apple-tab-span=22 style=3D=22white-space:pre=22>		=
</span> &nbsp;c =3D foo(a,b)</div><div><span class=3D=22Apple-tab-span=22=
 style=3D=22white-space:pre=22>		</span> &nbsp;print *, c</div><div><span=
 class=3D=22Apple-tab-span=22 style=3D=22white-space:pre=22>		</span> &nb=
sp;end program test</div><div><br></div><div>Damian</div></body></html>
--59cac9a6_5851525b_b1c--

