From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,20c75acdaea028c3 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!74g2000cwt.googlegroups.com!not-for-mail From: "Adam Beneschan" Newsgroups: comp.lang.ada Subject: Re: Usage of \ in Ada Date: 24 Aug 2006 10:16:34 -0700 Organization: http://groups.google.com Message-ID: <1156439794.632467.297550@74g2000cwt.googlegroups.com> References: <1156147411.215015.31110@i42g2000cwa.googlegroups.com> <17jicmx6si17i.1wwvf6cafw7u1.dlg@40tude.net> <1thd8agjty9cr.dyp1m8yqb4xd$.dlg@40tude.net> <1156270408.443763.15680@h48g2000cwc.googlegroups.com> <1156354284.975163.174490@b28g2000cwb.googlegroups.com> <1j9zi3r2docoq$.5gnvkzmffdxu.dlg@40tude.net> <1156378961.270464.303590@75g2000cwc.googlegroups.com> <6gojce.g51.ln@hunter.axlog.fr> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1156439800 16545 127.0.0.1 (24 Aug 2006 17:16:40 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 24 Aug 2006 17:16:40 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: 74g2000cwt.googlegroups.com; posting-host=66.126.103.122; posting-account=cw1zeQwAAABOY2vF_g6V_9cdsyY_wV9w Xref: g2news2.google.com comp.lang.ada:6346 Date: 2006-08-24T10:16:34-07:00 List-Id: Dmitry A. Kazakov wrote: > On Thu, 24 Aug 2006 10:37:21 +0200, Jean-Pierre Rosen wrote: > > > Adam Beneschan a =E9crit : > >> 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=2EC.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