Page 1 of 1

I wish PHP supported...

Posted: Mon Mar 27, 2006 8:46 pm
by alex.barylski
C style pre-processor macros...

I have encountered an instance where, although using functions works, it's a messy couple of lines needed in alot of functions...and I cannot normalize the code any further using a single function...

It really sucks...and it's not nessecary for anyone to see the details of whats happening just to know it's there would be awesome...but instead of a single nice little macro which expands into my ad hoc hack, I have to use functions...

Bummer :(

Posted: Mon Mar 27, 2006 9:22 pm
by feyd
yes, I'd love macros. The only thing I can think of is doing a substitution on code loaded in, afterward running through eval() .. but that feels like a messy hack. :?

Posted: Mon Mar 27, 2006 11:42 pm
by Buddha443556
yes, I'd love macros. The only thing I can think of is doing a substitution on code loaded in, afterward running through eval() .. but that feels like a messy hack.
Does sound messy if your think of doing that on the production server but no reason you couldn't add it to the build/deployment process, is there?

Posted: Mon Mar 27, 2006 11:53 pm
by feyd
true, one could do a pass with dumping to final baking of files for FTP.. still feels a tad bit messy though. But not so much after baking.

Posted: Tue Mar 28, 2006 12:12 am
by Buddha443556
feyd wrote:true, one could do a pass with dumping to final baking of files for FTP.. still feels a tad bit messy though. But not so much after baking.
Been baking my files for a while but I use Perl as the preprocessing language. Can do just about anything the C preprocessor does.