[comp.lang.modula2] Local Module problem in JPI

ben@val.UUCP (Ben Thornton) (03/11/89)

  I am trying to export some variables from a local module
(a module within a module), and am unable to reference them
using non-qualified techniques.  The manual states that
outer module procedures can reference variables and  procedures
which are exported from a local module using using either
of 2 methods.

  The first uses qualified names in the outer module:

Name_Of_Local_Module.Exported_Procedure (foo, bar);

...where you have to declare

EXPORT QUALIFIED Exported_Procedure;

from within the local module.



  The second is to simply say:

EXPORT Exported_Procedure;

  within the local module and reference it in the outer
module as simply:

Exported_Procedure (Foo, Bar);


  The problem I have is that the compiler refuses to accept
the latter syntax.  I have tried relocating the local module
within the outer module but this made no difference.

Any ideas?




-- 

Ben Thornton             packet:  WD5HLS @ KB5PM
Video Associates Labs      uucp:  ...!cs.utexas.edu!oakhill!val!ben
Austin, TX              fidonet:  1:382/40 - The Antenna Farm BBS

randy@m2xenix.UUCP (Randy Bush) (03/15/89)

In article <296@val.UUCP> ben@val.UUCP (Ben Thornton) writes:
> I am trying to export some variables from a local module
> (a module within a module), and am unable to reference them
> using non-qualified techniques.

This would be most unfortunate.  Please compile the following correct
program module with your compiler.  If the results are erroneous, please
tell us the name of the compiler to be avoided.

MODULE t;
  MODULE m0;
    EXPORT p0;
    PROCEDURE p0 ();
    BEGIN END p0;
    END m0;
  MODULE m1;
    EXPORT QUALIFIED p1;
    PROCEDURE p1 ();
    BEGIN END p1;
    END m1;
BEGIN
  p0 ();
  m1.p1 ()
  END t.

Note that both procedures could have been named p0, and the compiler should
differentiate based solely on qualification, but this is a degenerate case.
-- 
{ mcvax!uunet!oresoft, tektronix!percival!qiclab } !m2xenix!randy  Randy Bush