Re: Usage of \ in Ada
- From: "Adam Beneschan" <adam@xxxxxxxxxx>
- Date: 24 Aug 2006 10:16:34 -0700
Dmitry A. Kazakov wrote:
On Thu, 24 Aug 2006 10:37:21 +0200, Jean-Pierre Rosen wrote:
Adam Beneschan a écrit :
It's probably to prevent stupid errors. If you have a string literal
with an LF in it, it's far more likely (using a fairly traditional
representation of the source) that you've forgotten a closing quote
than that you intended to put a linefeed in the literal. And if the
language did try to allow a line separator in a string literal (even if
it were represented as something like \n in the representation)
And of course, if you really need an LF in a character string, just use
Ada.Characters.Latin_1.LF ....
Sure, but that is not the point.
Well, J-P's point is sort of pertinent. The question I was trying to
answer was, what was the reason for Ada not allowing control characters
inside string literals. And whatever reasons the authors might have
had for thinking allowing them was a bad idea, the fact is that it's
relatively easy in Ada to find another way to include such characters
in a string value, simply by using the concatenate operator and
A.C.L.LF or whatever, so there's no pressing need to find a way to
represent them inside string literals. Trying to do the same thing in
C, without using the special escape sequences, is pretty painful.
-- Adam
.
- 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
- Re: Usage of \ in Ada
- From: Adam Beneschan
- Re: Usage of \ in Ada
- From: Dmitry A. Kazakov
- Re: Usage of \ in Ada
- From: Adam Beneschan
- Re: Usage of \ in Ada
- From: Jean-Pierre Rosen
- Re: Usage of \ in Ada
- From: Dmitry A. Kazakov
- Usage of \ in Ada
- Prev by Date: call procedure in Linux-Ada-module from "normal" program
- Next by Date: Re: Information On How To Use The Ada Score Compiler For Windows PC
- Previous by thread: Re: Usage of \ in Ada
- Next by thread: Re: Usage of \ in Ada
- Index(es):
Relevant Pages
|