RE: [PHP-DEV] RFC - MACRO
| From: | Andi Gutmans | Date: | Thu, 23 Dec 2010 08:06:42 +0000 |
| Subject: | RE: [PHP-DEV] RFC - MACRO | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-51131@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Mathias Grimm [mailto:mathiasgrimm@gmail.com]
> Sent: Wednesday, December 22, 2010 9:12 AM
> To: internals@lists.php.net
> Subject: [PHP-DEV] RFC - MACRO
>
> I want to request a C/C++ feature that i think is good.
>
> MACRO
>
> <?php
> MACRO('PF','private function _');
> MACRO('SCOPE_CLASS','class MyProject_');
>
> class UseMacro
> {
> PF preSave($object)
> {
> //...
> }
>
> }
>
> SCOPE_CLASS Internal
> {
>
> }
>
> I don know if there is a RFC for this feature.
Although I am a C developer and use macros I think it'd be horrible to add them to PHP (+
it's been discussed and rejected many times in the past).
Macros make it very hard for a third party person to read your code + goes directly against the
verbosity spirit we've always had in the PHP project. Forget also the fact that it creates a
lot of problems with solutions such as debuggers.
I suggest if it's something you really feel you need then implement it externally to PHP as
part of your build and deployment environment. There are a variety of templating/pre-processor
solutions out there including the C-compiler tools themselves.
Andi