Re: [eclipse-clp-users] Trying to run select

From: Joachim Schimpf <jschimpf_at_...311...>
Date: Wed, 02 Oct 2013 16:59:38 +0100
On 02/10/2013 15:54, Paul Cannongeyser wrote:
> [eclipse 1]: lib(ic).
> ?- lib(ic).
> Yes (0.17s cpu)
>
> [eclipse 2]: lib(lists).
> ?- lib(lists).
> Yes (0.00s cpu)
>
> [eclipse 3]: select(3,[1,3,5,3],L).
> ?- select(3, [1, 3, 5, 3], L).
> Abort
>
> calling an undefined procedure select(3, [1, 3, 5, 3], L) in module eclipse (in red letters)
> Ambiguous import of select / 3 from [eclipse_language, lists] in module eclipse (in yellow letters)


What the message is trying to tell you is that there is a naming conflict between select/3 as 
defined in module eclipse_language (a now obsolete predicate working on streams), and the select/3 
predicate from the lists library.

There are two ways of resolving this.  Either you qualify every individual call, i.e. write 
lists:select(3,[1,3,5,3],L), or you declare once which version you want, using a directive

:- import select/3 from lists.

in your code (if you type to the query prompt, omit the leading :- ).

Details at http://eclipseclp.org/doc/userman/umsroot040.html


Cheers,
Joachim
Received on Wed Oct 02 2013 - 15:59:48 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 16 2024 - 09:13:20 CEST