Re: [PHP-DEV] RFC - MACRO

2010-12-26 Thread Sean Coates
> I want to request a C/C++ feature that i think is good. > > MACRO FWIW, you could use Prep ( https://github.com/andreiz/prep ) and GPP ( http://en.nothingisreal.com/wiki/GPP ) to accomplish this. S -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php

Re: [PHP-DEV] RFC - MACRO

2010-12-26 Thread Matthew Weier O'Phinney
On 2010-12-25, Mathias Grimm wrote: > php 4 doesnt have namespace, it was just an example. > zend framework dont use namespecaes yet... and classe names get longer for > example. But that doesn't stop you from using PHP 5.3 and using class aliasing already (heck, I do this already, particularly i

Re: [PHP-DEV] RFC - MACRO

2010-12-25 Thread Mathias Grimm
You never know me. php 4 doesnt have namespace, it was just an example. zend framework dont use namespecaes yet... and classe names get longer for example. a think that macros in the framework, not in the user (programmer) space are usefull sometimes. as i sad before.. RET_IF_ERR is very clean an

Re: [PHP-DEV] RFC - MACRO

2010-12-24 Thread Nicolas A . BĂ©rard-Nault
This has been brought up countless times and has always been rejected (browse the archives if you aren't convinced). Anyhow, I just hope I never have to maintain code you write in this fashion. Pre-compilation macros are very out of character in the dynamic languages paradigm and I doubt they'd be

RE: [PHP-DEV] RFC - MACRO

2010-12-23 Thread Andi Gutmans
> -Original Message- > From: Mathias Grimm [mailto:mathiasgr...@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 > > MACRO('PF','private function _

Re: [PHP-DEV] RFC - MACRO

2010-12-22 Thread Stas Malyshev
Hi! zend engine and php internals are macro-oriented programing... Zend Engine and PHP internals is not the code you deal with every day. Especially not the PHP code you deal with. PHP is supposed to be simple to read and understand, and heavy use of macros (like ZE code does) would certain

Re: [PHP-DEV] RFC - MACRO

2010-12-22 Thread Mathias Grimm
there are particupal points to aply a macro, like $_GLOBALS,like eval... particular reasons. zend engine and php internals are macro-oriented programing... you can define a pattern(prefix,sufix,etc...) to ensure the purpose of macros, avoiding doubts.. RET_IF_ERR is a clean macro.. MACRO_1 is a

Re: [PHP-DEV] RFC - MACRO

2010-12-22 Thread Gustavo Lopes
On Thu, 23 Dec 2010 00:48:44 -, Mathias Grimm wrote: On Wed, Dec 22, 2010 at 7:47 PM, James Butler wrote: i could replace with a macro: MACRO("HND_ERR","if ($obError->hasError()) { return $obError;)") $obError = $object->fetch($params,$transaction); HND_ERR So, not only do you want

Re: [PHP-DEV] RFC - MACRO

2010-12-22 Thread Mathias Grimm
On Wed, Dec 22, 2010 at 7:47 PM, James Butler < james.but...@edigitalresearch.com> wrote: "What you are doing looks to be just slightly re-inventing the wheel for very little gain. If you are copy and pasting code 'DRY violation' then you probably need to rethink your code and/or make a new class/f

Re: [PHP-DEV] RFC - MACRO

2010-12-22 Thread Gwynne Raskind
On Dec 22, 2010, at 4:38 PM, Mathias Grimm wrote: > People always will want more, but some features are nice. > for C/C++ programmers, macro is on of the best things to make thing work > every where. > > its possible to create a IDE macro, but the native php feature will be good. > template engine

Re: [PHP-DEV] RFC - MACRO

2010-12-22 Thread Sebastian Bergmann
Am 22.12.2010 20:43, schrieb Stas Malyshev: > And then run it through CPP (gcc -Mcpp -E - - < in.php > out.php) and > get all the macros processed? That would be too easy ;-) -- Sebastian BergmannCo-Founder and Principal Consultant http://sebastian-bergmann.de/

RE: [PHP-DEV] RFC - MACRO

2010-12-22 Thread James Butler
-Original Message- > From: Mathias Grimm [mailto:mathiasgr...@gmail.com] > People always will want more, but some features are nice. > for C/C++ programmers, macro is on of the best things to make thing work > every where. > > its possible to create a IDE macro, but the native php featur

Re: [PHP-DEV] RFC - MACRO

2010-12-22 Thread Mathias Grimm
People always will want more, but some features are nice. for C/C++ programmers, macro is on of the best things to make thing work every where. its possible to create a IDE macro, but the native php feature will be good. template engines can de wrap this functionality too. is just like a variable:

Re: [PHP-DEV] RFC - MACRO

2010-12-22 Thread Scott MacVicar
I really dislike this, what about resolving orders, then people will want undef, then ifdef with conditions. The language doesn't need to introduce anything that makes it more complex to use. - Scott On 22 Dec 2010, at 11:55, Mathias Grimm wrote: > I Just want a simple replace-on-the-air to

Re: [PHP-DEV] RFC - MACRO

2010-12-22 Thread Mathias Grimm
I Just want a simple replace-on-the-air to avoid spend time writing more. On Wed, Dec 22, 2010 at 5:43 PM, Stas Malyshev wrote: > Hi! > > > I want to request a C/C++ feature that i think is good. >> >> MACRO >> > > You know that you could write: > #define PF private function > #define SCOPE_CL

Re: [PHP-DEV] RFC - MACRO

2010-12-22 Thread Stas Malyshev
Hi! I want to request a C/C++ feature that i think is good. MACRO You know that you could write: And then run it through CPP (gcc -Mcpp -E - - < in.php > out.php) and get all the macros processed? -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext

Re: [PHP-DEV] RFC - MACRO

2010-12-22 Thread Sebastian Bergmann
Am 22.12.2010 18:11, schrieb Mathias Grimm: > I want to request a C/C++ feature that i think is good. > MACRO * https://github.com/andreiz/prep (extension for the PHP interpreter) * https://github.com/theseer/preprocessor (userland implementation) -- Sebastian BergmannCo-Fo