From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a3176060eb5b787e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-25 08:10:52 PST Newsgroups: comp.lang.ada Path: nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!RRZ.Uni-Koeln.DE!uni-duisburg.de!zib-berlin.de!news.mathworks.com!udel!news.sprintlink.net!howland.reston.ans.net!ix.netcom.com!netcom.com!NewsWatcher!user From: hbaker@netcom.com (Henry Baker) Subject: Re: Does Ada have macros ? Message-ID: Sender: hbaker@netcom21.netcom.com Organization: nil References: <3kn413$259@newsbf02.news.aol.com> Date: Sat, 25 Mar 1995 16:10:52 GMT Date: 1995-03-25T16:10:52+00:00 List-Id: In article , 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