Re: [eclipse-users] Library Induction

From: Joachim Schimpf (Independent Contractor) <"Joachim>
Date: Thu, 26 Apr 2007 12:04:29 +0100
A few important general facts about ECLiPSe's compatibility packages:

1. ECLiPSe will never try to emulate other Prolog's module systems.
   All module-related functionality remains ECLiPSe-native (with the
   exception that minor mappings like use_module/2=use_module/1+import/1
   or public/1=export/1 can of course be provided).  This means that
   porting large applications like fsa, which use many modules and
   possibly special features of other Prolog's module systems, will
   probably not become trivial even when using the compatibility package.

2. The effect of a compatibility package is _local_ to the module
   where it is loaded!  This has the advantage that you can build an
   application that is a mixture of native ECLiPSe modules and modules
   which are written in other dialects, using one or several
   compatibility packages.  But it also means that calling lib(swi) once
   in the toplevel (i.e. in the 'eclipse' module) will have no effect
   inside any of fsa's own modules.

3. The swi compatibility package is the most recent and is still quite
   basic.  Please contribute improvements!

Because of (1), you may be better off opting for the apparently rather
sophisticated preprocessing scheme that the author of FSA has used to
make his source configurable for sicstus/yap/swi.

But if you want to try porting the swi instance of fsa, then the minimum
you have to do is change every module/2 directive into a module/3
directive by adding a language argument, e.g. change
:- module(fs_util, []).
:- module(fsa_util, [], swi).
That way you tell ECLiPSe that this module is in swi-dialect.

Kish Shen wrote:
> ...
> This is not a change in ECLiPSe 5.10, but instead is because you loaded lib(swi), and what you
> see is the SWI syntax:
> In ECLiPSe, strings are enclosed in double quotes: "string", but in most other Prologs, this 
> represents a list of numbers, where each number represents the ASCII value of the characters
> in the string. When you load lib(swi), ECLiPSe is switched to using this representation, so
> you can no longer use double quotes to represent strings.

That's why you should use lib(swi) only in modules that actually
want to use swi syntax.

Good luck,
Received on Thu Apr 26 2007 - 12:04:41 CEST

This archive was generated by hypermail 2.3.0 : Wed Aug 21 2019 - 09:13:31 CEST