From lalit@tdiinc.com  Fri Jun  9 03:24:04 2000
Received: from oahu.tdiinc.com (oahu.tdiinc.com [206.40.33.137])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id DAA12983
	for <prolog@swi.psy.uva.nl>; Fri, 9 Jun 2000 03:24:02 +0200 (MET DST)
Received: from neptune.tdiinc.com (neptune.tdiinc.com [10.1.4.46])
	by oahu.tdiinc.com (8.9.3/8.9.3) with ESMTP id SAA16808
	for <prolog@swi.psy.uva.nl>; Thu, 8 Jun 2000 18:25:10 -0700 (PDT)
Received: from localhost (lalit@localhost)
	by neptune.tdiinc.com (8.9.0/8.9.0) with ESMTP id SAA06024
	for <prolog@swi.psy.uva.nl>; Thu, 8 Jun 2000 18:24:06 -0700 (PDT)
X-Authentication-Warning: neptune.tdiinc.com: lalit owned process doing -bs
Date: Thu, 8 Jun 2000 18:24:06 -0700 (PDT)
From: Lalit Jain <lalit@savvion.com>
To: prolog@swi.psy.uva.nl
Subject: Modules
Message-ID: <Pine.GSO.4.21.0006081822520.4642-100000@neptune.tdiinc.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII


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




