comp.lang.ada
 help / color / mirror / Atom feed
From: christoph.grein@eurocopter.com
Subject: Re: (Num_Types.Mod_4 range 1..8) ------->why not (1..8)?
Date: Mon, 18 May 2009 23:26:16 -0700 (PDT)
Date: 2009-05-18T23:26:16-07:00	[thread overview]
Message-ID: <ee738ee7-3579-4eb2-8894-6a55708b34dd@h23g2000vbc.googlegroups.com> (raw)
In-Reply-To: 03cb75a1-3458-420e-9871-6f64f784c177@s38g2000prg.googlegroups.com

While re-hosting some code, yesterday I bumped into some code like so:

  type Some_Array is array (Some_Index range <>) of Some_Type;
  subtype Small_Array is Some_Array (1 .. 8);
  subtype Max_Array   is Some_Array (1 .. Some_Index'Last);

  function Convert is Unchecked_Conversion (Source => Small_Array,
Target => Max_Array);

Guess what the perpetrator told me was the reason for this
abomination: The compiler complained when he assigned an object of
Small_Array to one of Max_Array. So he found this "solution"...



  reply	other threads:[~2009-05-19  6:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-18 19:19 (Num_Types.Mod_4 range 1..8) ------->why not (1..8)? convergence82
2009-05-18 19:36 ` Georg Bauhaus
2009-05-18 19:58   ` convergence82
2009-05-18 20:50     ` Adam Beneschan
2009-05-18 20:53     ` Georg Bauhaus
2009-05-18 21:12       ` convergence82
2009-05-18 21:24       ` Adam Beneschan
2009-05-19  6:26         ` christoph.grein [this message]
2009-05-19  7:47           ` Petter
2009-05-19  8:04             ` christoph.grein
2009-05-19 13:13               ` Petter
2009-05-19 15:27                 ` Georg Bauhaus
2009-05-19 17:53           ` Adam Beneschan
2009-05-18 19:49 ` Robert A Duff
replies disabled

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