comp.lang.ada
 help / color / mirror / Atom feed
* Re: Pragma Comment -- What does it do?
  1999-11-10  0:00 Pragma Comment -- What does it do? MaryAnn Atkinson
@ 1999-11-10  0:00 ` Ted Dennison
  1999-11-10  0:00   ` Marin Condic
                     ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ted Dennison @ 1999-11-10  0:00 UTC (permalink / raw)


In article <19991110154624.8876.rocketmail@web210.mail.yahoo.com>,
  comp.lang.ada@ada.eu.org wrote:
> Does anyone know what do the following pragmas do?
>
> 1. Pragma Comment
> I see it inside some code, and it compiles fine,
> but it appears nowhere else thereafter.
> So I wonder, if its just a line inside the source,
> why dont I just have a comment line -- to begin with?

The language defines no such pragma. Consult your compiler documentation
to see what they do with it. Since unrecognized pragmas are ignored, its
quite possible that this is just someone's gooberish way of commenting
their code. If so, please do change it to a *real* comment.

> 2. Pragma Elaborate
The LRM goes over this in detail. (
http://www.adahome.com/rm95/rm9x-10-02-01.html ) Is there something
about the definition you are having trouble with?


> I see it in some package specifications(Ada designers
> goofed up when they didnt include the word SPEC in
> a specification package, but they did inlcude the word
> BODY in the package body - but thats another story),
> but if I remove it, then everything compiles just as well.
> So far it doesnt matter if its there or not...

Hmmm. I detect a Modula bias here. :-)   Personally I like the fact that
we don't have to spell out "specification", as my spelling is horrible.
Even I have trouble misspelling "body".


--
T.E.D.


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: Pragma Comment -- What does it do?
  1999-11-10  0:00 ` Ted Dennison
@ 1999-11-10  0:00   ` Marin Condic
  1999-11-11  0:00     ` Ted Dennison
  1999-11-10  0:00   ` Tucker Taft
  1999-11-11  0:00   ` Robert Dewar
  2 siblings, 1 reply; 7+ messages in thread
From: Marin Condic @ 1999-11-10  0:00 UTC (permalink / raw)


Ted Dennison wrote:

> In article <19991110154624.8876.rocketmail@web210.mail.yahoo.com>,
>   comp.lang.ada@ada.eu.org wrote:
> > Does anyone know what do the following pragmas do?
> >
> > 1. Pragma Comment
> > I see it inside some code, and it compiles fine,
> > but it appears nowhere else thereafter.
> > So I wonder, if its just a line inside the source,
> > why dont I just have a comment line -- to begin with?
>
> The language defines no such pragma. Consult your compiler documentation
> to see what they do with it. Since unrecognized pragmas are ignored, its
> quite possible that this is just someone's gooberish way of commenting
> their code. If so, please do change it to a *real* comment.

Here's a guess: Some compilers provide the ability to get character data
embedded into the ROMable part of the code. For practical purposes, this is
a "comment". The idea is that you may want to embed module information,
version numberings, copyright notices ("When you care enough to steal the
very best!") or other information that may ride along with the ROM image. It
sounds like a "pragma Comment" might be doing this job.

You are quite correct, of course, observing that it is not a standard
pragma, so if MaryAnn Atkinson posts the compiler brand and version, maybe
we can be of more help.

MDC
--
Marin David Condic
If you hurry you can, for a short time only, still find me at:
Real Time & Embedded Systems, Propulsion Systems Analysis
United Technologies, Pratt & Whitney, Large Military Engines
M/S 731-95, P.O.B. 109600, West Palm Beach, FL, 33410-9600
***To reply, remove "bogon" from the domain name.***

Visit my web page at: http://www.mcondic.com/






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

* Re: Pragma Comment -- What does it do?
  1999-11-10  0:00 ` Ted Dennison
  1999-11-10  0:00   ` Marin Condic
@ 1999-11-10  0:00   ` Tucker Taft
  1999-11-11  0:00   ` Robert Dewar
  2 siblings, 0 replies; 7+ messages in thread
From: Tucker Taft @ 1999-11-10  0:00 UTC (permalink / raw)


Ted Dennison wrote:
> 
> In article <19991110154624.8876.rocketmail@web210.mail.yahoo.com>,
>   comp.lang.ada@ada.eu.org wrote:
> > Does anyone know what do the following pragmas do?
> >
> > 1. Pragma Comment
> > I see it inside some code, and it compiles fine,
> > but it appears nowhere else thereafter.
> > So I wonder, if its just a line inside the source,
> > why dont I just have a comment line -- to begin with?
> 
> The language defines no such pragma. Consult your compiler documentation
> to see what they do with it. Since unrecognized pragmas are ignored, its
> quite possible that this is just someone's gooberish way of commenting
> their code. If so, please do change it to a *real* comment.

On some implementations, this has the effect of embedding the
comment in the generated code (e.g. as a static initialized string),
which is sometimes useful for a copyright message, or a revision number
indicator.  Unix programs like "strings" and "what" can be used to
view these messages.

> T.E.D.

-- 
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




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

* Pragma Comment  -- What does it do?
@ 1999-11-10  0:00 MaryAnn Atkinson
  1999-11-10  0:00 ` Ted Dennison
  0 siblings, 1 reply; 7+ messages in thread
