Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Does Ada have macros?

ADA macros
0
10 Posted

Does Ada have macros?

0

No, neither Ada 83 nor Ada 95 do. There was a Steelman requirement that the language developed NOT have a macro capability. This was a well thought-out requirement. What you see in a piece of Ada code is what you get (within a debugger for example). This does not hold true for macro languages. 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 the main culprits in producing unreadable C programs. Compile time macro facilities tend to be dreadfully over- and misused, resulting in horrible maintenance problems. Furthermore, there is a tendency to use macros to patch up glaring omissions in the language. For example, C has no named constants, a very bad omission, but #define is used to patch over this gap. In C, three “legitimate” uses of macros are for defi

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123