comp.lang.ada
 help / color / mirror / Atom feed
* Mutually Recursive Data-Structures in Ahis on csnet a couple of times a
  1985-09-21 10:27 ` Mutually Recursive Data-Structures in Ahis on csnet a couple of times a Mats_Ohlin_FOA2%QZCOM.MAILNET
@ 1985-09-21 10:03   ` Mats_Ohlin_FOA2%QZCOM.MAILNET
  0 siblings, 0 replies; 2+ messages in thread
From: Mats_Ohlin_FOA2%QZCOM.MAILNET @ 1985-09-21 10:03 UTC (permalink / raw)


This is how it works (on a DEC-10 system):
.;---------------------------
.;create module 1
.make a1.sim
*ioptions(/E);          -- tells the compiler that this is an ext. module
class a1;
begin  ref (b1) bx;  end a1;
$ex$$

.comp a1.sim           -- compile module 1
SIMULA:  A1
begin  ref (b1) bx;  end a1;
SIM331  E LINE     3     QUALIFICATION b1 IS NOT A CLASS  -- b1 is unknown

.; create module 2, now including external decl.
.make b1.sim
*ioptions(/E);
external class a1;      -- now OK since A1.ATR exists, however uncomplete
class b1;
begin  ref (a1) ax;  end b1;
$ex$$

.dir/n ?1
A1      SIM     1  <057>   20-Sep-85    A1      ATR     1  <057>   20-Sep-85
A1      REL     1  <057>   20-Sep-85    B1      SIM     1  <057>   20-Sep-85

.com b1.sim            -- compile module 2
SIMULA:  B1

EXIT

.te a1.sim
*liexternal class b1;           -- add external decl.
$ht$$
options(/E);
external class b1;
class a1;
begin  ref (b1) bx;  end a1;
*ex$$

.com a1.sim            -- recompile module 1 using correct B1.ATR
SIMULA:  A1

NEW ATR FILE GENERATED          -- compiler warns user
RECOMPILE DEPENDENT PROGRAMS    -- that recompilation may be necessary

EXIT

.com/com b1.sim
SIMULA:  B1

NEW ATR FILE GENERATED

EXIT

.dir/n ?1
A1      BAK     1  <057>   20-Sep-85    A1      QTR     1  <057>   20-Sep-85
A1      REL     1  <057>   20-Sep-85    B1      SIM     1  <057>   20-Sep-85
B1      QTR     1  <057>   20-Sep-85    B1      REL     1  <057>   20-Sep-85
A1      SIM     1  <057>   20-Sep-85    A1      ATR     1  <057>   20-Sep-85
B1      ATR     1  <057>   20-Sep-85

.;--- QTR files are backup versions of created ATR files
.;--- *very* useful whenever you find that you would rather
.;--- backtrack than force everyone (dependent) to recompile...

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Mutually Recursive Data-Structures in Ahis on csnet a couple of times a
       [not found] <123604@QZCOM>
@ 1985-09-21 10:27 ` Mats_Ohlin_FOA2%QZCOM.MAILNET
  1985-09-21 10:03   ` Mats_Ohlin_FOA2%QZCOM.MAILNET
  0 siblings, 1 reply; 2+ messages in thread
From: Mats_Ohlin_FOA2%QZCOM.MAILNET @ 1985-09-21 10:27 UTC (permalink / raw)


This problem is well known in other languages, e.g. SIMULA.
The problem is not covered in the language definition, however
at least some systems allow the user to compile the first unit
in which the compilation fails *but still generates some attribute
information /used by the compiler when compiling dependent modules/*.
This first compilation then lacks the necessary EXTERNAL declaration
(==> module 2).
Then compiling module 2 is possible even if it is referring to
an uncomplete definition of module 1. Recompiling module 1, this
time including the EXTERNAL declaration, recompiling module 2
and finally recompiling module 1 solves the problem. Cumbersome
maybe, but it works and with full security.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1985-09-21 10:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <123604@QZCOM>
1985-09-21 10:27 ` Mutually Recursive Data-Structures in Ahis on csnet a couple of times a Mats_Ohlin_FOA2%QZCOM.MAILNET
1985-09-21 10:03   ` Mats_Ohlin_FOA2%QZCOM.MAILNET

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox