🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #3781

Re: Redundant import

#3781
From: fred sullivan
Date: Wed, 26 Aug 1987 20:55
37 lines
2621 bytes
In article <3785@well.UUCP> samlb@well.UUCP (Samuel B. Bassett) writes:
>In article <802@newton.physics.purdue.edu> hal@newton.physics.purdue.edu (Hal Chambers) writes:
>
>>It is not necessary to repeat the imports in the implementation module
>>since the all declarations of the definition module are automatically
>>known to the implementation module.  The implementation module only
>>needs to import names which are to be hidden from the definition module.
>
>	As a followup, is it then considered a bug about which one is 
>justified in screaming at the compiler writer, when objects imported in the 
>DEFINITION Module are _NOT_ visible when compiling the IMPLEMENTATION Module?

There has been discussion of this in the past, to which I did not
contribute.  Thus I'll have my say now.  I am going to quote from Wirth,
second edition.  (Sorry, I don't have third edition so I don't know what it
says.)
Page 164:  "Both [implementation modules and definition modules] may contain
import lists, and all objects declared in the definition module are
available in the corresponding implementation module without explicit
import."
Thus the only possible question is:  Does an import constitute a
declaration?  I can't find a direct answer to this question, but I can find
an indirect answer.
Page 159:  "Standard identifiers are always imported automatically.  As a
consequence, standard identifiers can be redeclared in procedures only, but
not in modules ..."
And how were they declared to begin with?  By the automatic IMPORT.

I claim it's a bug, and one is completely justified in screaming at the
compiler writer.  Rumor has it that the Waterloo compiler also behaves this
way.  Does anyone know the truth?

Fred Sullivan
Department of Mathematical Sciences
State University of New York at Binghamton
Binghamton, New York  13903
Email: sullivan@marge.math.binghamton.edu
Technical Details
Message-ID: <670@bingvaxu.cc.binghamton.edu>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!cmcl2!rutgers!sunybcs!bingvaxu!marge.math.binghamton.edu!sullivan
References: <802@newton.physics.purdue.edu> <3785@well.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!mnetor!uunet!husc6!cmcl2!rutgers!sunybcs!bingvaxu!marge.math.binghamton.edu!sullivan
From: sullivan@marge.math.binghamton.edu (fred sullivan)
Newsgroups: comp.lang.modula2
Subject: Re: Redundant import
Message-ID: <670@bingvaxu.cc.binghamton.edu>
Date: Wed, 26-Aug-87 16:55:58 EDT
Article-I.D.: bingvaxu.670
Posted: Wed Aug 26 16:55:58 1987
Date-Received: Fri, 28-Aug-87 06:35:50 EDT
References: <802@newton.physics.purdue.edu> <3785@well.UUCP>
Sender: news@bingvaxu.cc.binghamton.edu
Reply-To: sullivan@marge.math.binghamton.edu (fred sullivan)
Organization: Department of Mathematical Sciences, SUNY-Binghamton
Lines: 37