comp.lang.ada
 help / color / mirror / Atom feed
From: adambeneschan@gmail.com
Subject: Re: character literals
Date: Tue, 11 Feb 2014 16:18:36 -0800 (PST)
Date: 2014-02-11T16:18:36-08:00	[thread overview]
Message-ID: <e473ad04-df7a-4562-9ec5-79348928ef4d@googlegroups.com> (raw)
In-Reply-To: <9d08b5d0-012c-4b94-b8b9-ea6e83f2df4f@googlegroups.com>

On Tuesday, February 11, 2014 3:56:52 PM UTC-8, I wrote:

>>> IF ch in '0' .. '9' THEN

> I don't think your compiler should not be giving an "ambiguous" error on the above IF statement.  The literals '0' and '9' are indeed ambiguous, because they are actually overloaded functions that could return Character, Wide_Character, or Wide_Wide_Character, or possibly one or more user-defined enumeration types; however, assuming "ch" is a variable, it will have a known type, and I think that type can be used to resolve the types of the overloaded range.  However, on checking the language rules, it's not 100% clear to me that that's the case.  Neither compiler I tried this on reports an error, though.

After taking another look at the rules, I'm convinced that this IF statement is indeed legal.

                              -- Adam

  reply	other threads:[~2014-02-12  0:18 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
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 [this message]
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