comp.lang.ada
 help / color / mirror / Atom feed
* Ada has no continual line(s) ??
@ 2002-05-30 16:20 hongxun lee
  2002-05-30 16:26 ` John McCabe
  0 siblings, 1 reply; 34+ messages in thread
From: hongxun lee @ 2002-05-30 16:20 UTC (permalink / raw)








^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-30 16:20 Ada has no continual line(s) ?? hongxun lee
@ 2002-05-30 16:26 ` John McCabe
  2002-05-30 17:41   ` hongxun lee
  0 siblings, 1 reply; 34+ messages in thread
From: John McCabe @ 2002-05-30 16:26 UTC (permalink / raw)


On Thu, 30 May 2002 12:20:23 -0400, "hongxun lee" <lee.1801@osu.edu>
wrote:

>
>
>

Pardon? What do you mean? 



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-30 16:26 ` John McCabe
@ 2002-05-30 17:41   ` hongxun lee
  2002-05-30 18:07     ` Pascal Obry
                       ` (5 more replies)
  0 siblings, 6 replies; 34+ messages in thread
From: hongxun lee @ 2002-05-30 17:41 UTC (permalink / raw)


Sorry..my Q is How to show a line of code is a continual part of it
preceding statement?
Thanks



"John McCabe" <john.nospam@nospamassen.nospamdemon.co.uk> wrote in message
news:3cf652a0.31278796@news.demon.co.uk...
> On Thu, 30 May 2002 12:20:23 -0400, "hongxun lee" <lee.1801@osu.edu>
> wrote:
>
> >
> >
> >
>
> Pardon? What do you mean?





^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-30 17:41   ` hongxun lee
@ 2002-05-30 18:07     ` Pascal Obry
  2002-05-31  7:53       ` Poul-Erik Andreasen
  2002-05-30 18:15     ` Mark Biggar
                       ` (4 subsequent siblings)
  5 siblings, 1 reply; 34+ messages in thread
From: Pascal Obry @ 2002-05-30 18:07 UTC (permalink / raw)



"hongxun lee" <lee.1801@osu.edu> writes:

> Sorry..my Q is How to show a line of code is a continual part of it
> preceding statement?

In Ada statements can spread on multiple lines. A new-line does not stop a
statement. For example:

        A := A + 1; B := B + 1; C := A + B;

is equivalent to:

        A
        :=
        A
        +
        1
        ;
        B := B
        + 1; C := A
        +
        B;

Of course a good style is to have a single statement on each line:

        A := A + 1;
        B := B + 1;
        C := A + B;

Does that answert your question ?

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-30 17:41   ` hongxun lee
  2002-05-30 18:07     ` Pascal Obry
@ 2002-05-30 18:15     ` Mark Biggar
  2002-05-30 18:28     ` Preben Randhol
                       ` (3 subsequent siblings)
  5 siblings, 0 replies; 34+ messages in thread
From: Mark Biggar @ 2002-05-30 18:15 UTC (permalink / raw)


hongxun lee wrote:
> 
> Sorry..my Q is How to show a line of code is a continual part of it
> preceding statement?
> Thanks
> 

Ada is free format language.  Statements end when you get to the ';'.
So there is no need or continuation markers.  If the previous
line didn't end in a ';', then this line is always a part of of the 
same statement.  Another way to think about it is that line terminators
are treated no different in Ada then space characters as far as 
statements are concerned.

--
Mark Biggar
mark.a.biggar@attbi.com



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-30 17:41   ` hongxun lee
  2002-05-30 18:07     ` Pascal Obry
  2002-05-30 18:15     ` Mark Biggar
