Re: [eclipse-users] Predicate declarations in Eclipse

From: Joachim Schimpf (Independent Contractor) <jschimpf_at_cisco.com>
Date: Mon, 30 Apr 2007 23:11:52 +0100
Siddharth Angrish wrote:
> Hi
>         I am facing the following error while compilation
> -------------------------------------------
> *** trying to redefine a built-in predicate: (:) / 2
>         before line 49 in the file
> /users/angrish/fsa/eclps/bin/i386_linux/libfsa/fsa_array.pl
> ----------------------------------------------
>            There is no (:) / 2 predicate defined before it!!!! In
> fact, no where in all the
> files I am compiling.

As I tried to explain in my previous message, ECLiPSe's module system
does not have the concept of module-qualified source clauses. Therefore,
a source clause like

user:help_info(...).

is not taken as a clause for help_info, but as a clause for (:)/2.
In my previous message I have given code (intended to go into the
quintus compatibility library) that works around this.


> 
> Some story:
>    I am compiling an Eclipse source file (firstFile) declared as a module.
> The "firstFile", through the following statement:
>                :- use_module([ anotherFile]).
> 
> uses declarations of "anotherFile". The error comes as a result of this file's
> compilation.

I do not understand, but it is probably irrelevant.


 > I am compiling the original file as:-   lib(firstFile).

Quick summary of compile-related commands:
compile(File)			compiles a file
ensure_loaded(File)		compiles/loads a file if necessary
ensure_loaded(library(Name))	finds file in library path and compiles/loads it
use_module(File)		combination of ensure_loaded + import
use_module(library(Name))	combination of ensure_loaded + import
lib(Name)			the same as use_module(library(Name))



> I am NOT using any compatibility package

Since the application is probably originally written in quintus/sicstus,
you should use at least the quintus compatibility, otherwise you will
have to duplicate lots of it functionality.  As explained earlier, you
do that by changing the application's module directives from
:- module(fsa_xxx, []).
to
:- module(fsa_xxx, [], quintus).

Also, add the enhancements from my previous messaage to your copy of
quintus.pl (and remove quintus.eco).


-- Joachim
Received on Mon Apr 30 2007 - 23:12:01 CEST

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET