C macros (was comma operator: keep away?)

David Dyer-Bennet ddb at ns.network.com
Fri Apr 28 07:35:00 AEST 1989


In article <17109 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:
:In article <1317 at ns.network.com> ddb at ns.network.com (David Dyer-Bennet) writes:
:>(one of the most light-weight macro facilities I've ever had foisted
:>on me).  Without taking a position on the general value of the comma
:>operator -- the correct solution to this one is to improve the macro
:>facility, not provide a way to kludge some (but not all) cases.
:
:C's macro preprocessor is intended to be weak.  Fancier macro expanders
:(such as m4) are available (although their syntaxes often clash with C's,
:and/or with each other's).  What is missing from C (for operations like
:getchar and putchar) is not better macros, but rather inline functions.

Yes, the correct / better solution to that particular problem is inline
functions.  I let myself follow a bad example down a dead end.  I still
think a "real" macro facility is important / very useful in and of itself,
for various things particularly including static table initialization.
(I got exposed to powerful macros in dec's MACRO-10/20, then BLISS.  Even
the stuff in MASM for a pc is pretty useful (and looks remarkably like
macro 10/20).)

-- 
David Dyer-Bennet, ddb at terrabit.fidonet.org, or ddb at ns.network.com
or ddb at Lynx.MN.Org, ...{amdahl,hpda}!bungia!viper!ddb
or ...!{rutgers!dayton | amdahl!ems | uunet!rosevax}!umn-cs!ns!ddb
or Fidonet 1:282/341.0, (612) 721-8967 9600hst/2400/1200/300



More information about the Comp.lang.c mailing list