Xref: utzoo comp.lang.eiffel:613 comp.object:822 Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!sunic!liuida!isy!nicwi From: nicwi@isy.liu.se ( Niclas Wiberg) Newsgroups: comp.lang.eiffel,comp.object Subject: Re: Eiffel cleanup #2: Doing away with void references Keywords: Type system, export controls, NONE, ANY, HERE Message-ID: <1990Jan24.130946.24107@isy.liu.se> Date: 24 Jan 90 13:09:46 GMT References: <227@eiffel.UUCP> Organization: Dept of EE, University of Linkoping Lines: 73 bertrand@eiffel.UUCP (Bertrand Meyer) writes: >... > > There is virtually no change in semantics since almost no operation >is exported by NONE, so that > > a.f > >will usually be incorrect if a is void. > >... > > One of the remarkable aspects of this structure is that the >problem of ``feature application to void references'' becomes a >special case of type checking! Those readers who remember an earlier, >lengthy posting on static type checking in Eiffel will see that >the present change puts the whole discussion in a more general >perspective. I don't remember that earlier posting about type checking, so please excuse me if I've got something wrong. But to me it seems that all classes must fullfill *all* the contracts of *all* of its ancestors. It shouldn't matter whether you export the inherited contracts or not. For example, consider these two classes: class PARENT export some_feature feature some_feature is ... end end -- class PARENT class CHILD export inherit PARENT feature end -- class CHILD Assume these declarations: p: PARENT; c: CHILD If you create a CHILD object c.Create you can of course not apply the feature some_feature to c c.some_feature -- This is incorrect but if you make the assignment p := c then this should be perfectly legal: p.some_feature Of course you can't require the class NONE to fullfill all the contracts of its ancestors, but then what's the point in the extension? You still have a special case, which must be treated differently. -- ---------------------------------------------------------------------- Niclas Wiberg nicwi@isy.liu.se Dept. of EE Linkoping University Sweden