Path: utzoo!attcan!uunet!mcsun!hp4nl!phigate!prle!prles2!cstw56!roosen From: roosen@cstw56.prl.philips.nl (Monique Roosen) Newsgroups: comp.lang.eiffel Subject: Extension of class REAL Message-ID: <1747@prles2.prl.philips.nl> Date: 15 Jun 90 14:06:38 GMT References: <76571@srcsip.UUCP> <1744@prles2.prl.philips.nl> Sender: news@prles2.prl.philips.nl Reply-To: roosen@cst.prl.philips.nl (Monique Roosen) Organization: Centre for Software Technology, Philips Eindhoven Lines: 39 Sorry for wasting your time. Because I'm not familiar with our news- server I forgot to replace the subject heading in my previous posting. Fearing that people would skip this article due to a wrong subject header I repeat the posting here with the corrected subject-header. If you want to flame me for this, go ahead :-) Yippee my first flames. This is a follow-up to a previous message with respect to the extension of a STRING class. It can be placed in the same context. I want to make a class POS_REAL like : class POS_REAL inherit FLOAT -- maybe some extra features -- class invariant invariant Current >= 0.0 end -- class POS_REAL Of course I get the following error-message with respect to the invariant line : Type mismatch: REAL is not a descendant class of POS_REAL Incorrect type for argument number 1 of _infix_ge I suppose the following assignment won't work either : x : POS_REAL ; x := 1.2 The work-around for the STRING class was the share-feature, but this feature is not available within the FLOAT class. Is there anybody out there who knows a solution for this problem ?? Is ISE thinking of a change for these basic class types ?? Thanks in advance. Monique