comp.lang.ada
 help / color / mirror / Atom feed
From: "Adam Beneschan" <adam@irvine.com>
Subject: Re: Usage of \ in Ada
Date: 24 Aug 2006 10:16:34 -0700
Date: 2006-08-24T10:16:34-07:00	[thread overview]
Message-ID: <1156439794.632467.297550@74g2000cwt.googlegroups.com> (raw)
In-Reply-To: ko0eva2unykm.13dmm0nr0c6wp$.dlg@40tude.net

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




  parent reply	other threads:[~2006-08-24 17:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-21  8:03 Usage of \ in Ada Jerry
2006-08-21  8:11 ` Jacob Sparre Andersen
2006-08-21 19:44 ` Jeffrey R. Carter
2006-08-21 20:25   ` Dmitry A. Kazakov
2006-08-22  2:47     ` Jeffrey R. Carter
2006-08-22  7:42       ` Dmitry A. Kazakov
2006-08-22 18:13         ` Adam Beneschan
2006-08-23  8:35           ` Dmitry A. Kazakov
2006-08-23 17:31             ` Adam Beneschan
2006-08-23 20:25               ` Dmitry A. Kazakov
2006-08-24  0:22                 ` Adam Beneschan
2006-08-24  8:37                   ` Jean-Pierre Rosen
2006-08-24  9:53                     ` Dmitry A. Kazakov
2006-08-24 12:15                       ` Jean-Pierre Rosen
2006-08-24 14:43                         ` Dmitry A. Kazakov
2006-08-24 15:24                           ` Jean-Pierre Rosen
2006-08-24 17:16                       ` Adam Beneschan [this message]
2006-08-22 19:38         ` Jeffrey R. Carter
2006-08-22 21:29           ` Keith Thompson
replies disabled

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