comp.lang.ada
 help / color / mirror / Atom feed
From: hbaker@netcom.com (Henry Baker)
Subject: Re: Does Ada have macros ?
Date: Sat, 25 Mar 1995 16:10:52 GMT
Date: 1995-03-25T16:10:52+00:00	[thread overview]
Message-ID: <hbaker-2503950814380001@192.0.2.1> (raw)
In-Reply-To: D5y2J1.JAB@inmet.camb.inmet.com

In article <D5y2J1.JAB@inmet.camb.inmet.com>, mg@asp.camb.inmet.com (Mitch
Gart) wrote:

> 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.

Many implementations of 'generics' are essentially macro-expansions.

-- 
www/ftp directory:
ftp://ftp.netcom.com/pub/hb/hbaker/home.html



  reply	other threads:[~1995-03-25 16:10 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
1995-03-25 16:10   ` Henry Baker [this message]
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