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: a07f3367d7,73cb216d191f0fef X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.15.44.2 with SMTP id y2mr137410eev.2.1363918478897; Thu, 21 Mar 2013 19:14:38 -0700 (PDT) Path: p18ni6019wiv.0!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.81.MISMATCH!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsreader4.netcologne.de!news.netcologne.de!news.glorb.com!news-out.readnews.com!transit3.readnews.com!panix!newsfeed-00.mathworks.com!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Is this expected behavior or not Date: Sat, 16 Mar 2013 16:45:19 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <8klywqh2pf$.1f949flc1xeia.dlg@40tude.net> <513f6e2f$0$6572$9b4e6d93@newsspool3.arcor-online.net> <513faaf7$0$6626$9b4e6d93@newsspool2.arcor-online.net> <51408e81$0$6577$9b4e6d93@newsspool3.arcor-online.net> <11rcs3gg4taww$.bylek8fsshyz$.dlg@40tude.net> <99929f93-b80f-47c3-8a37-c81002733754@googlegroups.com> <87ec4b1d-f7cd-49a4-8cff-d44aeb76a1ad@googlegroups.com> <78103a2f-5d19-4378-b211-1917175d5694@googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1363466719 8845 192.74.137.71 (16 Mar 2013 20:45:19 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 16 Mar 2013 20:45:19 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:mzMp/KQGYmTOJbYg9dtxwk/rOtk= Content-Type: text/plain; charset=us-ascii Date: 2013-03-16T16:45:19-04:00 List-Id: Shark8 writes: > On Friday, March 15, 2013 3:46:26 PM UTC-6, Robert A Duff wrote: >> Many languages allow the type of an object to be deduced from >> its initial value. I believe C++ recently added that feature, >> using the "auto" keyword (which it inherited from C, and meant >> something completely different -- and completely useless). >> Ada allows that in a small way -- named numbers. > > This isn't _quite_ the same, it's declaring an object to be of the > same type as some other (and already known) object. Right, I didn't mean to imply it's the same. It's related. >> I suspect the reason was that the designers of Ada 83 thought that >> types of things ought to be explicit. Except for named numbers -- >> consistency wasn't their strong suit. > > I thought that named numbers were of the Universal_Integer (if > integral) or Universal_Float_and_Fixed if not... of course that could > just be an incorrect notion I've developed. That's correct. My point was that named numbers are an example where the type comes from the initial value. If you say "X : constant := Integer'Last;", X is of type universal_integer because the initial value is of some integer type -- the type of X is deduced from the type of its initial value. - Bob