Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105146 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 44246 invoked from network); 8 Apr 2019 17:10:29 -0000 Received: from unknown (HELO mail-it1-f175.google.com) (209.85.166.175) by pb1.pair.com with SMTP; 8 Apr 2019 17:10:29 -0000 Received: by mail-it1-f175.google.com with SMTP id a190so20846756ite.4 for ; Mon, 08 Apr 2019 07:07:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=PdKmf5pl/tKWnfd8Ftr4OZ7YTEd0SN6X+S3lFbn4uSU=; b=RYDmrnre9kpYd762RBqMbP8K0OqpmAocrdqTpBpGEx9uRjNdMKPJAY5Rd/Y0NemZcV zghaN9PSJdAfZuLaJnvMc4AIs4IWEfExRjeNf7u5N/Xg6SRElWk0wK8bUpNMSqKHsAHL 3Nr0Amb7VHzXECacqLtuuHe9SoLZ8q+gt+yzqJ5+716lFlDikqQ74O3T0jrJtW79GpEq 72HMnQe957P1MxtXbjRY9V8m0gCeJJVZveM2FKT5yR57X1YGrUUD1jhkgBNjD4RlarP5 OWDPGdTiyECOI9xZZvXFkwI8yIrLth9mYI/iPLOTqYRo3ofXsYzuWH3BoSf4AXOmCdsH ARFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=PdKmf5pl/tKWnfd8Ftr4OZ7YTEd0SN6X+S3lFbn4uSU=; b=Eoo4brz29BnuKjWVVhpgKWI3wHIJ+w50paPRJzALLChihEWtBMy1MMRpey8yQBtlWA RK5jRUYueR33e7jDYlELBpIex7h5jP60stFIdfwhWbu/E5gYwxG6ZO7S1LUKZrPQw1qF i6w1TinLCvzUQduDWoImRKPQ+HTs+4kF0Ke+RHUEvqg3iKLSfd3D7cVuYMbzhxbXerbx s2DoSFKk23hmmnfdiZs6Wa4VVD5Y44fZLbeci/RT/DNSuwEM2WQl75qRfqLqlSx808qF fXWzfLZH+VBat7Ybr1bNHaPpefNdM17dTFq6F4G5+/GuW6KuXiOwDlY1glAn1ce6nxnb FDsw== X-Gm-Message-State: APjAAAVmj/63C7KLYSs4rEHrZwYAh5I96GK/JF2kT/VwyLxDMcETe7g/ K2w5yVM5JV5jOY0Y0BDc2R0SGBLk4/n2J6nyynesdaON2w8/MA== X-Google-Smtp-Source: APXvYqxSyz45EGjDkPPZOATExyBqG6rlwcsbS0RY6i3lzk8bctx31NGwv/jT4LMeZ/ZSIthbvWAIFhj7UddDGC830fI= X-Received: by 2002:a24:3945:: with SMTP id l66mr13494053ita.125.1554732428017; Mon, 08 Apr 2019 07:07:08 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 8 Apr 2019 16:06:51 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="00000000000017c3890586055ae2" Subject: Re: [RFC] Arrow functions / short closures From: nikita.ppv@gmail.com (Nikita Popov) --00000000000017c3890586055ae2 Content-Type: text/plain; charset="UTF-8" On Wed, Mar 13, 2019 at 4:56 PM Nikita Popov wrote: > Hi internals, > > Motivated by the recent list comprehensions RFC, I think it's time we took > another look at short closures: > > https://wiki.php.net/rfc/arrow_functions_v2 > > This is based on a previous (withdrawn) proposal by Levi & Bob. It uses > the syntax > > fn($x) => $x * $multiplier > > and implicit by-value variable binding. This example is roughly equivalent > to: > > function($x) use($multiplier) { return $x * $multiplier; } > > The RFC contains a detailed discussion of syntax choices and binding modes. > > Regards, > Nikita > Heads up: I plan to start voting on this RFC tomorrow if nothing new comes up. Most of the discussion was (as expected) about the choice of syntax. Ultimately I think there are many reasonable choices we can make here, but we should stick to a specific proposal for the purposes of the RFC vote. None of the given arguments convinced me that some other syntax is *strictly* better than the proposed fn($x, $y) => $x*$y -- it's more a matter of some choices being slightly better in one case and slightly worse in another. My personal runner-up would be \($x, $y) => $x*$y, but I suspect that there are some people who are more strongly biased against "sigil salad" than I am... Nikita --00000000000017c3890586055ae2--