Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54385 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5848 invoked from network); 4 Aug 2011 20:34:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Aug 2011 20:34:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=jezz.g@officechristmas.co.uk; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=jezz.g@officechristmas.co.uk; sender-id=pass Received-SPF: pass (pb1.pair.com: domain officechristmas.co.uk designates 188.39.46.83 as permitted sender) X-PHP-List-Original-Sender: jezz.g@officechristmas.co.uk X-Host-Fingerprint: 188.39.46.83 mail.eclipsehq.co.uk Received: from [188.39.46.83] ([188.39.46.83:50382] helo=mail.eclipsehq.co.uk) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 79/62-24235-3420B3E4 for ; Thu, 04 Aug 2011 16:34:12 -0400 Received: from [188.220.21.188] (helo=[192.168.1.66]) by mail.eclipsehq.co.uk with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.74 (FreeBSD)) (envelope-from ) id 1Qp4cq-000FGn-QG for internals@lists.php.net; Thu, 04 Aug 2011 20:34:42 +0000 Message-ID: <4E3B0271.6070801@officechristmas.co.uk> Date: Thu, 04 Aug 2011 21:34:57 +0100 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: internals@lists.php.net References: <4E3AF896.2090106@officechristmas.co.uk> <4E3AFF27.4050501@googlemail.com> In-Reply-To: <4E3AFF27.4050501@googlemail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.9 X-SA-Exim-Connect-IP: 188.220.21.188 X-SA-Exim-Mail-From: jezz.g@officechristmas.co.uk X-SA-Exim-Scanned: No (on mail.eclipsehq.co.uk); SAEximRunCond expanded to false X-Authenticated-Sender: jezz.g X-Complaints: abuse@eclipsehq.co.uk X-Abuse: abuse@eclipsehq.co.uk (Please include full headers in abuse reports) Subject: Re: [PHP-DEV] Re: An implementation of a short syntax for closures From: jezz.g@officechristmas.co.uk (Jezz Goodwin) In terms of thinking about typos, I'm sure there would be a solution to making pretty robust short hand lambdas. I think a more valid discussion would be whether PHP should have a short hand lamda notation. A lot of talk on here is against there even being a short-hand version, whatever syntax it is. I'm really trying to continue the discussion in to coming up with a good syntax everyone likes. If there is a good syntax maybe people against the idea might change their opinion. Personally I think it would be a good addition to the language. As other people have pointed out, a lot of common languages have a syntax for short hand lambdas. Also with the popularity of technologies such as LinQ increasing, I can see small lambdas becoming more and more common. In regards to typos, I don't think the following bit of code would be too easy to put a typo in to?: // Mapping: $a->select( :($x)=> $x->getName() ); On 04/08/2011 21:20, Sebastian Krebs wrote: > Just two examples, why I think, this is a not a good idea. Simple > typos can produce hard to track errors. Its just confusing > > $x = 4; > $y = ($x);{ > return $x*2; > } > > > // and > > $x = 4; > $x = ($x) > { > $y = $x*2; > } > > >