@ 2002-05-30 18:28     ` Preben Randhol
  2002-05-30 18:31     ` Jeffrey Carter
                       ` (2 subsequent siblings)
  5 siblings, 0 replies; 34+ messages in thread
From: Preben Randhol @ 2002-05-30 18:28 UTC (permalink / raw)


On Thu, 30 May 2002 13:41:40 -0400, hongxun lee wrote:
> Sorry..my Q is How to show a line of code is a continual part of it
> preceding statement?

You can just type it like this:

   raise_exception 
      (Out_of_List_Boundary'Identity,
       Message => "Start of List already reached. " & 
       "No previous Node exists.");

or like this

    raise_exception (Out_of_List_Boundary'Identity,
                     Message => "Start of List already reached. " & 
                     "No previous Node exists.");


if I understand your question correctly.

Preben



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-30 17:41   ` hongxun lee
                       ` (2 preceding siblings ...)
  2002-05-30 18:28     ` Preben Randhol
@ 2002-05-30 18:31     ` Jeffrey Carter
  2002-05-30 20:18     ` John R. Strohm
  2002-05-30 21:48     ` chris.danx
  5 siblings, 0 replies; 34+ messages in thread
From: Jeffrey Carter @ 2002-05-30 18:31 UTC (permalink / raw)


hongxun lee wrote:
> 
> Sorry..my Q is How to show a line of code is a continual part of it
> preceding statement?

Ada statements are not line oriented. An Ada statement is always
terminated by a semicolon (';'). if a line is not a comment line or a
blank line, and it does not end in a semicolon, then the statement on
that line must be continued on the next.

If you look at the examples at www.adapower.com, you will find plenty of
examples of Ada statements that take more than one line. I think you'll
find it's pretty easy to see when a line is a continuation of a
statement without any explicit continuation marker.

-- 
Jeff Carter
"Now go away or I shall taunt you a second time."
Monty Python & the Holy Grail



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-30 20:18     ` John R. Strohm
@ 2002-05-30 19:13       ` Stephen Leake
  2002-05-30 20:17         ` Wes Groleau
  2002-05-30 21:25         ` Hyman Rosen
  2002-05-31  8:26       ` John McCabe
  1 sibling, 2 replies; 34+ messages in thread
From: Stephen Leake @ 2002-05-30 19:13 UTC (permalink / raw)


"John R. Strohm" <strohm@airmail.net> writes:

> Continuation marks are pretty much unique to FORTRAN.

And Visual Basic (well, version 3 and 4, anyway), and Makefiles and
shell scripts...

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-30 19:13       ` Stephen Leake
@ 2002-05-30 20:17         ` Wes Groleau
  2002-05-30 21:25         ` Hyman Rosen
  1 sibling, 0 replies; 34+ messages in thread
From: Wes Groleau @ 2002-05-30 20:17 UTC (permalink / raw)




> [continuation markers for] Makefiles and ....

I still have trouble getting straight when you
MUST use a space or MUST use a tab or MUST NOT use either ....

-- 
Wes Groleau
http://freepages.rootsweb.com/~wgroleau



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-30 17:41   ` hongxun lee
                       ` (3 preceding siblings ...)
  2002-05-30 18:31     ` Jeffrey Carter
@ 2002-05-30 20:18     ` John R. Strohm
  2002-05-30 19:13       ` Stephen Leake
  2002-05-31  8:26       ` John McCabe
  2002-05-30 21:48     ` chris.danx
  5 siblings, 2 replies; 34+ messages in thread
From: John R. Strohm @ 2002-05-30 20:18 UTC (permalink / raw)


Continuation marks are pretty much unique to FORTRAN.

In Ada, the semicolon at the end of the statement terminates the statement.
Until the compiler encounters the semicolon, successive lines are all
considered to be continuations of the same statement.

"hongxun lee" <lee.1801@osu.edu> wrote in message
news:ad5o8l$2u7$1@charm.magnus.acs.ohio-state.edu...
> Sorry..my Q is How to show a line of code is a continual part of it
> preceding statement?
> Thanks
>
>
>
> "John McCabe" <john.nospam@nospamassen.nospamdemon.co.uk> wrote in message
> news:3cf652a0.31278796@news.demon.co.uk...
> > On Thu, 30 May 2002 12:20:23 -0400, "hongxun lee" <lee.1801@osu.edu>
> > wrote:
> >
> > >
> > >
> > >
> >
> > Pardon? What do you mean?
>
>





