gm2
[Top][All Lists]
Advanced

[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 11:05:22 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

Hi John,

further variant's on your inner modules theme.  This works:

MODULE InnerModules2;

   (*-------------------------*)
   MODULE FirstInner;

   EXPORT One;

   PROCEDURE One() :CARDINAL;
   BEGIN
     RETURN 1;
   END One;

   END FirstInner;

   MODULE SecondInner;

   IMPORT FirstInner;

   EXPORT Two;

   PROCEDURE Two() :CARDINAL;
   BEGIN
     RETURN FirstInner.One() + FirstInner.One()
   END Two;

   END SecondInner;

VAR
   n :CARDINAL;
BEGIN
   n := Two()
END InnerModules2.


but this is not allowed:

MODULE InnerModules3;

   (*-------------------------*)
   MODULE FirstInner;

   EXPORT QUALIFIED One;

   PROCEDURE One() :CARDINAL;
   BEGIN
     RETURN 1;
   END One;

   END FirstInner;

   MODULE SecondInner;

   IMPORT FirstInner;

   EXPORT Two;

   PROCEDURE Two() :CARDINAL;
   BEGIN
     RETURN FirstInner.One() + FirstInner.One()
   END Two;

   END SecondInner;

VAR
   n :CARDINAL;
BEGIN
   n := Two()
END InnerModules3.


this last one may be a bug - the pim4 chapter on Inner Modules
seems to suggest that QUALIFIED can be used in an inner module.

regards,
Gaius



reply via email to

[Prev in Thread] Current Thread [Next in Thread]