Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34110 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32238 invoked by uid 1010); 19 Dec 2007 23:28:32 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 32221 invoked from network); 19 Dec 2007 23:28:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Dec 2007 23:28:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=troelskn@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=troelskn@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.198.185 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: troelskn@gmail.com X-Host-Fingerprint: 209.85.198.185 rv-out-0910.google.com Received: from [209.85.198.185] ([209.85.198.185:43634] helo=rv-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2E/A0-26627-E19A9674 for ; Wed, 19 Dec 2007 18:28:32 -0500 Received: by rv-out-0910.google.com with SMTP id k15so2762722rvb.23 for ; Wed, 19 Dec 2007 15:28:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=hBnGOtmrPjexr1AoqR1t8yNu4E+YMeGGOatGAXws5Zw=; b=i6afmluzxooBq6E5PYLKOe+MlW5m0stCWYNR0lfvzQTHzGCFcVWedeBx9no0mxziJ6q9ddOOgWhyHFxMaw6xszyVXWz2Q4/HEx36Vut0neLR7L6f164T4TcauUrQgOoZ1PI87YMFrXydf+IR8MncS8J5LHe32w2fsatetg7TqFA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Z4sLneg44hthMmNNUI2w7B8vUpYeEPBHuBd3JQdG06VBRZeUI8+ycIMoj2bldIPA5OQyEpGGYH62uNe2vxdC3UIyr8UhEFv1io8AsYYZyfTrDub8r3exbcdjqH87SiT1sooa2B0yc1OrdKdIHuJ6286gnTiM4PaXE6rfz0HduGU= Received: by 10.140.173.15 with SMTP id v15mr6354819rve.218.1198106907944; Wed, 19 Dec 2007 15:28:27 -0800 (PST) Received: by 10.141.50.16 with HTTP; Wed, 19 Dec 2007 15:28:27 -0800 (PST) Message-ID: <98b8086f0712191528n2fd348d0oe3da9eed20d87194@mail.gmail.com> Date: Thu, 20 Dec 2007 00:28:27 +0100 To: internals@lists.php.net In-Reply-To: <47699960.1090101@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <98b8086f0712150818n40056cedyf0aae7a5a08a27b7@mail.gmail.com> <200712172130.08216.larry@garfieldtech.com> <4FADC266-873E-4FD2-BEC8-28EA9D833297@procata.com> <200712172341.54372.larry@garfieldtech.com> <98b8086f0712191345h7fe11a7kc5d34b0369754c8f@mail.gmail.com> <47699960.1090101@zend.com> Subject: Re: [PHP-DEV] Re: PATCH: anonymous functions in PHP From: troelskn@gmail.com ("troels knak-nielsen") On Dec 19, 2007 11:21 PM, Stanislav Malyshev wrote: > > So how big a part of PHP's userbase is that? I'm guessing, it's small. > > If it's small, we don't need it in the language anyway. I think we need it. In the current incarnation, anonymous functions are so impractical to use, that it's a barrier. I think that is unfortunate, because it could be an interesting and useful direction to take for PHP. The users, who don't know what a closure is, could still learn to use anonymous functions and they would then not assume closures. So even if the user base is small initially (naturally, since the feature doesn't exist), it could grow. And for the rest of us, it's at least better than create_function(). > Having no [closure] and knowing it is better than having something that > looks like it but doesn't work. Saves time that would be spent > unsuccessfully trying to make it work. (I assume you meant closure?) It can still work, without closures. Not all anonymous functions need variable input and if they do, you can use currying. Admittedly, currying has its own practical issues in PHP, but that's a separate discussion. (And one, I'd like to take at a later time for that matter) The point is, that static lambda still has something to offer, even if it doesn't allow closures. -- troels