From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,2c6139ce13be9980 X-Google-Attributes: gidfac41,public X-Google-Thread: f43e6,2c6139ce13be9980 X-Google-Attributes: gidf43e6,public X-Google-Thread: 103376,3d3f20d31be1c33a X-Google-Attributes: gid103376,public From: jsa@alexandria.organon.com (Jon S Anthony) Subject: Re: Safety-critical development in Ada and Eiffel Date: 1997/07/15 Message-ID: #1/1 X-Deja-AN: 257032500 Distribution: world References: <01bc8d8c$e608b740$6bb32399@default> <33C5B971.7845@erols.com> <33C831CE.4E56@flash.net> <33CA4EA1.A3B@pseserv3.fw.hac.com> Organization: PSINet Newsgroups: comp.software-eng,comp.lang.ada,comp.lang.eiffel Date: 1997-07-15T00:00:00+00:00 List-Id: Don Sez: > Jon S Anthony wrote: > > :In article <33C831CE.4E56@flash.net> Ken Garlington writes: > : > :> However, compare and contrast: > :> > :> (ada-ish): type Foo_Type is range 1 .. 10; > :> procedure Do_Something ( X : in Foo_Type ); > :> > :> (Eiffel-ish): procedure Do_Something ( X : in Integer ); > :> require X > 0 and X < 11; > :> > :> Doesn't seem to make a lot of difference to me > : > :That's because there basically isn't any. > > In this case, only by virtue of the fact that in Ada, Integer isn't > an extensible type. First, Integer _is_ extensible with respect to operations. You can't add new slots to it (data extension), but you can add operations. But then why would you _want_ to add new slots?? Second, even if you couldn't do this, why would that "fact" be a reason for the claim?? > Even if it were, you can't inherit the contract. Well, a) it is and b) you certainly _can_ inherity this sort of contract: type My_Integer is new Integer range 1..10; -- -- Inherits std integer ops and attributes -- Maybe we add some more to these specific to My_Integer ... Somewhere later type Gain_Type is new My_Integer; -- -- Inherits the range constraint and all My_Integer ops, -- both the std integer ones and any of the new specific ones -- Override or add new ones here... > You have to redeclare it each time you inherit I don't think so. /Jon -- Jon Anthony OMI, Belmont, MA 02178 617.484.3383 "Nightmares - Ha! The way my life's been going lately, Who'd notice?" -- Londo Mollari