comp.lang.ada
 help / color / mirror / Atom feed
From: mg@asp.camb.inmet.com (Mitch Gart)
Subject: Re: Does Ada have macros ?
Date: Fri, 24 Mar 1995 12:25:48 GMT
Date: 1995-03-24T12:25:48+00:00	[thread overview]
Message-ID: <D5y2J1.JAB@inmet.camb.inmet.com> (raw)
In-Reply-To: 3kn413$259@newsbf02.news.aol.com

B Catlin (bcatlin@aol.com) wrote:
: I don't seem to remember Ada 83 having a macro capability, does Ada 95 ? 
: If not, why not ?

No macros, either in Ada 83 or Ada 95.  General text-substitution
macros like those in the C preprocessor are thought to be too 
unsafe.  For example, a macro can refer to a variable X and 
depending where the macro is expanded X may or may not be visible.
Ada programs are supposed to be readable and in many cases C
macros are one of the main culprits in producing unreadable C
programs.

In C macros can be used (and mis-used) in lots of ways but three legitimate
uses are for defining compile-time constants, types, and inline functions.
Ada has all three of these facilities.

	Mitch Gart



  parent reply	other threads:[~1995-03-24 12:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-03-21 17:56 Does Ada have macros ? B Catlin
1995-03-23  1:34 ` Robert Dewar
1995-03-24 12:25 ` Mitch Gart [this message]
1995-03-25 16:10   ` Henry Baker
1995-03-27  2:50     ` B Catlin
1995-03-27  9:15 ` David Arno
replies disabled

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