m4 Macro Preprocessor examples wtd

m4 Macro Preprocessor examples wtd

Post by Para » Fri, 28 Aug 1992 10:21:20



        I have been using cpp for some real ugly hacks and basically
now realize why the man pages for it state that it wasn't intended
for anything but a C pre-processor.

        Somehow I learned about the existence of the m4 macro
processor, and this looks more along the lines of what I want,
but I cannot glean a heck of a lot from its man page.

        Could any kind soul please send a short example of what
m4 can be made to do, or if there are any simple docs/refs on it,
I would appreciate those, too.  Email only, unless this would be
of general interest.

                                Thanks,
                                -russ.

--

   Founder of the People's Popular Front for Revolutionary Darwinism
                     Parade says, "Evolution NOW!"

 
 
 

m4 Macro Preprocessor examples wtd

Post by Francois Pina » Wed, 02 Sep 1992 23:34:26


   [...] but I cannot glean a heck of a lot from [m4] man page.  Could
   any kind soul please send a short example of what m4 can be made to
   do, or if there are any simple docs/refs on it [...]

Hi.  Let me suggest that you ftp GNU m4 from prep.ai.mit.edu, in the
pub/gnu directory, as file m4-1.0.tar.Z.  The documentation is in
Texinfo format, the Info files should be quite readable with any
editor, or printed as is.

Also, if you feel like looking at bigger/hairier examples (and are
familiar with Bourne shell programming), you can take a look at files
acgeneral.m4 and acspecific.m4 from the GNU Autoconf documentation,
which you might get as file autoconf-1.1.tar.Z from the same place.
--

(514) 588-4656                                    ...!uunet!iros1!pinard
Consider joining the League for Programming Freedom.  Email for details!

 
 
 

1. question about m4 - macro preprocessor

i am using the macro preprocessor m4 with files that are
subsequently passed to troff. m4 replaces lines that
contain m4 commands with blank lines. the blank lines
disrupt the text that is passed to troff. does anyone know
how to run m4 so that the blank lines can be eliminated?

Carl R. Crawford, Ph.D.    Voice: 414-521-6572
GE Medical Systems         Fax: 414-521-6575
P.O. Box 414, W-875        Uucp: {sun!sunbird,uunet!crdgw1}!gemed!carl

2. (csh) sed question

3. M4 Preprocessor

4. Mounting printer and modem

5. Problem with m4 preprocessor

6. netcfg & permission to any user

7. How to get hostname into preprocessor macro?

8. Widgets with Linux?

9. tag files for preprocessor macros?

10. C++-preprocessor Question (0 or more paramters in macro)

11. Gnu m4 Macro for enum lookalike?

12. Using M4 macros to setup masquerade and smart host newer Sunboxes

13. m4 macro processor again