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: a07f3367d7,caabf5265fad78e5 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.glorb.com!news2.glorb.com!wn11feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Re: Learning Ada Reply-To: anon@anon.org (anon) References: <59O1m.404661$4m1.69194@bgtnsc05-news.ops.worldnet.att.net> X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Mon, 06 Jul 2009 20:21:07 GMT NNTP-Posting-Host: 12.65.108.219 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1246911667 12.65.108.219 (Mon, 06 Jul 2009 20:21:07 GMT) NNTP-Posting-Date: Mon, 06 Jul 2009 20:21:07 GMT Organization: AT&T Worldnet Xref: g2news2.google.com comp.lang.ada:6865 Date: 2009-07-06T20:21:07+00:00 List-Id: Yes, I did redefine apart of Standard. Found this out back in the mid 1990 while testing GNAT 3.0x for a number of projects. Its also, one way (not the best, but it is quick) of porting code from a 32-bit system down to a 16 or 8 bit system. Like using Intel Core i7 system to write code for an Intel 8086 system, which can use the same basic (non-protective mode) instruction set. Also, rewriting any Ada package is allowable within the scope of the RM (in some implementation it maybe required). And if I add a body for the Standard package and uncommented the an operators I could of made the operator do what I wanted it to do. Like having all Boolean operators return FALSE. This process does not hide the built-in Standard package, its still there for the system to handle the other types, such as the Character or Wide_Character set, which can be a headache to define. In , AdaMagica writes: >Oh my dear anon, you are so wrong again. > >> package STANDARD is >> >> =A0 -- The universal type universal_integer is predefined. =A0 >> >> =A0 type INTEGER is range - 2 ** 63 .. ( 2 ** 63 ) - 1 ; >> >> end STANDARD; > >You do *not* redefine Standard with this declaration, you simply hide >it. > >with Standard; > >procedure Temp is -- Here you will get into troubled water. > > X: Integer; -- this is still the integer from the predefined >package Standard > Y: STANDARD.Integer; -- this is your INTEGER > > use Standard; > > Z: Integer :=3D 2; -- oh lord, what's this now? > > -- I'm not sure and I'm reluctant to do the RM exegesis to find out. >I *guess* it's your INTEGER; > > I: Integer :=3D Z**3; -- subtype of 3 is still the Integer defined in > -- the predefined Standard you've hidden > J: Integer :=3D Z**Z; -- This should then be illegal because the >subtype of the right operand of ** > -- must be the one from the hidden Standard. > >end Temp; > >Point is: You cannot redefine Standard! Full stop. > >I invite you to find the relevant paragraphs in the RM which state >what will happen when you define a package named Standard. > >And please be careful to not mix up a subtype and the type of the >subtype and the type of numeric literals. They are all different.