^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-30 19:13       ` Stephen Leake
  2002-05-30 20:17         ` Wes Groleau
@ 2002-05-30 21:25         ` Hyman Rosen
  2002-05-30 23:14           ` Darren New
                             ` (2 more replies)
  1 sibling, 3 replies; 34+ messages in thread
From: Hyman Rosen @ 2002-05-30 21:25 UTC (permalink / raw)


Stephen Leake wrote:
> "John R. Strohm" <strohm@airmail.net> writes:
>>Continuation marks are pretty much unique to FORTRAN.
> And Visual Basic (well, version 3 and 4, anyway), and Makefiles and
> shell scripts...

And C, and C++.




^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-30 17:41   ` hongxun lee
                       ` (4 preceding siblings ...)
  2002-05-30 20:18     ` John R. Strohm
@ 2002-05-30 21:48     ` chris.danx
  2002-05-31  3:30       ` Robert Dewar
       [not found]       ` <ad6b5t$69t$1@charm.magnus.acs.ohio-state.edu>
  5 siblings, 2 replies; 34+ messages in thread
From: chris.danx @ 2002-05-30 21:48 UTC (permalink / raw)



"hongxun lee" <lee.1801@osu.edu> wrote in message
news:ad5o8l$2u7$1@charm.magnus.acs.ohio-state.edu...
> Sorry..my Q is How to show a line of code is a continual part of it
> preceding statement?

If it's a really big string that won't fit comfortably on one line (IIRC C
has a facility for multiline strings), you can do

x := "One ring to blahdy blah, "
     & "One ring to blahdy blahdy blah, "
     & "One ring to blahdy blah and blahdy blahdy blah!";

providing that x is suitably large.  The compiler might throw away the &
function and replace it with one long string in the above case (if it was
more efficient to do so), since the expression doesn't involve a variable
string, but that's just a guess.  Would GNAT do that?  Just curious.


hth,
Chris





^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-30 21:25         ` Hyman Rosen
@ 2002-05-30 23:14           ` Darren New
  2002-05-31  8:27           ` John McCabe
  2002-05-31 13:15           ` Stephen Leake
  2 siblings, 0 replies; 34+ messages in thread
From: Darren New @ 2002-05-30 23:14 UTC (permalink / raw)


Hyman Rosen wrote:
> And C, and C++.

And Tcl. And anything else where newlines and spaces aren't the same thing.
:-)
-- 
Darren New 
San Diego, CA, USA (PST). Cryptokeys on demand.
** http://home.san.rr.com/dnew/DNResume.html **
** http://images.fbrtech.com/dnew/ **

     My brain needs a "back" button so I can
         remember where I left my coffee mug.



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-30 21:48     ` chris.danx
@ 2002-05-31  3:30       ` Robert Dewar
  2002-05-31 13:01         ` chris.danx
       [not found]       ` <ad6b5t$69t$1@charm.magnus.acs.ohio-state.edu>
  1 sibling, 1 reply; 34+ messages in thread
From: Robert Dewar @ 2002-05-31  3:30 UTC (permalink / raw)


"chris.danx" <spamoff.danx@ntlworld.com> wrote in message news:<97xJ8.18262$wd3.3068622@news6-win.server.ntlworld.com  > The compiler might throw away the &
> function and replace it with one long string in the above 
> case (if it was more efficient to do so), since the 
> expression doesn't involve a variable
> string, but that's just a guess.  Would GNAT do that?  


Yes, of course, this is essentially required by the language since
this is a static string expression as
defined in RM 4.9.



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-30 18:07     ` Pascal Obry
@ 2002-05-31  7:53       ` Poul-Erik Andreasen
  2002-05-31  8:25         ` John McCabe
  2002-05-31  8:43         ` John McCabe
  0 siblings, 2 replies; 34+ messages in thread
From: Poul-Erik Andreasen @ 2002-05-31  7:53 UTC (permalink / raw)


Pascal Obry wrote:
> 
> "hongxun lee" <lee.1801@osu.edu> writes:
> 
> > Sorry..my Q is How to show a line of code is a continual part of it
> > preceding statement?
> 
> In Ada statements can spread on multiple lines. 

Yes, but not for strings.

This function call wont work

Put(" This is a message over more than one line
to illustrate that Ada don ignor newlines completely");

It vill an error 

missing string quote


It have to bee

Put(" This is a message over more than one line" &
"to illustrate that Ada don ignor newlines completely");
 

-- 
-
Poul-Erik Andreasen
Hvis du mangler nogen til noget eller du kan noget for nogen.
http://linux-freelance.pea.dk



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-31  7:53       ` Poul-Erik Andreasen
@ 2002-05-31  8:25         ` John McCabe
  2002-05-31 15:24           ` Darren New
  2002-05-31  8:43         ` John McCabe
  1 sibling, 1 reply; 34+ messages in thread
From: John McCabe @ 2002-05-31  8:25 UTC (permalink / raw)


On Fri, 31 May 2002 09:53:43 +0200, Poul-Erik Andreasen
<poulerik@pea.dk> wrote:

>> In Ada statements can spread on multiple lines. 

>Yes, but not for strings.
>
>This function call wont work
>
>Put(" This is a message over more than one line
>to illustrate that Ada don ignor newlines completely");
>
>It vill an error 
>
>missing string quote

Of course it will - what other modern, high level language would allow
you to do that? Certainly not C or C++. In fact Ada's string
concatenation operator ('&' as you've shown below) is one of the most
elegant ways I know of carrying this out.

>
>It have to bee
>
>Put(" This is a message over more than one line" &
>"to illustrate that Ada don ignor newlines completely");
> 
>
>-- 
>-
>Poul-Erik Andreasen
>Hvis du mangler nogen til noget eller du kan noget for nogen.
>http://linux-freelance.pea.dk




^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-30 20:18     ` John R. Strohm
  2002-05-30 19:13       ` Stephen Leake
@ 2002-05-31  8:26       ` John McCabe
  1 sibling, 0 replies; 34+ messages in thread
