comp.lang.ada
 help / color / mirror / Atom feed
* When enumerating does Ada enumerated type goes up to up to Integer'Last or System.Max_Int
@ 2018-03-22 18:44 Bojan Bozovic
  2018-03-22 18:50 ` Shark8
  2018-03-22 21:21 ` Jeffrey R. Carter
  0 siblings, 2 replies; 7+ messages in thread
From: Bojan Bozovic @ 2018-03-22 18:44 UTC (permalink / raw)


http://www.adaic.org/resources/add_content/standards/05aarm/html/AA-3-5-1.html

Now this is more theory question as Ada Integer'Last is guaranteed to be at least 2**15-1 and perhaps nobody exhausted it by enumerating in practice, but that is minimal Integer'Last and nothing prevents implementation to have bigger System.Max_Int than its Integer'Last (as its in current GNAT which have System.Max_Int of 2**63-1).

Thanks for the answer. Maybe its there written in AARM but wording is terse.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: When enumerating does Ada enumerated type goes up to up to Integer'Last or System.Max_Int
  2018-03-22 18:44 When enumerating does Ada enumerated type goes up to up to Integer'Last or System.Max_Int Bojan Bozovic
@ 2018-03-22 18:50 ` Shark8
  2018-03-22 19:03   ` Bojan Bozovic
  2018-03-22 21:21 ` Jeffrey R. Carter
  1 sibling, 1 reply; 7+ messages in thread
From: Shark8 @ 2018-03-22 18:50 UTC (permalink / raw)


On Thursday, March 22, 2018 at 12:44:02 PM UTC-6, Bojan Bozovic wrote:
> http://www.adaic.org/resources/add_content/standards/05aarm/html/AA-3-5-1.html


Or should either of them be controlling? (Arguably yes, because of the 'Pos and 'Val attributes; but OTOH enumerations **ARE NOT** tied to Integer in the Ada-mindset.)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: When enumerating does Ada enumerated type goes up to up to Integer'Last or System.Max_Int
  2018-03-22 18:50 ` Shark8
@ 2018-03-22 19:03   ` Bojan Bozovic
  2018-03-22 19:04     ` Shark8
  0 siblings, 1 reply; 7+ messages in thread
From: Bojan Bozovic @ 2018-03-22 19:03 UTC (permalink / raw)


On Thursday, March 22, 2018 at 7:50:53 PM UTC+1, Shark8 wrote:
> On Thursday, March 22, 2018 at 12:44:02 PM UTC-6, Bojan Bozovic wrote:
> > http://www.adaic.org/resources/add_content/standards/05aarm/html/AA-3-5-1.html
> 
> 
> Or should either of them be controlling? (Arguably yes, because of the 'Pos and 'Val attributes; but OTOH enumerations **ARE NOT** tied to Integer in the Ada-mindset.)

Sure I understand, but 'Pos of enumeration type must be Integer, is it Integer or Universal_Integer? Nothing prevents implementation from having Integer'Last of 2**15-1 and System.Max_Int that is 2*127-1 or even higher. It will still be valid implementation, as far as I can see.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: When enumerating does Ada enumerated type goes up to up to Integer'Last or System.Max_Int
  2018-03-22 19:03   ` Bojan Bozovic
@ 2018-03-22 19:04     ` Shark8
  2018-03-22 19:08       ` Bojan Bozovic
  0 siblings, 1 reply; 7+ messages in thread
From: Shark8 @ 2018-03-22 19:04 UTC (permalink / raw)


On Thursday, March 22, 2018 at 1:03:20 PM UTC-6, Bojan Bozovic wrote:
> 
> Sure I understand, but 'Pos of enumeration type must be Integer, is it Integer or Universal_Integer?

Universal_Integer, IIRC.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: When enumerating does Ada enumerated type goes up to up to Integer'Last or System.Max_Int
  2018-03-22 19:04     ` Shark8
@ 2018-03-22 19:08       ` Bojan Bozovic
  0 siblings, 0 replies; 7+ messages in thread
From: Bojan Bozovic @ 2018-03-22 19:08 UTC (permalink / raw)


On Thursday, March 22, 2018 at 8:04:52 PM UTC+1, Shark8 wrote:
> On Thursday, March 22, 2018 at 1:03:20 PM UTC-6, Bojan Bozovic wrote:
> > 
> > Sure I understand, but 'Pos of enumeration type must be Integer, is it Integer or Universal_Integer?
> 
> Universal_Integer, IIRC.

Thanks Shark8!


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: When enumerating does Ada enumerated type goes up to up to Integer'Last or System.Max_Int
  2018-03-22 18:44 When enumerating does Ada enumerated type goes up to up to Integer'Last or System.Max_Int Bojan Bozovic
  2018-03-22 18:50 ` Shark8
@ 2018-03-22 21:21 ` Jeffrey R. Carter
  2018-03-23  5:04   ` Bojan Bozovic
  1 sibling, 1 reply; 7+ messages in thread
From: Jeffrey R. Carter @ 2018-03-22 21:21 UTC (permalink / raw)


On 03/22/2018 07:44 PM, Bojan Bozovic wrote:
> http://www.adaic.org/resources/add_content/standards/05aarm/html/AA-3-5-1.html
> 
> Now this is more theory question as Ada Integer'Last is guaranteed to be at least 2**15-1 and perhaps nobody exhausted it by enumerating in practice, but that is minimal Integer'Last and nothing prevents implementation to have bigger System.Max_Int than its Integer'Last (as its in current GNAT which have System.Max_Int of 2**63-1).

Character types are enumeration types, and therefore, technically, 
Wide_Wide_Character is an enumeration type with 2 ** 32 values. Since 'Pos is 
universal integer, presumably systems can handle up to System.Max_Binary_Modulus 
values.

-- 
Jeff Carter
"So if I understand 'The Matrix Reloaded' correctly, the Matrix is
basically a Microsoft operating system--it runs for a while and
then crashes and reboots. By design, no less. Neo is just a
memory leak that's too hard to fix, so they left him in ... The
users don't complain because they're packed in slush and kept
sedated."
Marin D. Condic
65

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: When enumerating does Ada enumerated type goes up to up to Integer'Last or System.Max_Int
  2018-03-22 21:21 ` Jeffrey R. Carter
@ 2018-03-23  5:04   ` Bojan Bozovic
  0 siblings, 0 replies; 7+ messages in thread
From: Bojan Bozovic @ 2018-03-23  5:04 UTC (permalink / raw)


Indeed, that's in LRM as a required range for modular type of power of two, if Integer is 16 bit. Thanks!


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-03-23  5:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-22 18:44 When enumerating does Ada enumerated type goes up to up to Integer'Last or System.Max_Int Bojan Bozovic
2018-03-22 18:50 ` Shark8
2018-03-22 19:03   ` Bojan Bozovic
2018-03-22 19:04     ` Shark8
2018-03-22 19:08       ` Bojan Bozovic
2018-03-22 21:21 ` Jeffrey R. Carter
2018-03-23  5:04   ` Bojan Bozovic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox