From maine@altair.dfrc.nasa.gov  Tue Jun 12 20:54:38 2001
Received: from mailhub.dfrc.nasa.gov (mailhub.dfrc.nasa.gov [130.134.81.12])
	by dkuug.dk (8.9.2/8.9.2) with ESMTP id UAA60540
	for <sc22wg5@dkuug.dk>; Tue, 12 Jun 2001 20:54:36 +0200 (CEST)
	(envelope-from maine@altair.dfrc.nasa.gov)
Received: from mail.dfrc.nasa.gov by mailhub.dfrc.nasa.gov with ESMTP; Tue, 12 Jun 2001 11:51:28 -0700
Received: from altair.dfrc.nasa.gov ([130.134.129.8]) by mail.dfrc.nasa.gov
          (Post.Office MTA v3.5.3 release 223 ID# 0-71686U2500L200S0V35)
          with ESMTP id gov; Tue, 12 Jun 2001 11:52:53 -0700
Received: (from maine@localhost)
	by altair.dfrc.nasa.gov (8.11.0/8.11.0) id f5CIqoQ25221;
	Tue, 12 Jun 2001 11:52:50 -0700
From: Richard Maine <maine@altair.dfrc.nasa.gov>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-Id: <15142.25858.266642.37267@altair.dfrc.nasa.gov>
Date: Tue, 12 Jun 2001 11:52:50 -0700 (PDT)
To: Markus Lundblad <ml@update.uu.se>
cc: sc22wg5@dkuug.dk
Subject: Fortran 2000 suggestion
In-Reply-To: <Pine.LNX.4.21.0106122002280.8003-100000@Tempo.Update.UU.SE>
References: <Pine.LNX.4.21.0106122002280.8003-100000@Tempo.Update.UU.SE>
X-Mailer: VM 6.75 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid

Markus Lundblad writes:
 > I don't know if you're the right person to send this to (I saw your adress
 > on WG5 homepage).

No, I'm not the right person, though I will pass the request along.
Technically "right" way to get such feature requests into the language
is to submit them to wg5 via one of the national member bodies.  WG5
gets all its input through national member bodies.
On the other hand, even though the member bodies are identified by
nationality, there is no reason why your input has to come only
through a member body from your country.  If you could convince any
of the national bodies that your request is a good idea, then they
could bring that request to wg5.

I am forwarding your request (preceded by this reply of mine) to the
wg5 mailing list.  That should allow it to be seen by all the wg5
members.  If any national body members decide to adopt it as part
of their national position, that is a decision they can make.

Note that this is not a particularly good time for new feature
requests.  The f2k draft is now in the integration phase, where
the emphasis is on making sure that all the features already
incorporated into the draft are properly integrated.  Adding new
features at this point in the process would be disruptive to the
integration process, likely causing further schedule slips.  The
feature set for f2k is supposed to have been already settled on.
Thus, I am suspect that the odds of your request being incorporated
into f2k are low.  It is just too late for the f2k version - perhaps
the next one (whatever that may be - it isn't yet decided).  But this
is not my decision to make - I am only offering my opinion on your
odds of sucess in getting this into f2k.

In the case of your particular request, I will note that I have seen
requests for similar functionality before and I am personally in
favor of something along this general line, possibly with some
variation in details.  However, that is my personal opinion and as
such has no official standing.  It might be among the kinds of things
that I would advocate for in the version after f2k.

P.S. Your sample code for what you say you have to do now won't
work as is.  If an optional argument is not present, not only doesn't
it have a value, it doesn't even exist at all - that is you can't
assign if a value.  What you have to do now is actually more
complicated than you show (and thus, I think makes the argument
better).  You need to do something more like

   subroutine(param)
     integer, optional :: param
     integer :: local_param
            ...
     if (present(param)) then
       local_param = param
     else
       local_param = 1
     end if
     ...
     !--  Possibly similar code to copy local_param back to param if present.
 

-- 
Richard Maine                |  Good judgment comes from experience;
maine@altair.dfrc.nasa.gov   |  experience comes from bad judgment.
                             |        -- Mark Twain

(Forwarded message follows)

 > 
 > I have a suggestion concerning optional parameters in Fortran.
 > If have a subrotine that takes some parameter, for which I would like to
 > have a default value I have to do something like:
 > 
 > subroutine(param)
 >    integer,optional::param
 >    ....
 > 
 >    if(.not. present(param)) then
 >       param=1
 >    end if
 >    ....
 > end
 > 
 > for example, this is quite common, to have default values.
 > I would like to be able to skip the "manual" init in an if-statement here.
 > 
 > something like
 > 
 > subroutine(param)
 >    integer::param = 1
 >    ....
 >    ....
 > end
 > 
 > 
 > I think this kind of code is quite common and I couldn't find any feature
 > like this in the draft for Fortran 2000.
 > 
 > Yours sincerly Marcus Lundblad

