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,1de1981df403322c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-10 21:13:14 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!82-43-33-75.cable.ubr01.croy.blueyonder.co.UK!not-for-mail From: Nick Roberts Newsgroups: comp.lang.ada Subject: Re: New limited range type? Date: Tue, 11 Nov 2003 05:13:05 +0000 Message-ID: References: <20619edc.0311071005.15e6b9a8@posting.google.com> NNTP-Posting-Host: 82-43-33-75.cable.ubr01.croy.blueyonder.co.uk (82.43.33.75) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 1068527592 51991788 82.43.33.75 (16 [25716]) User-Agent: Mozilla/5.0 (Windows; U; Win95; en-US; rv:1.5) Gecko/20031013 Thunderbird/0.3 X-Accept-Language: en-us, en In-Reply-To: Xref: archiver1.google.com comp.lang.ada:2319 Date: 2003-11-11T05:13:05+00:00 List-Id: Martin Dowie wrote: >> function S'Conform (X: in universal_real) return S; > > I can cope with that - although I don't like the name much. I agree, Conform is not good. > How about: > > function S'Limit (X:... Or maybe Limit_to_Bounds? Wordy, but clearer. >>Note how I define a fixed point type to provide a big enough base range (in >>this case 50 complete turns either way) for all calculations, and then a >>subtype of it to define the required confined or normalised range. > > While that's good technique, I presume your NOT saying that the RM would > require this? I thinkj it would be necessary to adopt this approach, since the base range required cannot be guessed. I think the neatest solution is to require a named type with this range to be declared, and then subtypes with the required limited ranges to be declared and used to indicate the bounds of the operation. > Also, why not allow it for any scalar type? Yes, I think you're right. Shall I send a proposal to ada-comment? -- Nick Roberts