From: John McCabe @ 2002-05-31  8:26 UTC (permalink / raw)


On Thu, 30 May 2002 13:18:36 -0700, "John R. Strohm"
<strohm@airmail.net> wrote:

>Continuation marks are pretty much unique to FORTRAN.

And Visual Basic :-)





^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-30 21:25         ` Hyman Rosen
  2002-05-30 23:14           ` Darren New
@ 2002-05-31  8:27           ` John McCabe
  2002-05-31  8:44             ` John McCabe
  2002-05-31  9:03             ` Jean-Marc Bourguet
  2002-05-31 13:15           ` Stephen Leake
  2 siblings, 2 replies; 34+ messages in thread
From: John McCabe @ 2002-05-31  8:27 UTC (permalink / raw)


On Thu, 30 May 2002 17:25:24 -0400, Hyman Rosen <hyrosen@mail.com>
wrote:

>Stephen Leake wrote:
>> "John R. Strohm" <strohm@airmail.net> writes:
>>>Continuation marks are pretty much unique to FORTRAN.
>> And Visual Basic (well, version 3 and 4, anyway), and Makefiles and
>> shell scripts...
>
>And C, and C++.

Eh? That's a new one on me - can you explain?



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-31  7:53       ` Poul-Erik Andreasen
  2002-05-31  8:25         ` John McCabe
@ 2002-05-31  8:43         ` John McCabe
  2002-05-31 16:51           ` Hyman Rosen
  1 sibling, 1 reply; 34+ messages in thread
