home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / perl / 6880 < prev    next >
Encoding:
Internet Message Format  |  1992-11-08  |  989 b 

  1. Path: sparky!uunet!ukma!wupost!usc!news!netlabs!lwall
  2. From: lwall@netlabs.com (Larry Wall)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: A Constant Puzzlement
  5. Message-ID: <1992Nov7.003134.25839@netlabs.com>
  6. Date: 7 Nov 92 00:31:34 GMT
  7. References: <73423@apple.Apple.COM>
  8. Sender: news@netlabs.com
  9. Organization: NetLabs, Inc.
  10. Lines: 12
  11. Nntp-Posting-Host: scalpel.netlabs.com
  12.  
  13. The "real" answer, as some have surmised, is that cpp macros are
  14. evaluated when interpolated, and not when defined, which amounts to a
  15. crude form of forward reference.  This corresponds more closely to the
  16. semantics of subroutines than it does to variable assignment.  (If the
  17. efficiency of the subroutines is a problem, you can always poke the
  18. value into a variable up near the top of the program.)
  19.  
  20. Someone said that doing it this way makes h2ph easier.  In actual fact,
  21. it makes it possible.  Divining the consecution of cpp directives without
  22. actually evaluating them in situ is an exercise in undecidability.
  23.  
  24. Larry
  25.