Subject: Modules

From: Lalit Jain <[email-masked]>
Date: Thu, 8 Jun 2000 17:12:43 -0700 (PDT)

Hi All:
My question is regarding modules. I have a file containing some predicates
(not belonging to any module).
Now I load the file under the context of a module, say m1; and i can see
all the predicates when i do listing.
Then, I load the same file under the context of another module, say
m2; again I see all the predicates.
Now, I switch to module m1, and I don't see any predicates there. Why is
that so?

I have a file foo as:

foo(1).

Now at the prolog interpreter, i say,

1 ?- module(m1).
Warning: m1 is not a current module (created)

Yes
m1: 2 ?- [foo].
% foo compiled into m1 0.01 sec, 520 bytes

Yes
m1: 3 ?- listing.

foo(1).

Yes
m1: 4 ?- module(m2).
Warning: m2 is not a current module (created)

Yes
m2: 5 ?- [foo].
% foo compiled into m2 0.00 sec, 128 bytes

Yes
m2: 6 ?- listing.

foo(1).

Yes
m2: 7 ?- module(m1).

Yes
m1: 8 ?- listing.

Yes
m1: 9 ?- 

Thanks,
Lalit