From: John McCabe @ 2002-05-31  8:43 UTC (permalink / raw)


On Fri, 31 May 2002 09:53:43 +0200, Poul-Erik Andreasen
<poulerik@pea.dk> wrote:

>It have to bee

>Put(" This is a message over more than one line" &
>"to illustrate that Ada don ignor newlines completely");

In e.g. C it would have to be:

printf("This is a message over more than one line "
"to illustrate that C don ignor newlines completely");

You still have to have two separate string constants, although in ANSI
C the concatenation is done automatically if the string constants are
separated only by whitespace. The use of the '&' operator in Ada makes
it much more obvious that you did this intentionally.



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-31  8:27           ` John McCabe
@ 2002-05-31  8:44             ` John McCabe
  2002-05-31 19:51               ` Keith Thompson
  2002-05-31  9:03             ` Jean-Marc Bourguet
  1 sibling, 1 reply; 34+ messages in thread
From: John McCabe @ 2002-05-31  8:44 UTC (permalink / raw)


On Fri, 31 May 2002 08:27:38 GMT,
john.nospam@nospamassen.nospamdemon.co.uk (John McCabe) wrote:

>On Thu, 30 May 2002 17:25:24 -0400, Hyman Rosen <hyrosen@mail.com>
>wrote:
>
>>Stephen Leake wrote:
>>> "John R. Strohm" <strohm@airmail.net> writes:
>>>>Continuation marks are pretty much unique to FORTRAN.
>>> And Visual Basic (well, version 3 and 4, anyway), and Makefiles and
>>> shell scripts...
>>
>>And C, and C++.
>
>Eh? That's a new one on me - can you explain?

Macro definitions of course (doh!) - any others?



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-31  8:27           ` John McCabe
  2002-05-31  8:44             ` John McCabe
@ 2002-05-31  9:03             ` Jean-Marc Bourguet
  1 sibling, 0 replies; 34+ messages in thread
From: Jean-Marc Bourguet @ 2002-05-31  9:03 UTC (permalink / raw)


john.nospam@nospamassen.nospamdemon.co.uk (John McCabe) writes:

> On Thu, 30 May 2002 17:25:24 -0400, Hyman Rosen <hyrosen@mail.com>
> wrote:
> 
> >Stephen Leake wrote:
> >> "John R. Strohm" <strohm@airmail.net> writes:
> >>>Continuation marks are pretty much unique to FORTRAN.
> >> And Visual Basic (well, version 3 and 4, anyway), and Makefiles and
> >> shell scripts...
> >
> >And C, and C++.
> 
> Eh? That's a new one on me - can you explain?

Look at the way they do multiline macros...

Yours,

-- 
Jean-Marc



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-31  3:30       ` Robert Dewar
@ 2002-05-31 13:01         ` chris.danx
  0 siblings, 0 replies; 34+ messages in thread
From: chris.danx @ 2002-05-31 13:01 UTC (permalink / raw)



"Robert Dewar" <dewar@gnat.com> wrote in message
news:5ee5b646.0205301930.1368d015@posting.google.com...

> > The compiler might throw away the &
> > function and replace it with one long string in the above
> > case (if it was more efficient to do so), since the
> > expression doesn't involve a variable
> > string, but that's just a guess.  Would GNAT do that?
>
>
> Yes, of course, this is essentially required by the language since
> this is a static string expression as
> defined in RM 4.9.

Thanks!





^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-30 21:25         ` Hyman Rosen
  2002-05-30 23:14           ` Darren New
  2002-05-31  8:27           ` John McCabe
@ 2002-05-31 13:15           ` Stephen Leake
  2002-05-31 16:56             ` Hyman Rosen
  2 siblings, 1 reply; 34+ messages in thread
From: Stephen Leake @ 2002-05-31 13:15 UTC (permalink / raw)


Hyman Rosen <hyrosen@mail.com> writes:

