home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / misc / 2686 < prev    next >
Encoding:
Text File  |  1992-07-21  |  1.5 KB  |  32 lines

  1. Newsgroups: comp.lang.misc
  2. Path: sparky!uunet!utcsri!torn!watserv1!watmath!thinkage!dat
  3. From: dat@thinkage.on.ca (David Adrien Tanguay)
  4. Subject: Re: Simple preprocessor
  5. Message-ID: <1992Jul21.183044.22776@thinkage.on.ca>
  6. Organization: Thinkage, Ltd.
  7. References: <1992Jul17.232621.20226@druid.uucp> <1992Jul18.170227.20219@thinkage.on.ca> <1992Jul20.172457.20496@druid.uucp>
  8. Date: Tue, 21 Jul 1992 18:30:44 GMT
  9. Lines: 21
  10.  
  11. darcy@druid.uucp (D'Arcy J.M. Cain) writes:
  12. >dat@thinkage.on.ca (David Adrien Tanguay) writes:
  13. >>darcy@druid.uucp (D'Arcy J.M. Cain) writes:
  14. >>>Macros can take arguments and defaults can be specified for the arguments.
  15. >>>    @DEFINE foo bar $(1:zap)
  16. >>>    $(foo:goo)    ==>     bar goo
  17. >>Why a separate character '$'? I.e., why not @(foo)?
  18. >
  19. >I hadn't really given it a lot of thought.  I suppose I was copying make
  20. >and shell in this regard.  However, pretending that I have given this some
  21. >thought, the answer is so that a macro used at the start of a line doesn't
  22. >get confused with a preprocessor directive.  Do you have a strong reason
  23. >why not a separate character?
  24.  
  25. Not really, just one less character to have to escape, one less variant
  26. international glyph to worry about. C may not use $, but other texts may.
  27. I infer from your reason that the '(' after the '$' is optional (in some
  28. contexts): i.e., $foo will expand the foo macro. I had thought otherwise.
  29. -- 
  30. David Tanguay       dat@Thinkage.on.ca  dat@Thinkage.com  uunet!thinkage!dat
  31. Thinkage, Ltd.           Kitchener, Ontario, Canada          [43.40N 80.47W]
  32.