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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4ff929aa5c2b2834 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.germany.com!news.teledata-fn.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Ranges and (non)static constraints Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1pqs0gcno5o2t.1195tm9yap28b.dlg@40tude.net> <160ziiyah2n7g.5k340gtji747.dlg@40tude.net> Date: Sat, 18 Nov 2006 10:47:03 +0100 Message-ID: <132hedzlaep19$.169jkd8ewgm58.dlg@40tude.net> NNTP-Posting-Date: 18 Nov 2006 10:46:47 CET NNTP-Posting-Host: 3b4baa32.newsspool2.arcor-online.net X-Trace: DXC=cfOdNc]0=Ua]l@YUW5NBknA9EHlD;3Ycb4Fo<]lROoRaFl8W>\BH3YbicoVmhY2?PeDNcfSJ;bb[eIRnRBaCd On Fri, 17 Nov 2006 18:58:00 -0500, Robert A Duff wrote: > If I say: > > type T is range 1..1_000_000_000_000; > > some implementations fail at compile time, and some do not. That's bad, > too. I ought to be allowed to say, portably: > > type T is range 1..10**100; Yes, that's my point. I would also add: type T is range <>; -- A true bignum, like Unbounded_String >>... And there'd be type Unbounded_Integer, providing >> use of the unbounded-integer library used by the compiler. > > Well, I'll quibble with your names, here. When God created the > integers, He didn't say they stop at 2**31-1 or 2**64 or whatever! > The term "integer" (or the abbreviation "int") ought to mean the true > unbounded integers. Names like Unbounded_Integer and _universal_integer > are an abomination. ;-) Yes, but there is a naming problem of different things: 1. An unconstrained set of integer numbers = mathematical Integer, bignum. No bounds, whatsoever, similar to Unbounded_String. 2. A finite subset of, which bounds are unknown until run-time, similar to String. 3. A finite subset with statically known bounds, similar to String (1..80). Ideally, both 3 and 2 should be defined in terms of 1. BTW, what about type M is mod <>; This looks as a bit harder nut. Considering: X : M := 23; -- Hmm, which the modulo here? (:-)) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de