From: MaryAnn Atkinson @ 1999-11-10  0:00 UTC (permalink / raw)
  To: comp.lang.ada

Does anyone know what do the following pragmas do?

1. Pragma Comment
I see it inside some code, and it compiles fine, 
but it appears nowhere else thereafter. 
So I wonder, if its just a line inside the source, 
why dont I just have a comment line -- to begin with?


2. Pragma Elaborate
I see it in some package specifications(Ada designers
goofed up when they didnt include the word SPEC in 
a specification package, but they did inlcude the word
BODY in the package body - but thats another story), 
but if I remove it, then everything compiles just as well.
So far it doesnt matter if its there or not...

I am a rather experienced programmer, but also semi-new
to Ada, so please forgive any boring/dumb questions.

Thanks, 
MAA
maryann_30@yahoo.com

P.S. If someone replies, could you please cc: me as well?

=====

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com







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

* Re: Pragma Comment -- What does it do?
  1999-11-10  0:00 ` Ted Dennison
  1999-11-10  0:00   ` Marin Condic
  1999-11-10  0:00   ` Tucker Taft
@ 1999-11-11  0:00   ` Robert Dewar
  2 siblings, 0 replies; 7+ messages in thread
From: Robert Dewar @ 1999-11-11  0:00 UTC (permalink / raw)


In article <80ck2v$deq$1@nnrp1.deja.com>,
  Ted Dennison <dennison@telepath.com> wrote:
> The language defines no such pragma. Consult your compiler
> documentation to see what they do with it. Since unrecognized
> pragmas are ignored, its quite possible that this is just
> someone's gooberish way of commenting their code. If so,
> please do change it to a *real* comment.

Please don't. Ted may not be aware of this pragma, but it is
standard in DEC Ada, and therefore also included in GNAT. It
is similar in effect to pragma Ident, and provides module
identification information.

>
> > 2. Pragma Elaborate
> The LRM goes over this in detail. (
> http://www.adahome.com/rm95/rm9x-10-02-01.html ) Is there
something
> about the definition you are having trouble with?

What I would suggest here is reading the section in the GNAT
users guide on elaboration, this is much more extensive than
anything you will find in the RM.


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: Pragma Comment -- What does it do?
  1999-11-10  0:00   ` Marin Condic
@ 1999-11-11  0:00     ` Ted Dennison
  1999-11-12  0:00       ` Robert Dewar
  0 siblings, 1 reply; 7+ messages in thread
From: Ted Dennison @ 1999-11-11  0:00 UTC (permalink / raw)


In article <3829E70A.FEC8915B@pwfl.com>,
  condicma@pwflcom wrote:
> Ted Dennison wrote:
>
> > In article <19991110154624.8876.rocketmail@web210.mail.yahoo.com>,
> >   comp.lang.ada@ada.eu.org wrote:
> > > 1. Pragma Comment
> >
> > The language defines no such pragma. Consult your compiler
> > documentation to see what they do with it. Since unrecognized
> Here's a guess: Some compilers provide the ability to get character
> data embedded into the ROMable part of the code. For practical
> purposes, this is a "comment". The idea is that you may want to embed
> module information, version numberings, copyright notices ("When you
> care enough to steal the very best!") or other information that may
> ride along with the ROM image. It sounds like a "pragma Comment" might
> be doing this job.

Hmmm...clever. I suppose just putting that info in an unused string
might not do the job, as the string is liable to get optimized away.

--
T.E.D.


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: Pragma Comment -- What does it do?
  1999-11-11  0:00     ` Ted Dennison
@ 1999-11-12  0:00       ` Robert Dewar
  0 siblings, 0 replies; 7+ messages in thread
From: Robert Dewar @ 1999-11-12  0:00 UTC (permalink / raw)


In article <80ejip$q9t$1@nnrp1.deja.com>,
  Ted Dennison <dennison@telepath.com> wrote:
> Hmmm...clever. I suppose just putting that info in an unused
> string might not do the job, as the string is liable to get
> optimized away.


Yes that's one reason, but another is that in many object
formats there is a distinguished capability for providing module
description strings of this kind (e.g. in VMS), and the pragma
Ident or pragma Comment links to this capability. For example,
if you run GNAT on VMS, you will find that the executable is
tagged in this manner with the version number, and there are
various tools in this environment that take advantage of this.

Yes, in the lowest common denominator case, all this pragma
does is put the string in the file somewhere, but in many
cases, it does more than that.

Robert Dewar
Ada Core Technologies


Sent via Deja.com http://www.deja.com/
Before you buy.




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

end of thread, other threads:[~1999-11-12  0:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-10  0:00 Pragma Comment -- What does it do? MaryAnn Atkinson
1999-11-10  0:00 ` Ted Dennison
1999-11-10  0:00   ` Marin Condic
1999-11-11  0:00     ` Ted Dennison
1999-11-12  0:00       ` Robert Dewar
1999-11-10  0:00   ` Tucker Taft
1999-11-11  0:00   ` Robert Dewar

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