comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: character literals
Date: Tue, 11 Feb 2014 23:49:13 +0100
Date: 2014-02-11T23:49:13+01:00	[thread overview]
Message-ID: <lde9d6$dmt$1@dont-email.me> (raw)
In-Reply-To: <rq8lf9tqg08bv32ouaudvsl62jto1abpu7@4ax.com>

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.

-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr

  reply	other threads:[~2014-02-11 22:49 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 [this message]
2014-02-11 23:45   ` Bill Findlay
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