From liraola@opera.dia.fi.upm.es  Wed Nov  3 13:19:37 1999
Received: from goofy.fi.upm.es (goofy.fi.upm.es [138.100.8.23])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id NAA20768
	for <prolog@swi.psy.uva.nl>; Wed, 3 Nov 1999 13:19:23 +0100 (MET)
Received: from conversion.relay.fi.upm.es by relay.fi.upm.es
 (PMDF V5.2-32 #39034) id <01JHWHLBD8DC00027O@relay.fi.upm.es> for
 prolog@swi.psy.uva.nl; Wed, 3 Nov 1999 13:19:01 MET
Received: from opera.dia.fi.upm.es (opera.dia.fi.upm.es [138.100.11.43])
 by relay.fi.upm.es (PMDF V5.2-32 #39034)
 with ESMTP id <01JHWHLAB43S000276@relay.fi.upm.es> for prolog@swi.psy.uva.nl;
 Wed, 03 Nov 1999 13:18:59 +0100 (MET)
Received: from localhost by opera.dia.fi.upm.es (8.8.4/FI-4.1) Wed,
 3 Nov 1999 12:47:15 GMT
Date: Wed, 03 Nov 1999 12:47:14 +0000 (WET)
From: Luis Iraola Moreno <liraola@opera.dia.fi.upm.es>
Subject: Re: Constructing terms for an external module
In-reply-to: <382012EF.14C04855@dis.ulpgc.es>
X-Sender: liraola@opera
To: Jose Luis Fernandez Perez <a2574@dis.ulpgc.es>
Cc: "prolog@swi.psy.uva.nl" <prolog@swi.psy.uva.nl>
Message-id: <Pine.SOL.3.95.991103124501.5757B-100000@opera>
MIME-version: 1.0
Content-type: TEXT/PLAIN; charset=US-ASCII



On Wed, 3 Nov 1999, Jose Luis Fernandez Perez wrote:

> I need to construct a term to be called. Te term is in an external
> module, then i need to refer it
> using the functor ":".
>     module:predicate
>     For example, the term has arity 2,. I want to call
>         module:predicate(X,Y)
>     but constructing it.
>     I was trying it with
>         atom_to_term('module:predicate',L,_),Term =.. [L,X,Y].
>     to create
>     Term =  example:predicate(X,Y).
> But it does not succed, How can I construct predicates for an external
> module?

You just create the complex term, e.g. in the module 'lists' has the
predicate 'segment' and the predicate is not exported by the module, then
just call:

	lists:segment(...)

whenever you need it.



