From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ranges and (non)static constraints
Date: Sat, 18 Nov 2006 10:47:03 +0100
Date: 2006-11-18T10:46:47+01:00 [thread overview]
Message-ID: <132hedzlaep19$.169jkd8ewgm58.dlg@40tude.net> (raw)
In-Reply-To: wccpsbld3sn.fsf@shell01.TheWorld.com
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
next prev parent reply other threads:[~2006-11-18 9:47 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-16 11:02 Ranges and (non)static constraints Maciej Sobczak
2006-11-16 12:23 ` Martin Krischik
2006-11-16 13:23 ` Maciej Sobczak
2006-11-16 19:01 ` Jeffrey R. Carter
2006-11-18 0:02 ` Robert A Duff
2006-11-16 13:13 ` Dmitry A. Kazakov
2006-11-16 17:18 ` Jean-Pierre Rosen
2006-11-17 9:08 ` Dmitry A. Kazakov
2006-11-17 10:30 ` Stuart
2006-11-17 10:37 ` Jean-Pierre Rosen
2006-11-17 14:57 ` Dmitry A. Kazakov
2006-11-17 16:04 ` Jean-Pierre Rosen
2006-11-18 9:51 ` Dmitry A. Kazakov
2006-11-18 14:17 ` Stephen Leake
2006-11-17 20:05 ` Jeffrey R. Carter
2006-11-17 23:58 ` Robert A Duff
2006-11-18 9:47 ` Dmitry A. Kazakov [this message]
2006-11-19 2:27 ` Jeffrey R. Carter
2006-11-19 12:13 ` Björn Persson
2006-11-19 22:51 ` Robert A Duff
2006-11-20 3:51 ` Jeffrey R. Carter
2006-11-21 21:02 ` Robert A Duff
2006-11-20 17:35 ` Adam Beneschan
2006-11-17 15:45 ` Maciej Sobczak
2006-11-17 16:45 ` Jean-Pierre Rosen
2006-11-17 10:39 ` AW: " Grein, Christoph (Fa. ESG)
2006-11-17 11:20 ` Dmitry A. Kazakov
2006-11-17 13:30 ` Stuart
2006-11-17 15:07 ` Dmitry A. Kazakov
2006-11-17 16:47 ` Jean-Pierre Rosen
2006-11-20 14:08 ` Stuart
2006-11-20 14:12 ` Stuart
2006-11-20 15:48 ` Dmitry A. Kazakov
2006-11-16 18:56 ` Jeffrey R. Carter
2006-11-16 20:00 ` Adam Beneschan
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox