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,c02604a46964120 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!news.tornevall.net!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Noob question: universal_integer type Date: Fri, 21 May 2010 16:37:41 -0700 Organization: TornevallNET - http://news.tornevall.net Message-ID: References: NNTP-Posting-Host: b611be35647e687c4e53c68daafce7f7 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: 3474e8efbeab02f008fb4378b7784ee6 X-Complaints-To: abuse@tornevall.net User-Agent: Thunderbird 2.0.0.24 (X11/20100411) X-Complaints-Language: Spoken language is english or swedish - NOT ITALIAN, FRENCH, GERMAN OR ANY OTHER LANGUAGE! In-Reply-To: X-Validate-Post: http://news.tornevall.net/validate.php?trace=3474e8efbeab02f008fb4378b7784ee6 X-SpeedUI: 1738 X-Complaints-Italiano: Non abbiamo padronanza della lingua italiana - se mandate una email scrivete solo in Inglese, grazie X-Posting-User: 0243687135df8c4b260dd4a9a93c79bd Xref: g2news2.google.com comp.lang.ada:11864 Date: 2010-05-21T16:37:41-07:00 List-Id: Duke Normandin wrote: > > Let me get this right... if I use an undeclared integer in an expression, > Ada will "deem it" to be a "universal_integer" and not choke at > compile-time? I don't know, and I've been using Ada since 1984. What is "an undeclared integer"? 17 is an integer literal; all integer literals are universal_integer. 17 is not an undeclared integer. What the tutorial is trying to get across is that Ada, unlike some languages, does not have typed numeric literals (see also universal_real). You might encounter a language in which 10 is a literal of type int and 10L a literal of long int, for example. In Ada, all integer literals are universal_integer, and implicitly converted to specific integer types as required. Partly this makes life easier: you can change the type of a variable and not have to change all the literals used with that variable; and partly it's pretty much needed in a language that lets you define your own numeric types. -- Jeff Carter "C's solution to this [variable-sized array parameters] has real problems, and people who are complaining about safety definitely have a point." Dennis Ritchie 25