> Stephen Leake wrote:
> > "John R. Strohm" <strohm@airmail.net> writes:
> >>Continuation marks are pretty much unique to FORTRAN.
> > And Visual Basic (well, version 3 and 4, anyway), and Makefiles and
> > shell scripts...
> 
> And C, and C++.

More precisely, the preprocessors for C and C++. I guess that is
technically part of the languages. 

Interesting that I didn't think of those languages :).

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
       [not found]       ` <ad6b5t$69t$1@charm.magnus.acs.ohio-state.edu>
@ 2002-05-31 14:50         ` Robert Dewar
  2002-06-11 21:38           ` Keith Thompson
  0 siblings, 1 reply; 34+ messages in thread
From: Robert Dewar @ 2002-05-31 14:50 UTC (permalink / raw)


"hongxun lee" <lee.1801@osu.edu> wrote in message news:<ad6b5t$69t$1@charm.magnus.acs.ohio-state.edu>...
> this (is exactly my worry) works well..
> 
> > x :string := "One ring to blahdy blah, "
> >      & "One ring to blahdy blahdy blah, "
> >      & "One ring to blahdy blah and bla ";


Actually this is a weakness in Ada. It is not always the
case that you can replace a long string literal with several string
literals concatenated together (it is
interesting to leave this up to the reader to figure
out when it fails :-)

There really should have been a lexical convention for
continuing long strings. An obvious one would simply be
to say that you can break a long literal into two, e.g. replace "long
string" by "long " whitespace "string".

In practice the exceptional cases are rare, but still
it is annoying to have nasty little exceptions like this.



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-31  8:25         ` John McCabe
@ 2002-05-31 15:24           ` Darren New
  0 siblings, 0 replies; 34+ messages in thread
From: Darren New @ 2002-05-31 15:24 UTC (permalink / raw)


John McCabe wrote:
> Of course it will - what other modern, high level language would allow
> you to do that? Certainly not C or C++.

Tcl. Of course, you get a \n in the middle of the string. 

(Hey, you asked... ;-)

-- 
Darren New 
San Diego, CA, USA (PST). Cryptokeys on demand.
** http://home.san.rr.com/dnew/DNResume.html **
** http://images.fbrtech.com/dnew/ **

     My brain needs a "back" button so I can
         remember where I left my coffee mug.



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-31  8:43         ` John McCabe
@ 2002-05-31 16:51           ` Hyman Rosen
  0 siblings, 0 replies; 34+ messages in thread
From: Hyman Rosen @ 2002-05-31 16:51 UTC (permalink / raw)


John McCabe wrote:
> In e.g. C it would have to be:
> 
> printf("This is a message over more than one line "
> "to illustrate that C don ignor newlines completely");

C and C++ do have a line continuation character, the \.
Very early in compilation, a sequence of \ followed by
newline is deleted, thereby joining lines. So the above
could be written as

printf("This is a message over more than one line \
to illustrate that C don ignor newlines completely");




^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-31 13:15           ` Stephen Leake
@ 2002-05-31 16:56             ` Hyman Rosen
  0 siblings, 0 replies; 34+ messages in thread
From: Hyman Rosen @ 2002-05-31 16:56 UTC (permalink / raw)


Stephen Leake wrote:
> More precisely, the preprocessors for C and C++. I guess that is
> technically part of the languages.

Standard C and C++ do not consider preprocessing as something
apart from the language itself. In any case, a backslash followed
by a newline is deleted from the input, thereby joining lines.

For C++, see 2.1/2 in the standard. (Available from ANSI for
only US$18, get it now. Great for bashing C++ knowledgably :-)




^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-31  8:44             ` John McCabe
@ 2002-05-31 19:51               ` Keith Thompson
  0 siblings, 0 replies; 34+ messages in thread
From: Keith Thompson @ 2002-05-31 19:51 UTC (permalink / raw)


john.nospam@nospamassen.nospamdemon.co.uk (John McCabe) writes:
> On Fri, 31 May 2002 08:27:38 GMT,
> john.nospam@nospamassen.nospamdemon.co.uk (John McCabe) wrote:
> >On Thu, 30 May 2002 17:25:24 -0400, Hyman Rosen <hyrosen@mail.com>
> >wrote:
[...]
> >>And C, and C++.
> >
> >Eh? That's a new one on me - can you explain?
> 
> Macro definitions of course (doh!) - any others?

C's '\' line continuation character can be used anywhere, even in the
middle of a token.  It's most commonly used in long macro definitions
because that's probably the only place where it's really needed.

-- 
Keith Thompson (The_Other_Keith) kst@cts.com  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center           <*>  <http://www.sdsc.edu/~kst>
Schroedinger does Shakespeare: "To be *and* not to be"



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-05-31 14:50         ` Robert Dewar
@ 2002-06-11 21:38           ` Keith Thompson
  2002-06-12 23:32             ` David Brown
  0 siblings, 1 reply; 34+ messages in thread
