Re: Usage of \ in Ada



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

.



Relevant Pages

  • Re: Usage of in Ada
    ... representation of the source) that you've forgotten a closing quote ... what was the reason for Ada not allowing control characters ... represent them inside string literals. ...
    (comp.lang.ada)
  • Re: Strings and bindary data
    ... String to another file, are those files guaranteed to be identical? ... No. Strings are designed to hold textual data, and that /always/ is subject to ... beyond what is in its representation. ... representation -- that's to say a mapping from abstract characters (or ...
    (comp.lang.java.programmer)
  • Re: A problem to read a SEG-file using Fortran90 code on PC
    ... IBM EBCDIC codes for characters convert to normal ascii codes, ... from IBM mainframe sources.. ... If you have floating point values stored in a bit representation you ...
    (comp.lang.fortran)
  • Re: Is ECMAScript really a dialect of Lisp?
    ... | - from a sequence of characters to objects; ... symbols, conses, and self-evaluating objects. ... evaluation model is defined upon them. ... the specific nature of the representation depends on its contexta. ...
    (comp.lang.lisp)
  • Re: C getchar() functionality in Ada
    ... but still I fail to mimick it in Ada. ... linefeeds, throw End_Error exceptions at me, or spits out too many ... Ada doesn't think of Text_IO files just as streams of characters (with ... If you really want to read individual characters and treat ...
    (comp.lang.ada)