Re: two questions

From: Joachim Schimpf <j.schimpf_at_icparc.ic.ac.uk>
Date: Thu 05 Dec 2002 12:18:07 PM GMT
Message-ID: <3DEF43FF.B2BBC18D@icparc.ic.ac.uk>
Ulrich Scholz wrote:
> 
> Hello,
> 
> earlier this year I learned about a compiler optimization bug:
> 
> > Joachim Schimpf wrote:
> 
> > this is a compiler optimization bug, triggered by sequences
> > of =/2 goals. You can work around this problem by inserting
> > true/0 between the =/2 goals to break the sequence, e.g.
> > ...
> > We do not plan to provide a fix for this because we are
> > working on a completely new compiler.
> 
> I wonder whether this bug is present in the new ECLiPSe 5.5?

Afraid so, the new compiler isn't there yet...


> 
> Then I started working with structs:  Very nice, makes my code much more
> readable.  Now my question: When I change a struct definition and compile my
> program again, eg change
> 
> :- local struct(ncfset_tuple(pre, add, del, fdel)).
> 
> to
> 
> :- local struct(ncfset_tuple(preX, add, del, fdel)).
> 
> then I get
> 
> WARNING: attempt to redefine an existing local item in local struct(ncfset_tuple(preX, add, del,
> fdel)) in module eclipse
> 
> Appearently, the old struct definition is still known by the system.  How do I
> remove it (without exiting ECLiPSe of course)?

Not allowing redefinition of structs protects you from mixing
code that has been compiled with different, inconsistent
versions of a struct definition. When you are just recompiling
your code, this restriction is of course inconvenient.

If you are using tkeclipse, you can select "clear toplevel module"
from the File-menu before recompiling your code. This will
erase everything you have compiled into the eclipse-module,
including the struct definitions.

A better solution is to turn your file into a module, i.e.
add a  :- module(mymodule).  directive to it.  Then the
module will be automatically erased before every recompilation.
If you don't want to bother learning about modules, you can
choose 'eclipse' as the module name, then you should see no
further difference in behaviour.


-- 
 Joachim Schimpf              /             phone: +44 20 7594 8187
 IC-Parc, Imperial College   /            mailto:J.Schimpf@ic.ac.uk
 London SW7 2AZ, UK         /    http://www.icparc.ic.ac.uk/eclipse
Received on Thu Dec 05 12:21:25 2002

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