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: 103376,2afac1a4161c7f35 X-Google-Attributes: gid103376,public From: mheaney@ni.net (Matthew Heaney) Subject: Re: Distinguishing type names from other identifiers Date: 1998/01/24 Message-ID: #1/1 X-Deja-AN: 318898887 Content-Transfer-Encoding: 8bit References: <199801121523.QAA06527@basement.replay.com> <01bd2078$a449b460$41fd82c1@xhv46.dial.pipex.com> <34BD097C.3E9B@gsfc.nasa.gov> Content-Type: text/plain; charset=ISO-8859-1 Organization: Estormza Software Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-01-24T00:00:00+00:00 List-Id: In article <34BD097C.3E9B@gsfc.nasa.gov>, Stephen.Leake@gsfc.nasa.gov wrote: >Matthew Heaney wrote: >> >> In article <01bd2078$a449b460$41fd82c1@xhv46.dial.pipex.com>, "Nick >> Roberts" wrote: >> >> > >> >For example: >> > >> > type Hour_Of_Day is range 0..23; >> > type Minute_Of_Hour is range 0..59; >> > type Seconds_Past_Minute is delta 0.001 range 0.000 .. 59.999; >> >> >> Do this if you really don't want 60.0 in the range: >> >> type Seconds_Past_Midnight_Base is >> delta 0.001 range 0.0 .. 60.0; >> >> subtype Seconds_Past_Midnight is >> Seconds_Past_Midnight range 0.0 .. Seconds_past_Midnight_Base'Succ (60.0); >> >> The idea is let the compiler figure out what the largest value is, by using >> T'Succ. Declaring a subtype of a first named subtype is a technique few >> programmers take advantage of. > >Surely, if you mean to _exclude_ 60.0, you should use 'Pred? Yes, I did mean T'Pred. Sorry for any confusion. Matt -------------------------------------------------------------------- Matthew Heaney Software Development Consultant (818) 985-1271