From: Keith Thompson @ 2002-06-11 21:38 UTC (permalink / raw)


dewar@gnat.com (Robert Dewar) writes:
[...]
> Actually this is a weakness in Ada. It is not always the
> case that you can replace a long string literal with several string
> literals concatenated together (it is
> interesting to leave this up to the reader to figure
> out when it fails :-)

Ok, I give up.  (I was thinking of pragma arguments, but the string
argument to the Import, Export, and Linker_Options pragmas just have
to be static.)

-- 
Keith Thompson (The_Other_Keith) kst@cts.com  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center           <*>  <http://www.sdsc.edu/~kst>
Schroedinger does Shakespeare: "To be *and* not to be"



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-06-11 21:38           ` Keith Thompson
@ 2002-06-12 23:32             ` David Brown
  2002-06-13  2:03               ` Robert A Duff
  2002-06-13 15:56               ` Ted Dennison
  0 siblings, 2 replies; 34+ messages in thread
From: David Brown @ 2002-06-12 23:32 UTC (permalink / raw)


Keith Thompson <kst@cts.com> wrote:
> dewar@gnat.com (Robert Dewar) writes:
> [...]
>> Actually this is a weakness in Ada. It is not always the
>> case that you can replace a long string literal with several string
>> literals concatenated together (it is
>> interesting to leave this up to the reader to figure
>> out when it fails :-)
> 
> Ok, I give up.  (I was thinking of pragma arguments, but the string
> argument to the Import, Export, and Linker_Options pragmas just have
> to be static.)

How about:

        function "ab" & "s" (Right : Hmm) return Hmm;

Any others?



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-06-12 23:32             ` David Brown
@ 2002-06-13  2:03               ` Robert A Duff
  2002-06-13 15:56               ` Ted Dennison
  1 sibling, 0 replies; 34+ messages in thread
From: Robert A Duff @ 2002-06-13  2:03 UTC (permalink / raw)


David Brown <davidb@davidb.org> writes:

> How about:
> 
>         function "ab" & "s" (Right : Hmm) return Hmm;
> 
> Any others?

Well, if "&" is redefined to do something other than concatenation,
then you can't concatenate strings with "&".

- Bob



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
@ 2002-06-13 13:17 Grein, Christoph
  2002-06-13 14:02 ` Stephen Leake
  0 siblings, 1 reply; 34+ messages in thread
From: Grein, Christoph @ 2002-06-13 13:17 UTC (permalink / raw)


> dewar@gnat.com (Robert Dewar) writes:
> [...]
> > Actually this is a weakness in Ada. It is not always the
> > case that you can replace a long string literal with several string
> > literals concatenated together (it is
> > interesting to leave this up to the reader to figure
> > out when it fails :-)
> 
> Ok, I give up.  (I was thinking of pragma arguments, but the string
> argument to the Import, Export, and Linker_Options pragmas just have
> to be static.)
> 
> -- 

