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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a1ce307c10055549 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-16 12:37:18 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-peer.gip.net!news.gsl.net!gip.net!c03.atl99!cyclone2.usenetserver.com!news.webusenet.com!news-hub.cableinet.net!blueyonder!internal-news-hub.cableinet.net!news-binary.blueyonder.co.uk.POSTED!53ab2750!not-for-mail User-Agent: Microsoft-Entourage/10.1.1.2418 Subject: Re: calenday (was Re: IBM Acquires Rational Ada From: Bill Findlay Newsgroups: comp.lang.ada Message-ID: References: <3DF1615C.7AAAC86E@adaworks.com> <8db3d6c8.0212091445.12594821@posting.google.com> <3DF628C4.7090607@cogeco.ca> <3DF6653D.3030603@cogeco.ca> <8db3d6c8.0212101850.51506572@posting.google.com> <3DF8D33F.9020205@cogeco.ca> <3DFE1D97.6020109@cogeco.ca> Mime-version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Date: Mon, 16 Dec 2002 20:37:07 +0000 NNTP-Posting-Host: 80.195.52.70 X-Complaints-To: abuse@blueyonder.co.uk X-Trace: news-binary.blueyonder.co.uk 1040071036 80.195.52.70 (Mon, 16 Dec 2002 20:37:16 GMT) NNTP-Posting-Date: Mon, 16 Dec 2002 20:37:16 GMT Organization: blueyonder (post doesn't reflect views of blueyonder) Xref: archiver1.google.com comp.lang.ada:31915 Date: 2002-12-16T20:37:07+00:00 List-Id: On 16/12/02 20:25, in article mailman.1040070362.25927.comp.lang.ada@ada.eu.org, "David C. Hoos" wrote: > > ----- Original Message ----- > From: "Bill Findlay" > > >> On 16/12/02 18:38, in article 3DFE1D97.6020109@cogeco.ca, "Warren W. Gay >> VE3WWG" wrote: >>> >>> I would suggest one more small point WRT to: >>> >>> type day_name_type is (mon,tue,wed,thu,fri,sat,sun); >>> >>> Add a representation clause to guarantee that the values >>> start with sun => 0, mon => 1 etc. For some code, it is >>> much easier to work with the day of the week in the form >>> of a number. >> >> I'm puzzled by this advice. >> >> day_name_type'Pos(mon) .. day_name_type'Pos(sun) >> >> is necessarily 0 .. 6, is it not? >> > Yes, the _pos_ attribute is defined by the language as you state, > but Warren is looking to have the _representation_ specified in > the package specification. This insures that instantiations of > Ada.Unchecked_Conversion between day_name_type and > integer types produce specified results. > Yes, but if what you want is "to work with the day of the week in the form of a number", why use Unchecked_Conversion when day_name_type'Pos does what you want without further ado? -- Bill-Findlay chez blue-yonder.co.uk ("-" => "")