home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / misc / 4272 < prev    next >
Encoding:
Text File  |  1992-11-20  |  5.5 KB  |  118 lines

  1. Newsgroups: comp.unix.misc
  2. Path: sparky!uunet!paladin.american.edu!europa.asd.contel.com!darwin.sura.net!cs.ucf.edu!crigler
  3. From: crigler@cs.ucf.edu (James Crigler)
  4. Subject: m4 - pseudo-survey summary
  5. Message-ID: <crigler.722288449@eola.cs.ucf.edu>
  6. Summary: Replies to my request
  7. Keywords: m4,macro,preprocessor
  8. Sender: news@cs.ucf.edu (News system)
  9. Organization: University of Central Florida
  10. Distribution: comp.unix.misc
  11. Date: Fri, 20 Nov 1992 19:40:49 GMT
  12. Lines: 104
  13.  
  14.  
  15. Finally, I am posting a summary of replies to my inquiry about the
  16. use of m4.  Many thanks for the replies.  And for the patience of
  17. those who have waited with bated breath.  And bait breath.
  18.  
  19. My original question was this:
  20.  
  21. >Is m4 really used for anything,
  22. >or is it just a curiosity?
  23. ------------------------------------------------------------
  24. From the keyboard of David Barr <barr@pop.psu.edu>:
  25. I use it.  It's used as a preprocessor for tvtwm, a window manager for
  26. X11R5.  I also use it as a preprocessor for my automount maps for NIS.
  27. It's quite handy, actually.
  28.  
  29. ------------------------------------------------------------
  30. From the keyboard of Mike Oliver <moliver@shadow.eng.pyramid.com>:
  31. I use `m4' to preprocess 68K assembler files; this is in lieu of a
  32. decent macro facility in this assembler.  The C preprocessor won't cut
  33. it in this case because it doesn't preserve line breaks.
  34.  
  35. ------------------------------------------------------------
  36. From the keyboard of Peter J Dohm <dohm@magnus.acs.ohio-state.edu>:
  37. Yes, actually, tvtwm (Tom's Virtual Tab Window Manager) for X11 does
  38. optionally use m4 for it's .twmrc parsing/macro expanding...  I find their
  39. use of m4 to be basically pointless, but that's the way they chose to expand
  40. any macros.  it's not really expanding macros, but just defining standard
  41. things in the .twmrc with m4. seems like overkill, but it may have been easier
  42. than writing the code to do this.  heck, i'm sure it had to have *some* merit
  43. ;) 
  44.  
  45. ------------------------------------------------------------
  46. From the keyboard of Michael Haardt <michael@gandalf.moria>:
  47. I use it to generate machine dependent makefiles from one general source
  48. and as macroprocessor for my transputer assembler.  I love it since good
  49. old Minix times, cpp is too poor in its capabilities and I am curious
  50. about m5, which I ftp'ed today.
  51.  
  52. [Editor's note:  m5 is available on thor.ece.uc.edu in /pub/dain/m5 -- JBC]
  53.  
  54. ------------------------------------------------------------
  55. From the keyboard of Mischa Sandberg <Mischa_Sandberg@mindlink.bc.ca>:
  56. Yes, we use m4 as a precompiler for SQL (we use nawk as a report generator
  57. and for more complicated symbolic manipulation of SQL). It's useful for
  58. extending the standard set of in-line functions of Sybase transact/sql,
  59. with equivalent but gross expressions; for example, to return a numeric
  60. result MAX(COL1, COL2) --- the larger numeric value of two columns ---
  61. can be done with the expression (abs(COL1-COL2)+COL1+COL2)/2); so we
  62. define(`MAXOF', `...'). The only problem we've had so far has been working
  63. around the reserved word "index", which is also an M4 intrinsic function.
  64.  
  65. ------------------------------------------------------------
  66. From the keyboard of Andrew D Hay <adh@petrel.att.com>:
  67. i _did_, quite heavily.  m4 is/was the programming language of an
  68. internal automated test tool called FAST (facility for automated
  69. system test).  oddly, fast was pretty slow...
  70.  
  71. i think the at&t cpp is written in m4.
  72.  
  73. ------------------------------------------------------------
  74. From the keyboard of Kevin Walsh <kev@dsbc.icl.co.uk>:
  75. I was lurking about the news when I came across your message.  I don't
  76. normally read this group as it is a long way down my active list.  That's
  77. my excuse and I'm sticking to it :-)
  78.  
  79. In answer to your question, the m4 processor isn't widely used these days.
  80. It used to be used as part of the assembler.  I beleive the cpp pre-processor
  81. used to use it and it was probably used before cpp was around.  (but that
  82. was before _I_ was around so I don't really know about that :-)
  83.  
  84. I can only find one actual current use for m4 and that is to process the
  85. sendmail configuration files (like sendmail.m4 -> sendmail.cf).  Even that
  86. has other utilities scrambling for a bit of the action (like the ease
  87. language).
  88.  
  89. ------------------------------------------------------------
  90. From the keyboard of William Pietri <William.Pietri@umich.edu>:
  91. I love m4; I've created a bunch of macro files for all my common
  92. configuration files (like /etc/rc, /etc/ttys, and basically every file
  93. in /etc that might get changed).  A couple of scripts will feed these
  94. macro files to m4 with the the right things defined, and I will get the
  95. proper rc.local (or whatever) for a given machine.
  96.  
  97. The win is that when I want to change some configuration detail for all
  98. my workstations, I change one file and run one command (say, 'iinstall
  99. /etc/inetd.conf ALL') instead of editing files on all the workstations.
  100.  
  101. ------------------------------------------------------------
  102. From the keyboard of Richard Brooksby <richard@harlqn.co.uk>:
  103. I use m4 for two main purposes:
  104.  
  105.  1.  My .Xresources, .twmrc, and other X setup files are generated by
  106.      m4 programs because they need to share information about which
  107.      fonts, colours, and so forth to use.  The m4 programs also take
  108.      care of different settings on different machines.  This allows me
  109.      to maintain a central database.
  110.  
  111.  2.  I use m4 in our project for preprocessing assembly-language
  112.      sources.
  113.  
  114. =========================================================================
  115. Jim Crigler
  116. crigler@eola.cs.ucf.edu
  117. Guinan is Q's mother.
  118.