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: Michael Riedl
Subject: Re: Problem with import/export in local modules
Date: Thu, 28 Mar 2024 19:24:43 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

Hallo Gaius,

thanks for that - was confused by that some time ago as John before I figured out ...

Michael

Am 28.03.24 um 16:42 schrieb Gaius Mulley:
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]