home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.eiffel
- Path: sparky!uunet!mcsun!julienas!babbage!ensl!lapin!lprylli
- From: lprylli@ens-lyon.fr (Loic Prylli)
- Subject: Re : joining in 2.3
- Message-ID: <Bz5D3n.7F4@ens-lyon.fr>
- Sender: news@ens-lyon.fr
- Reply-To: lprylli@ens-lyon.fr
- Organization: Ecole Normale Superieure de Lyon
- Date: Sat, 12 Dec 1992 12:52:34 GMT
- Lines: 93
-
-
- In article 724082271@limotoc, fxg@limotoc.informatik.rwth-aachen.de (Felix Gatzemeier) writes:
- > Hello
- >
- > I am currently working on an assigment involving the graphics libarary of the
- > ISE complier, whose es tells me it's version 2.3, level 4. The problem is that
-
- ....
-
- > If I read ETL for 3.0 right, this would join the deferred features from
-
- I think the core of the problem is that you are using Eiffel 2.3 which uses
- a different method than Eiffel 3.0 in some cases.
-
-
- > MY_GEN_FIGURE with the implementations from CIRCLE, so that a call to
- > mc: MY_CIRCLE;
- > ...
- > mc.slide(shifter);
- > would call CIRCLE's erase, translate and display features.
- > Instead, I get a bunch of name clashes: more than one parent... errors.
- > I have tried several clutches:
-
- In eiffel 2.3 when you are trying to join deferred features you have
- to declare it explicitly in the inherit clause with define for each
- deferred feature you join.
- For instance :
-
- class MY_CIRCLE
-
-
- inherit
- CIRCLE;
- MY_GEN_FIGURE
- define barycenter,contains,convert_to_resolution,display,
- duplicate,erase,origin,recompute_closure,
- rotate,scale,translate, fillable
-
- feature
-
- end
-
-
- deferred class MY_GEN_FIGURE
-
- inherit
- GEN_FIGURE
- redefine fillable;
-
- feature
-
- slide (v: VECTOR; win: GRAPH_WINDOW) is
- do
- erase (win);
- translate (v);
- display (win);
- end;
-
- fillable : BOOLEAN is
- deferred
- end;
-
-
- end
-
-
-
- As all routines in the define clause of class MY_CIRCLE were effected
- in ELLIPSE or in some other ancestor, they can't be handled properly just by
- repeated inheritance. You have to use "definition".
-
- The case of fillable is special. Strangely it is not deferred in GEN_FIGURE
- but instead it returns systematically False. So it is redefined in CLOSED_FIG
- to return True. Obviously you can't obtain only one feature from two different
- versions if you don't undefine one. In Eiffel 2.3 you can undefine a feature
- by redefining it with a deferred routine as it is made in MY_GEN_FIGURE
-
-
-
- > I am nearly driven crazy by this. I know that there are less general solutions
- > to it, like having the world handling the movement in this special case, but
- > I want that general solution. After all, that's why I took up OOP in the first
- > place.
-
- I think version 3.0 is in some cases far easier to use.
-
- Loic PRYLLI
- ENS-Lyon
- France
-
-
-
-
-