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