* Re: two Ada95 syntax questions
2005-03-09 18:21 two Ada95 syntax questions bob
@ 2005-03-09 18:26 ` Pascal Obry
2005-03-09 18:28 ` Dmitry A. Kazakov
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Pascal Obry @ 2005-03-09 18:26 UTC (permalink / raw)
robertfm@eforell.com (bob) writes:
> Does Ada95 support multi-line comments? (i.e. /*О©╫.*/) Seems like I
> remember some compilers do though I don't see this in the LRM.
No.
> Does it support multi-line extensions? (i.e.:
>
> Blah blah\
> Blah -- blahs all on same line
No. This is not needed. For string it is posssible to use '&' operator which
is handled at compile time.
Var : constant String := "This is a multi-line string value"
& " which is analyzed at compile time, so operator '&'"
& " has no runtime penalty";
Pascal.
--
--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://www.obry.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: two Ada95 syntax questions
2005-03-09 18:21 two Ada95 syntax questions bob
2005-03-09 18:26 ` Pascal Obry
@ 2005-03-09 18:28 ` Dmitry A. Kazakov
2005-03-09 19:12 ` Larry Kilgallen
2005-03-11 21:42 ` Keith Thompson
3 siblings, 0 replies; 5+ messages in thread
From: Dmitry A. Kazakov @ 2005-03-09 18:28 UTC (permalink / raw)
On 9 Mar 2005 10:21:27 -0800, bob wrote:
> Does Ada95 support multi-line comments? (i.e. /*�.*/) Seems like I
> remember some compilers do though I don't see this in the LRM.
No
> Does it support multi-line extensions? (i.e.:
No. But there is no need in that. Except for keywords, identifiers,
comments and literals anything else may occupy as many lines you want. For
string literals one can use concatenation:
> Blah blah\
> Blah -- blahs all on same line
"Blah blah"
& "Blah"
results in "Blah blahBlah"
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: two Ada95 syntax questions
2005-03-09 18:21 two Ada95 syntax questions bob
2005-03-09 18:26 ` Pascal Obry
2005-03-09 18:28 ` Dmitry A. Kazakov
@ 2005-03-09 19:12 ` Larry Kilgallen
2005-03-11 21:42 ` Keith Thompson
3 siblings, 0 replies; 5+ messages in thread
From: Larry Kilgallen @ 2005-03-09 19:12 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 654 bytes --]
In article <455a31fd.0503091021.7650206e@posting.google.com>, robertfm@eforell.com (bob) writes:
> Does Ada95 support multi-line comments? (i.e. /*�.*/) Seems like I
> remember some compilers do though I don't see this in the LRM.
No, it was explicitly _not_ included in the language because of the
hazard of a missing comment terminator.
> Does it support multi-line extensions? (i.e.:
>
> Blah blah\
> Blah -- blahs all on same line
If I understand the question, yes. Statements can span lines,
although literal strings cannot. For that, one would say:
Warning : constant STRING := "Danger, "
& "Will Robinson";
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: two Ada95 syntax questions
2005-03-09 18:21 two Ada95 syntax questions bob
` (2 preceding siblings ...)
2005-03-09 19:12 ` Larry Kilgallen
@ 2005-03-11 21:42 ` Keith Thompson
3 siblings, 0 replies; 5+ messages in thread
From: Keith Thompson @ 2005-03-11 21:42 UTC (permalink / raw)
robertfm@eforell.com (bob) writes:
> Does Ada95 support multi-line comments? (i.e. /*О©╫.*/) Seems like I
> remember some compilers do though I don't see this in the LRM.
Sure, Ada supports multi-line comments, but not with that syntax.
The syntax is:
-- This is a
-- mult-line
-- comment.
Yes, I'm being facetious; that's really a series of single line comments.
One of the major justifications for multi-line comments is that they
make it easy to comment out a block of code. With any decent text
editor, it's easy to add or remove a "-- " from each line in a range,
and the result is much more clearly commented out than if you had to
search for the opening and closing delimiters.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
^ permalink raw reply [flat|nested] 5+ messages in thread