Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20055 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82600 invoked by uid 1010); 16 Nov 2005 08:32:32 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 82585 invoked from network); 16 Nov 2005 08:32:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Nov 2005 08:32:32 -0000 X-Host-Fingerprint: 195.197.172.115 gw01.mail.saunalahti.fi Linux 2.4/2.6 Received: from ([195.197.172.115:35908] helo=gw01.mail.saunalahti.fi) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id CF/7D-07637-F9EEA734 for ; Wed, 16 Nov 2005 03:32:31 -0500 Received: from nest.netphobia.fi (YZDCXXXI.dsl.saunalahti.fi [85.76.35.232]) by gw01.mail.saunalahti.fi (Postfix) with ESMTP id 8DD48FF272; Wed, 16 Nov 2005 10:32:25 +0200 (EET) Received: from nest.netphobia.fi (nest.netphobia.fi [127.0.0.1]) by nest.netphobia.fi (8.13.1/8.13.1) with ESMTP id jAG8WQMK001100; Wed, 16 Nov 2005 10:32:26 +0200 Received: from localhost (jani@localhost) by nest.netphobia.fi (8.13.1/8.13.1/Submit) with ESMTP id jAG8WPa3001097; Wed, 16 Nov 2005 10:32:26 +0200 X-Authentication-Warning: nest.netphobia.fi: jani owned process doing -bs Date: Wed, 16 Nov 2005 10:32:25 +0200 (EET) Reply-To: Jani Taskinen To: Jason Garber cc: internals@lists.php.net In-Reply-To: <05311866.20051115205152@ionzoft.com> Message-ID: References: <05311866.20051115205152@ionzoft.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: Re: [PHP-DEV] PHP Macros From: sniper@iki.fi (Jani Taskinen) Once we get GOTO and the ?: operator, we don't need no stinking macros! :) --Jani On Tue, 15 Nov 2005, Jason Garber wrote: > > 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. > > -- Give me your money at @ Donating money may make me happier and friendlier for a limited period! Death to all 4 letter abbreviations starting with P!