Re: [eclipse-clp-users] Making a predicate asserted into a dynamic module visible

From: Joachim Schimpf <jschimpf_at_...311...>
Date: Wed, 24 Oct 2012 01:18:55 +0200
On 24/10/2012 01:06, Paulo Moura wrote:
...
> [eclipse 28]: create_module(n, [], []).
>
> Yes (0.00s cpu)
> [eclipse 29]: assert(bar(99)) @ n.
>
> Yes (0.00s cpu)
> [eclipse 30]: call(bar(X)) @ n.
> calling an undefined procedure true in module n
> Abort
>
>>From the manual:
>
>     create_module(Module) :-
>         create_module(Module, [], eclipse_language).
>
> Thus, it seems my mistake was to omit the "eclipse_language" in the imports argument.

Whether it's your mistake is debatable ;)

create_module(m,[],[]) makes a really empty module, i.e. one that doesn't
even have any built-in predicates visible, in particular not true/0.

If assert/1 didn't turn bar(X) into (bar(X):-true) your example would work
anyway.  In fact, it works if you use compile_term/1 instead of assert/1...

-- Joachim
Received on Tue Oct 23 2012 - 23:19:15 CEST

This archive was generated by hypermail 2.2.0 : Mon Jul 09 2018 - 02:05:30 CEST