WG: Problem with repeatedly compiling files with partly the same content and EmbeddedEclipse

From: Cornelius Hagen <cornelius.hagen_at_wiai.uni-bamberg.de>
Date: Wed 12 Mar 2003 05:25:36 PM GMT
Message-ID: <000001c2e8bc$64cdcda0$89020d8d@CHAGEN>
Hi Joachim,

Thank you (and your colleages) for your advice.
In the long run I will use queues. But now I have to stick on my current
concept.

While trying to follow the advice using erase_module/1, I still have a
problem:

My Java-program uses an EmbeddedEcipseEngine-object for iteratively
compiling files (containing facts and relations) and querying via the
rpc-funciton. The first statement in each of my files is ":-
use_module(library(ic))." But this obviously does not affect the main
active module. Every time I want to get rid of the file contents, I call
the rpc-function with the argument erase_module(eclipse), and in the
following call with the argument erase_module(eclipse).

I get the exception: trying to erase a module from itself in
erase_module(eclipse), which is not surprising.

Analogously I compiled the same file in TKEclipse and got the same
behavior. But if I change the module (drop-downlist directly below the
File menu) everything works fine. I the source of tkeclipse.tcl I could
not find the called function that makes things work. 

Now, after lenghty explanations, my question: 
How can I change the active module (didn't find a suitable predicate in
the documentation)? Or where am I wrong?

Thanks in advance

Cornelius




-----Ursprüngliche Nachricht-----
Von: owner-eclipse-users@icparc.ic.ac.uk
[mailto:owner-eclipse-users@icparc.ic.ac.uk] Im Auftrag von Joachim
Schimpf
Gesendet: Donnerstag, 30. Januar 2003 14:34
An: Eclipse Users List
Betreff: Re: [eclipse-users] Problem with repeatedly compiling files
with partly the same content and EmbeddedEclipse


> Cornelius Hagen wrote:
>
> I am writing a Java-application that iteratively poses requests on
> eclipse. Because I need good performance, I use an
EmbeddedEclipse-object following the mapcolorour-example. I always
create a file which usually contains some predicates as the
> file(s) before (and, of course, some different ones).

If you need good performance then

1. don't use files. File I/O is slow. Instead send the
   data via a queue like in the mapcolour example.

2. dont compile your data as predicates unless you really
   need them to be predicates. Compilation takes time.
   Just write your request data (e.g. in the form of a list)
   into a queue on the Java side, and read it out using
   read_exdr/2 on the Eclipse side. If you absolutely
   want to compile predicates, you can still do that
   using compile_term.


> Then I hand over the file to the rpc function.
> Eclipse sends warnings, that some relations habe been replaced by new
> ones with the same signature, and after a few iterations,  I get a 
> "Throw"-Exception thrown by the rpc method.

If you don't compile, you won't get these warnings :-)

Other ways to suppress the warning are:
- abolish/1 the predicate before recompiling, or use
  erase_module/1 as already suggested
- disable the warning via :- set_event_handler(145,true/0).


-- 
 Joachim Schimpf              /             phone: +44 20 7594 8187
 IC-Parc                     /      mailto:J.Schimpf@imperial.ac.uk
 Imperial College London    /    http://www.icparc.ic.ac.uk/eclipse
Received on Wed Mar 12 17:45:27 2003

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:22 PM GMT GMT