Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!usc!snorkelwacker!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!tcdcs!swift.cs.tcd.ie!emcmanus From: emcmanus@cs.tcd.ie (Eamonn McManus) Newsgroups: comp.lang.c Subject: Re: ANSI -> K&R translator Keywords: ANSI prototypes Message-ID: <1732@tws8.cs.tcd.ie> Date: 31 Aug 90 11:54:06 GMT References: <907@attila.WEITEK.COM> <3619@goanna.cs.rmit.oz.au> Distribution: comp Organization: Computer Science Department, Trinity College Dublin Lines: 26 peter@ficc.ferranti.com (Peter da Silva) writes: >The one problem with M4 is that it's got this annoying tendency to do >replacements that aren't intended (what happens if you have a variable >called "dnl"?). When I did a version of MACRO (m4 in Ratfor) for RSX, I >made all the builtind start with "$". Some versions of m4, System V for example, provide a builtin `defn'. The manual says: defn returns the quoted definition of its argument(s). It is useful for renaming macros, especially built-ins. Unfortunately, this is a lie. `defn' doesn't expand to anything if given a builtin as its argument. If it worked, you could rename all the m4 built-ins to begin with the string `m4' or some such. It ought to be quite easy to make defn work properly, for instance by having defn(`somebuiltin') expand to `m4builtin(something)'. Thus defn(`define') might expand to m4builtin(1), and m4builtin(1) would behave exactly like define: one could write m4builtin(1)(`foo', `bar'). Then only the word `m4builtin' would be reserved by m4. Other builtins could be renamed by a sequence like: define(`m4define', defn(`define')) undefine(`define') -- Eamonn McManus Fingers are for fuguing.