"Lady Ada" versus "Lady" & " Ada": These are not necessarily the same.

For an example see my homepage

http://home.T-Online.de/home/Christ-Usch.Grein/AdaMagica/Invitation.html



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-06-13 13:17 Grein, Christoph
@ 2002-06-13 14:02 ` Stephen Leake
  0 siblings, 0 replies; 34+ messages in thread
From: Stephen Leake @ 2002-06-13 14:02 UTC (permalink / raw)


"Grein, Christoph" <christoph.grein@eurocopter.com> writes:

> "Lady Ada" versus "Lady" & " Ada": These are not necessarily the same.
> 
> For an example see my homepage
> 
> http://home.T-Online.de/home/Christ-Usch.Grein/AdaMagica/Invitation.html

Very nice :).

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Ada has no continual line(s) ??
  2002-06-12 23:32             ` David Brown
  2002-06-13  2:03               ` Robert A Duff
@ 2002-06-13 15:56               ` Ted Dennison
  1 sibling, 0 replies; 34+ messages in thread
From: Ted Dennison @ 2002-06-13 15:56 UTC (permalink / raw)


David Brown <davidb@davidb.org> wrote in message news:<xSQN8.67329$wj7.24825263@twister.socal.rr.com>...
> > dewar@gnat.com (Robert Dewar) writes:
> > [...]
> >> Actually this is a weakness in Ada. It is not always the
> >> case that you can replace a long string literal with several string
> >> literals concatenated together (it is
> >> interesting to leave this up to the reader to figure
> >> out when it fails :-)
>         function "ab" & "s" (Right : Hmm) return Hmm;

I don't think "abs" counts as a "long string literal". :-)


-- 
T.E.D. 
Home     -  mailto:dennison@telepath.com (Yahoo: Ted_Dennison)
Homepage -  (temporarily down)



^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2002-06-13 15:56 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-30 16:20 Ada has no continual line(s) ?? hongxun lee
2002-05-30 16:26 ` John McCabe
2002-05-30 17:41   ` hongxun lee
2002-05-30 18:07     ` Pascal Obry
2002-05-31  7:53       ` Poul-Erik Andreasen
2002-05-31  8:25         ` John McCabe
2002-05-31 15:24           ` Darren New
2002-05-31  8:43         ` John McCabe
2002-05-31 16:51           ` Hyman Rosen
2002-05-30 18:15     ` Mark Biggar
2002-05-30 18:28     ` Preben Randhol
2002-05-30 18:31     ` Jeffrey Carter
2002-05-30 20:18     ` John R. Strohm
2002-05-30 19:13       ` Stephen Leake
2002-05-30 20:17         ` Wes Groleau
2002-05-30 21:25         ` Hyman Rosen
2002-05-30 23:14           ` Darren New
2002-05-31  8:27           ` John McCabe
2002-05-31  8:44             ` John McCabe
2002-05-31 19:51               ` Keith Thompson
2002-05-31  9:03             ` Jean-Marc Bourguet
2002-05-31 13:15           ` Stephen Leake
2002-05-31 16:56             ` Hyman Rosen
2002-05-31  8:26       ` John McCabe
2002-05-30 21:48     ` chris.danx
2002-05-31  3:30       ` Robert Dewar
2002-05-31 13:01         ` chris.danx
     [not found]       ` <ad6b5t$69t$1@charm.magnus.acs.ohio-state.edu>
2002-05-31 14:50         ` Robert Dewar
2002-06-11 21:38           ` Keith Thompson
2002-06-12 23:32             ` David Brown
2002-06-13  2:03               ` Robert A Duff
2002-06-13 15:56               ` Ted Dennison
  -- strict thread matches above, loose matches on Subject: below --
2002-06-13 13:17 Grein, Christoph
2002-06-13 14:02 ` Stephen Leake

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