🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.f77
Article #307

Re: Question on "Parameter" statement; and a new question!

#307
From: Donn Seeley
Date: Fri, 31 Jan 1986 01:08
32 lines
2155 bytes
Peter Shenkin's new question:

	... I always thought PARAMETER definitions were not subject to
	the IMPLICIT rules; VMS Fortran behaves according to my
	preconception, at least in this example.  So am I wrong, or is
	[it a bug that Unix f77 makes PARAMETER constants have implicit
	types] ?

I don't have a copy of VMS Fortran to play with, but I believe you'll
find that both VMS Fortran and Unix f77 give implicit types to
PARAMETER constants, except for those constants whose names are
declared in explicit type statements.  Section 8.6 of the standard
says:  'If a symbolic name of a constant is not of default implied
type, its type must be specified by a type-statement or IMPLICIT
statement prior to its first appearance in a PARAMETER statement.' In
particular, 'Each [symbolic name] becomes defined with the value
determined from the expression ... that appears on the right of the
equals, in accordance with the rules for assignment statements...' I
was aware of this when I posted the article to which Peter Shenkin is
replying, but (sigh) I forgot to point it out, and I should have, since
it is very easy to overlook.  Thus a more complete example is:

	integer size
	parameter (size = 10)
	character*(size) string

So why does VMS Fortran accept the example without an integer type
declaration for 'size'?  Well, I imagine it simply converts 'size' to
integer type before using it as a length, another extension to the
standard among the many it contains.

Donn Seeley    University of Utah CS Dept    donn@utah-cs.arpa
Technical Details
Message-ID: <3656@utah-cs.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbosgd!gatech!seismo!utah-cs!donn
References: <410@cubsvax.UUCP> <3651@utah-cs> <413@cubsvax.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbosgd!gatech!seismo!utah-cs!donn
From: donn@utah-cs.UUCP (Donn Seeley)
Newsgroups: net.lang.f77
Subject: Re: Question on "Parameter" statement;  and a new question!
Message-ID: <3656@utah-cs.UUCP>
Date: Thu, 30-Jan-86 20:08:17 EST
Article-I.D.: utah-cs.3656
Posted: Thu Jan 30 20:08:17 1986
Date-Received: Sat, 1-Feb-86 06:10:50 EST
References: <410@cubsvax.UUCP> <3651@utah-cs> <413@cubsvax.UUCP>
Organization: University of Utah CS Dept
Lines: 32
Summary: We need to declare 'integer size'