Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!dsinc!ub!bowen From: bowen@cs.Buffalo.EDU (Devon E Bowen) Newsgroups: comp.lang.modula2 Subject: definition module loops Message-ID: <75730@eerie.acsu.Buffalo.EDU> Date: 9 May 91 19:28:37 GMT Sender: news@acsu.Buffalo.EDU Organization: State University of New York at Buffalo/Comp Sci Lines: 30 Nntp-Posting-Host: castor.cs.buffalo.edu Originator: bowen@castor.cs.buffalo.edu What are the rules regarding circular imports? For example, the following code must be invalid because 'a' is never declared. DEFINITION MODULE file1; FROM file2 IMPORT a; END file1. DEFINITION MODULE file2; FROM file1 IMPORT a; END file2. Yet it seems like the following should be valid because there is no such conflict. DEFINITION MODULE file1; FROM file2 IMPORT b; VAR a : INTEGER; END file1. DEFINITION MODULE file2; FROM file1 IMPORT a; VAR b : INTEGER; END file2. I haven't been able to find anywhere in Wirth's 4th edition that addresses this issue. So what are the formal rules in this situation and what techniques do most Modula-2 compilers use to implement them? Devon