Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99550 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87000 invoked from network); 19 Jun 2017 14:43:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jun 2017 14:43:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.41 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.214.41 mail-it0-f41.google.com Received: from [209.85.214.41] ([209.85.214.41:37251] helo=mail-it0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E1/A7-13828-8F2E7495 for ; Mon, 19 Jun 2017 10:43:04 -0400 Received: by mail-it0-f41.google.com with SMTP id m47so58761484iti.0 for ; Mon, 19 Jun 2017 07:43:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=h1qfCZp3VCsaXbvTwNDjJ5JGJy6gYTqtOLGQzpymqls=; b=TAh6A4dPLie/gOlstuYbov1htN8yk3FsnFtsVsGTX7eExyLME/YKjGIApNZNGqkznh iAFP01Kf8ZlX/TXtzNRRY8Fu0ujlgFe45EVjUvgcqOfuwisOu6aW0Rpa/foQ0r0+hMoB d1O2NMf5Jbj6jflSleLDSfw5Q/0/pXymzdgM3BUilX6gmIuErxyq5oA3q7LlyYirKQZP WBhjGIELxt2zCVhutj7H3Egua9e0OQFtLDXH7f2wupymw5FxiTHK2HQPnQeu/gDqjwoR o0xf5zzYjyWGsLa2ijG0d+acBi5oTCmK041+VedDgHEy1H/HtPbCypUPTrtsqUobPrTi LRSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=h1qfCZp3VCsaXbvTwNDjJ5JGJy6gYTqtOLGQzpymqls=; b=XGHSe4Le9XVtBZYGJ9aC1z8GBZBZ20SkT0rsAKL9J6003LdzvvGGvcclGzqQYvfYpG JSpwI9Cw9S2wQnbeTB0bZUJnEledJrr//0z+Kjtah55IjKn9L2Qd8dBBj7+/Ioptp8FW W/Xm3B/mC7SIxyRpju2pmU0jTpN/dJXIl8ZDKLtre5mDykmzIrYtwXLiadvPjAd42jM8 6hDOswRekfqpVtYs3QU6460/JeuN3gp/XQIAj/uN6LV7t/fgD0MU0E1bkf/4ZYCS0q5h ScFbCk23FXWrxa35BIQIATrSsc2FPWF9F6X9PyDPOJMxXOXnc5am1qXLsiGQ0F6o7vld inyA== X-Gm-Message-State: AKS2vOysu1ZS5LF9V0kVq7V+OFH+LtTtYbfy3qy2jq57/XweCorRB0KO +gjacIoFBiU1z0kiRT83Qr58QGWokQ== X-Received: by 10.36.2.201 with SMTP id 192mr18784525itu.113.1497883382281; Mon, 19 Jun 2017 07:43:02 -0700 (PDT) MIME-Version: 1.0 Sender: morrison.levi@gmail.com Received: by 10.107.50.132 with HTTP; Mon, 19 Jun 2017 07:43:01 -0700 (PDT) In-Reply-To: <9A3447BF-F982-4C5A-B55B-466036AF2E53@me.com> References: <4077c099-2247-c3c1-7dee-02a6b25f8586@fleshgrinder.com> <559b73f7-c40f-e593-f0e1-51b56210d7cb@telia.com> <2053A608-6B66-42FB-A6D7-7CC64E94DA6A@koalephant.com> <4FBDE643-1EBC-485A-A39F-7E28C5D4807A@koalephant.com> <034f3ebf-95b8-a7cf-1279-77c7cf0424d7@gmail.com> <46143e7c-ef75-7c05-eaa9-98c8f3b405f1@telia.com> <5fe1eefe-1c4f-4c31-c975-ab6c768c977c@telia.com> <3C763609-54FC-480B-AE95-94A1873226E0@me.com> <9A3447BF-F982-4C5A-B55B-466036AF2E53@me.com> Date: Mon, 19 Jun 2017 08:43:01 -0600 X-Google-Sender-Auth: D7zW2zSDpHH1SYjFUiMGrXZoLHU Message-ID: To: Ilija Tovilo Cc: Rasmus Schultz , =?UTF-8?Q?Bj=C3=B6rn_Larsson?= , Fleshgrinder , PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC]Discuss] Syntax for Arrow Functions From: levim@php.net (Levi Morrison) On Sun, Jun 18, 2017 at 1:44 PM, Ilija Tovilo wrote: > Sorry, I wasn=E2=80=99t aware of that. > > What do you think of the Ruby/Rust style syntax that Levi proposed a whil= e back? > > $someDict > ->map(|$v| $v * 2) > ->filter(|$v| $v % 3); > > This one has a few advantages: > > 1. It has syntax (a lot of) developers are already familiar with > 2. It has no ambiguities and is fully backward compatible > 3. It=E2=80=99s the shortest of all options available (two `|` characters= and one space) We determined that the arrow between the parameters and the expression would still be required. Given this limitation I think this syntax is seviceable: $someDict ->map({$v =3D> $v * 2}) ->filter({$v =3D> $v % 3}); Sometime this week I intend to start another thread that narrows us down to two choices.