🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #2227

Re: Request For Comment About Handling Of Globals

#2227
From: Richard Harter
Date: Fri, 23 Nov 1990 08:23
50 lines
2212 bytes
In article <chl.658750215@m1>, chl@cs.man.ac.uk (Charles Lindsey) writes:

> What you want is variables whose "extent" (i.e. lifetime) is forever, but
> whose "scope" is restricted to the bodies of the procedures which need to
> share them.

	Agreed.  [Lifetime need not be forever.]

> What you want, therefore, is a modules facility, as in Modula-2 or Ada (where
> they are called packages) - not that those particular languages have
> necessarily made a perfect job of modules.

Well, yes.  However I can't say I'm all that happy with what either
language does (I am more familiar with ADA than Modula-2.)  For example,
suppose that in Fortran 2001++ we have the code

	package foobar
		public x y z proc1 proc2
		private a b c proc3
		from another_package d proc4
		....

This sort of thing seems plausible.  Now come some questions.  Can we
nest packages?  If so, can nested packages at different locations in
the nesting tree refer to each other?  Can packages contain code which
is not in procedures?  If so, when is this code executed?  What about
this situation?

	package foobar
	program xyzzy
		....
		use foobar
		....
	program plugh
		....
		use foobar

Are these two separate name spaces or do the two programs share the
name space?  Suppose we have two different libraries, each with a
foobar package?

One of the complications is that, for my purposes, I want to avoid
additional syntax.  Solutions that use qualified names with special
characters to separate fields lose.
		....
-- 
Richard Harter, Software Maintenance and Development Systems, Inc.
Net address: jjmhome!smds!rh Phone: 508-369-7398 
US Mail: SMDS Inc., PO Box 555, Concord MA 01742
This sentence no verb.  This sentence short.  This signature done.
Technical Details
Message-ID: <253@smds.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!rutgers!psuvax1!husc6!m2c!jjmhome!smds!rh
References: <242@smds.UUCP> <chl.658750215@m1>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!rutgers!psuvax1!husc6!m2c!jjmhome!smds!rh
From: rh@smds.UUCP (Richard Harter)
Newsgroups: comp.lang.misc
Subject: Re: Request For Comment About Handling Of Globals
Summary: Trees versus horizontal passage
Message-ID: <253@smds.UUCP>
Date: 23 Nov 90 08:23:01 GMT
References: <242@smds.UUCP> <chl.658750215@m1>
Organization: SMDS Inc., Concord, MA
Lines: 50