comp.lang.ada
 help / color / mirror / Atom feed
From: robert_dewar@my-dejanews.com
Subject: Re: Character Type?
Date: 1999/01/28
Date: 1999-01-28T00:00:00+00:00	[thread overview]
Message-ID: <78pmds$32r$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 36AF1CB3.BC7741B4@pgh.net

In article <36AF1CB3.BC7741B4@pgh.net>,
  ghristwd@pgh.net wrote:
> Well, I'm pretty new with Ada, but the obvious problem, I
> think, is that '10' is not a character, it is a string.

That's confusingly wrong.

Strings in Ada are delimited with the character "

The character ' is used to delimit character literals. The
sequence of characters '10' is not anything at all, it is
simply invalid, as is easily seen from the grammar rules
in the RM.

Now in general of course, you might be right, that if you
see '10' it could be that the programmer intended a string,
and indeed GNAT makes this guess:

     1. procedure j is
     2.   x : character := '10';
                           |
        >>> strings are delimited by double quote character

     3. begin
     4.    null;
     5. end;

However, in the original program, it clearly was NOT
intended to be a string, in fact from the original program
I certainly have no idea what the programmer had in mind,
it was clearly very muddled thinking, so it is certainly
not surprising that the compiler could not magically
suggest what the programmer had in mind in this particular
case :-)


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




      parent reply	other threads:[~1999-01-28  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-26  0:00 Character Type? Chris
1999-01-26  0:00 ` Tom Moran
1999-01-27  0:00 ` Bill Ghrist
1999-01-27  0:00   ` Simon Wright
1999-01-28  0:00   ` robert_dewar [this message]
replies disabled

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