gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with import/export in local modules


From: Gaius Mulley
Subject: Re: Problem with import/export in local modules
Date: Thu, 28 Mar 2024 15:42:44 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Michael Riedl <udo-michael.riedl@t-online.de> writes:

> John,
>
> if you change the sequence of the EXPORT and IMPORT statement it
> should work - not sure if there is is somewhere defined in PIM or ISO,
>
> but in my library I always have IMPORT before EXPORT as well.
>
> Gruß / Greetings
>
> Michael
>
> Am 28.03.24 um 01:05 schrieb john o goyo:
>> MODULE Test;
>>
>> PROCEDURE Double(n :CARDINAL) :CARDINAL;
>> BEGIN
>>     RETURN 2*n
>> END Double;
>>
>> MODULE Inside;
>>
>>     EXPORT Quadruple;
>>     IMPORT Double;
>>
>>     PROCEDURE Quadruple(k :CARDINAL) :CARDINAL;
>>     BEGIN
>>         RETURN Double(k) * Double(k)
>>     END Quadruple;
>>
>> END Inside;
>>
>> VAR
>>     d :CARDINAL;
>> BEGIN
>>     d := Quadruple(3)
>> END Test. 

Hi Michael and John,

the error message has been improved in the gcc git:

$ gm2 localmodule2.mod 
localmodule2.mod:13:3: error: In inner module ‘local’: an IMPORT statement must 
preceed an EXPORT statement
   13 |   IMPORT mult2 ;
      |   ^~~~~~

thanks for the bug report!

regards,
Gaius



reply via email to

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