[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gm2] Exporting and Importing amongst inner modules
From: |
Gaius Mulley |
Subject: |
Re: [Gm2] Exporting and Importing amongst inner modules |
Date: |
Tue, 03 Jun 2014 10:51:34 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) |
john o goyo <address@hidden> writes:
> Thie following problem occurs with gm2-4.1.2 (given that I am
> currently stuck building mpfr). I cannot remember if this was
> reported before and I could not find anything on the mailing list.
Hi John,
thanks for the report - I cannot remember this being reported before.
I think there are some problems with the test code though:
> Symbols exported from one inner module are not seen within a second
> inner module. Example code follows.
>
>
> MODULE InnerModules;
> (*-------------------------*)
> MODULE FirstInner;
>
> EXPORT One; (* Not seen by gm2 *)
>
> PROCEDURE One() :CARDINAL;
> BEGIN
> RETURN 1;
> END One;
>
> END FirstInner;
>
> (*-------------------------*)
> MODULE SecondInner;
>
> FROM FirstInner IMPORT One; (* Will not compile *)
I think this should be:
IMPORT One;
as the 'FROM' statement looks up modules from the global universe.
> EXPORT Two;
>
> PROCEDURE Two() :CARDINAL;
> BEGIN
> RETURN FirstInner.One() + FirstInner.One()
and this replaced by:
RETURN One() + One()
> END Two;
>
> END SecondInner;
>
> VAR
> n :CARDINAL;
> BEGIN
> n := Two()
> END InnerModules.
regards,
Gaius