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-Thread: 103376,9fb8e2af320d5b3e X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Fri, 29 Jun 2007 17:44:22 +0200 From: Georg Bauhaus Organization: # User-Agent: Thunderbird 1.5.0.12 (Macintosh/20070509) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Bus error References: <0367891DA5DA7E408D42A860FA002F44B0CC48@sma2901.cr.eurocopter.corp> <1l4yqvxoid4n1.1u8eo4oo8ml4m$.dlg@40tude.net> In-Reply-To: <1l4yqvxoid4n1.1u8eo4oo8ml4m$.dlg@40tude.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4685280c$0$14869$9b4e6d93@newsspool4.arcor-online.net> NNTP-Posting-Date: 29 Jun 2007 17:41:00 CEST NNTP-Posting-Host: 22bfd4e0.newsspool4.arcor-online.net X-Trace: DXC=c^`khJP8<03lIh70@IaJ]Z]RI_2A:ho7QcPOV3F1=>h@Q1S32TBGT`9AA2C< X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:16343 Date: 2007-06-29T17:41:00+02:00 List-Id: Dmitry A. Kazakov wrote: > On Fri, 29 Jun 2007 11:35:28 +0200, Duncan Sands wrote: > > >> in Ada 95 you could do >> >> X : T renames Factory; > > Yes, you're right. It should be illegal. Semantically it is same as > > X : Integer renames 1; -- Illegal I don't think that renaming an object is the same as renaming a number literal because the literal isn't declared anywhere. Wheras I could say that a returned object is declared as part of the function declaration. > function Very_Positive return Integer is > begin > return -1; > end Very_Positive; > > Oops : Positive renames Very_Positive; -- This is OK! So is if 42 not in Boolean'pos(false) .. Boolean'pos(true) then raise Constraint_Error; end if; Subtypes don't create new types in Ada. I wonder why you keep pretending they do? It is a mistake is to have predifined numeric types in a language because this invites all kinds of assumptions about numeric types.