PHP Macros
| From: | Jason Garber | Date: | Wed, 16 Nov 2005 01:51:52 +0000 |
| Subject: | PHP Macros | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-20047@lists.php.net to get a copy of this message | ||
Hello Internals,
Remember the ifsetor() discussion? There were many, many people for
it, and many people that did not see the point. To this day, it's
not been allowed into the source tree, and I don't see any way to
change that. So...
Please consider (some form of) this if it's possible:
define_macro square(x)
{
((x) * (x))
}
define_macro ifsetor(x, y)
{
(isset(x) ? x : y)
}
$n = square($n);
If the parser/compiler sees one of these, then it will add it to
it's list of "macros", and when it runs into the usage of one, it
will do a little token-replacing before compiling it...
Is it technically doable?
Thanks guys.
--
Best regards,
Jason Garber mailto:jason@ionzoft.com