Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88399 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8002 invoked from network); 22 Sep 2015 08:25:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Sep 2015 08:25:51 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.213.44 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.213.44 mail-vk0-f44.google.com Received: from [209.85.213.44] ([209.85.213.44:34873] helo=mail-vk0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 32/76-56639-D8011065 for ; Tue, 22 Sep 2015 04:25:50 -0400 Received: by vkao3 with SMTP id o3so1565527vka.2 for ; Tue, 22 Sep 2015 01:25:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=611KBxvF9YcDSMgXSumshUzPc8r1onH9EMGbVhqH5lI=; b=LkkJHdpuzxm1kuqLj1jNSRRe3Mx0Ee933yba7FBotqtkW9k72yDvM8LzMTwxLanfti GHufd8vwLEYobwRtiKAAf9q0wGKGdrWsBds4eoS8hyZjPmn/ZO0kK0Wq45c7xkWcS29u zLKG7bVciVJFUc5CWUaoAuhpnG8dJGlVdUAL1KJHu5lbEjSUL5GOpb+uLVEmgXr2LAAF eslTs6KPgZ+GziYgORSMra2EwHQ2BFOOhCKL0Huu4/Us7ngRReeGznvLZ+mx2Ij3xcb4 st1raJokQ79d2nmTXns8WKVQ7c7HQuTzbMDLT6AHHsNncaF+MufBeD30ZNni+H6Ri2h9 A+tQ== X-Gm-Message-State: ALoCoQkJygjgMQiJOeXqomC3nykmh0TaJsf37gQzwENkMfqKFRS1LB9oLUtadCo/u51lHCM94OJ4qPrDEvek2vEalhEXJEuJdtU+cGr6en5MlKbSdeGjmim/LXUfCeHE5ttCxeZwEGRlozDcC/42f095OX2cEb/YL4tKWquqqAaMYdhOvsb8PcY= MIME-Version: 1.0 X-Received: by 10.31.158.205 with SMTP id h196mr16834650vke.11.1442910346455; Tue, 22 Sep 2015 01:25:46 -0700 (PDT) Received: by 10.103.24.5 with HTTP; Tue, 22 Sep 2015 01:25:46 -0700 (PDT) In-Reply-To: References: Date: Tue, 22 Sep 2015 11:25:46 +0300 Message-ID: To: Bob Weinand Cc: PHP internals Content-Type: multipart/alternative; boundary=001a11415a8ea4c6f8052051be2d Subject: Re: [PHP-DEV] [RFC] [VOTE] Short Closures From: dmitry@zend.com (Dmitry Stogov) --001a11415a8ea4c6f8052051be2d Content-Type: text/plain; charset=UTF-8 I'm against the magic - "automatically use () all of the (compiled) variables". I'm also against compound short closures with curly brackets. in my opinion they opens too many ambiguous questions. function foo() { (($x) ~> {$y = 3; return $y + $x;})(5); return $y; } also think about nested closures and use of variables from not direct enclosure. I'm not sure if we need all "functional programming" features in PHP, but if we introduce them, lets do it consistently with the existing language. I think, this proposal can't be approved without support for type hinting. Thanks. Dmitry. On Tue, Sep 22, 2015 at 4:59 AM, Bob Weinand wrote: > Hey, > > Thanks for all your feedback in the discussion thread! > > So, before I start the vote, just two quick notes: > I've added two notes about the statement syntax and the single variable > use. > Though a few people complained, I'm not switching to the ==> operator, as > I noticed many people expected typehints to work (they don't due to parser > limitations) when they compared to Hack's short Closures. It also allows us > to differ syntax-wise [e.g. for typehints] from Hack without causing any > confusion later. Which should be the smartest choice: Avoid conflicts. (If > anyone strongly feels against that, he may vote no, but I would like to not > bikeshed that in this Vote thread, but leave it free for eventual actual > issues.) > > Now, the link to the RFC about Short Closures: > https://wiki.php.net/rfc/short_closures > or straight ahead to the vote: > https://wiki.php.net/rfc/short_closures#vote > > Thanks, > Bob > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a11415a8ea4c6f8052051be2d--