Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51123 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59904 invoked from network); 22 Dec 2010 21:38:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Dec 2010 21:38:15 -0000 Authentication-Results: pb1.pair.com header.from=mathiasgrimm@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=mathiasgrimm@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: mathiasgrimm@gmail.com X-Host-Fingerprint: 209.85.216.42 mail-qw0-f42.google.com Received: from [209.85.216.42] ([209.85.216.42:35618] helo=mail-qw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B4/00-59570-5CF621D4 for ; Wed, 22 Dec 2010 16:38:14 -0500 Received: by qwj8 with SMTP id 8so5573023qwj.29 for ; Wed, 22 Dec 2010 13:38:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=BiUywr9jV90AL4NoWKw/eN/hMYGSs7VO/admAr/Feho=; b=Yd6aA78rHJAwf3Vdcw9e30YXMN1Vtpaqr6nLDW7os1gqslAvn5J7gWGwvf/Q/H3IPa 4sQvWQr+7qUTAUvBA8492GvsTttnD0uZWRVIKiRz2+Z1r/s2z1Dcq4MFL0t7m9wmjeBC 797UabKpkNI0gNwGmoPlVX8Ev117E60tEsIbE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=RCtuiKIXCAQTjiPerMmYpxzhD0UQuaX7OzCfSoYrOayNo+s79KOSaG5LCgZNh0jUup 2wJRXhlA4qv+BWj/yhAhu1eh2r2XRLvpouNXw3hpL82nIbIYxucCeY5G9T7JiiWady5Y 6cGRmfQ+pjfw4BmwPzKZoN9nmkCJkIAbtPfU0= MIME-Version: 1.0 Received: by 10.224.28.196 with SMTP id n4mr472463qac.143.1293053891673; Wed, 22 Dec 2010 13:38:11 -0800 (PST) Received: by 10.220.172.132 with HTTP; Wed, 22 Dec 2010 13:38:11 -0800 (PST) In-Reply-To: References: <4D1254DF.9050704@sugarcrm.com> Date: Wed, 22 Dec 2010 19:38:11 -0200 Message-ID: To: Scott MacVicar Cc: Stas Malyshev , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=0015175ce0cce380fb0498069160 Subject: Re: [PHP-DEV] RFC - MACRO From: mathiasgrimm@gmail.com (Mathias Grimm) --0015175ce0cce380fb0498069160 Content-Type: text/plain; charset=ISO-8859-1 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: $method = $_GET['m']; $control = $_GET['c']; $c = new $control; $c->$method(); like a macro.. program is make thing dynamic. while($object = $iterator->next()) { } macro("ITER","while($object = $iterator->next())") ITER($iterator) { $object->save(); } On Wed, Dec 22, 2010 at 7:08 PM, Scott MacVicar wrote: > 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 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_CLASS(x) class MyProject_ ## x > >> > >> > >> class UseMacro > >> { > >> PF preSave($object) > >> { > >> //... > >> } > >> > >> } > >> > >> SCOPE_CLASS(Internal) > >> { > >> > >> } > >> > >> 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. 227 > >> > --0015175ce0cce380fb0498069160--