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,FREEMAIL_FROM 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!news1.google.com!news.glorb.com!newsfeed2.telusplanet.net!newsfeed.telus.net!edtnps82.POSTED!7564ea0f!not-for-mail Newsgroups: comp.lang.ada From: Duke Normandin Subject: Re: Noob question: universal_integer type References: User-Agent: slrn/0.9.8.1 (Darwin) Message-ID: Date: Sat, 22 May 2010 02:04:00 GMT NNTP-Posting-Host: 75.154.79.143 X-Trace: edtnps82 1274493840 75.154.79.143 (Fri, 21 May 2010 20:04:00 MDT) NNTP-Posting-Date: Fri, 21 May 2010 20:04:00 MDT Xref: g2news2.google.com comp.lang.ada:11869 Date: 2010-05-22T02:04:00+00:00 List-Id: On 2010-05-21, Jeffrey R. Carter wrote: > 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. > OK! I got it... -- Duke *** Tolerance becomes a crime, when applied to evil [Thomas Mann] ***