comp.lang.ada
 help / color / mirror / Atom feed
From: Bill Findlay <yaldnif.w@blueyonder.co.uk>
Subject: Re: character literals
Date: 11 Feb 2014 23:45:53 GMT
Date: 2014-02-11T23:45:53+00:00	[thread overview]
Message-ID: <887860151413854987.949178yaldnif.w-blueyonder.co.uk@news.individual.net> (raw)
In-Reply-To: lde9d6$dmt$1@dont-email.me

"J-P. Rosen" <rosen@adalog.fr> wrote:
> Le 11/02/2014 23:27, agent@drrob1.com a écrit :
>> I have been having a difficulty in my code with character literals.
>> For example
>> 
>>  IF ch in '0' .. '9' THEN
>> 
>> This gives an error because the compiler is complaining that it does
>> not know if I mean a character, wide_character, or wide_wide_character
>> for my literals.  How do I indicate which I want?
>> 
> if Ch in Character range '0' .. '9' then
> 
> Ada recognizes types by name. There are a few cases (like this one)
> where the designers tried to save some typing by allowing the type to be
> inferred from the values; it is almost always a bad idea, and it is
> always possible to state the type explicitely.

Why is the literal type not inferred from the type of Ch in this case?

-- 
Bill Findlay

  reply	other threads:[~2014-02-11 23:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-11 22:27 character literals agent
2014-02-11 22:49 ` J-P. Rosen
2014-02-11 23:45   ` Bill Findlay [this message]
2014-02-11 23:49     ` Ludovic Brenta
2014-02-11 23:58       ` adambeneschan
2014-02-11 23:56 ` adambeneschan
2014-02-12  0:18   ` adambeneschan
2014-02-12  1:34     ` agent
2014-02-12  2:03       ` adambeneschan
2014-02-12 12:50         ` agent
2014-02-12  1:30   ` Jeffrey Carter
2014-02-12  1:50     ` adambeneschan
2014-02-12 15:53   ` Robert A Duff
2014-02-12 17:55     ` J-P. Rosen
2014-02-14 12:39       ` agent
2014-02-14 18:36         ` AdaControl was: " Simon Clubley
2014-02-15  6:26         ` J-P. Rosen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox