Re: Usage of \ in Ada
- From: "Adam Beneschan" <adam@xxxxxxxxxx>
- Date: 23 Aug 2006 10:31:25 -0700
Dmitry A. Kazakov wrote:
On 22 Aug 2006 11:13:28 -0700, Adam Beneschan wrote:
Dmitry A. Kazakov wrote:
P.S. it seems that OP question actually cannot be answered. Whether \ is
reserved for a control function depends on the platform.
No, it depends on ISO 10646. And character 92 (\) is not reserved for
a control function in that ISO standard. See also RM95 2.1(17).
Yes, that should exclude the code position 16#5C# (\).
Its wording is interesting, because it uses "code position", and yet leaves
source representation free. I wonder, if that might lead to confusion.
Apparently it has. Either you're really confused, or I'm really
confused about what you're trying to say, or possibly both.
Conceptually, an Ada95 program is a sequence of characters, where a
"character" is something defined by ISO 10646 (specifically, the Basic
Multilingual Plane of that standard). Please note that this is
*conceptually* true and has nothing to do with what bits are used to
represent those characters (on disk, or in memory, or in the bytes that
come down a socket to the compiler from a preprocessor program, or
whatever). The disk (let's say) will contain some sequence of bits
that isn't defined by the language. But at some point, the compiler
will interpret that as the mathematical entity that comprises an Ada
source, i.e. the sequence of ISO 10646 BMP characters. I think that
once you separate, in your mind, the conceptual from the actual
representation on disk, there should be no more confusion. If the
sequence of characters that makes up an Ada program includes a line
that consists of a series of non-quote characters, followed by a quote
mark, followed by a line separator (2.2(2)), followed by another quote
mark, the program is illegal. Period. This doesn't depend on the
platform or on the representation. On the other hand, a \ character in
a line of the Ada source is treated exactly the same as other
characters that are not letters, digits, underscores, format effectors,
quotation marks, or delimiters; this is also true regardless of the
representation or the platform.
I'm having trouble understanding your point, and I think it's because
you're intermingling the conceptual and representational forms of the
Ada program, so that either I don't know which one you're referring to,
or you're of confusing them and sort of referring to both at the same
time. It would help if you were clearer about which one you're
discussing. The actual representation of an Ada source could be an
issue for the OP's question, if TextMate doesn't understand how a
particular Ada compiler converts the representation to the conceptual
form and just displays things as it sees them on disk. But I've never
heard of an Ada compiler that treats \ in the representation of an Ada
program as having any special meaning inside string literals. And it
would make no sense for an Ada compiler to treat \" in the disk
representation as representing a quotation mark.
-- Adam
.
- Follow-Ups:
- Re: Usage of \ in Ada
- From: Dmitry A. Kazakov
- Re: Usage of \ in Ada
- References:
- Usage of \ in Ada
- From: Jerry
- Re: Usage of \ in Ada
- From: Jeffrey R. Carter
- Re: Usage of \ in Ada
- From: Dmitry A. Kazakov
- Re: Usage of \ in Ada
- From: Jeffrey R. Carter
- Re: Usage of \ in Ada
- From: Dmitry A. Kazakov
- Re: Usage of \ in Ada
- From: Adam Beneschan
- Re: Usage of \ in Ada
- From: Dmitry A. Kazakov
- Usage of \ in Ada
- Prev by Date: Re: [SPARK] Code safety and information hiding
- Next by Date: Re: Usage of \ in Ada
- Previous by thread: Re: Usage of \ in Ada
- Next by thread: Re: Usage of \ in Ada
- Index(es):
Relevant Pages
|