Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98147 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89717 invoked from network); 3 Feb 2017 20:46:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Feb 2017 20:46:59 -0000 Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.46 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.215.46 mail-lf0-f46.google.com Received: from [209.85.215.46] ([209.85.215.46:34218] helo=mail-lf0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D4/97-38491-14CE4985 for ; Fri, 03 Feb 2017 15:46:58 -0500 Received: by mail-lf0-f46.google.com with SMTP id v186so16315098lfa.1 for ; Fri, 03 Feb 2017 12:46:57 -0800 (PST) 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=o9GjKoH0+AOMrfGDEi9dAz7B+JycUUZRIUe+nCElTwI=; b=XUNEsD1IHWsRFxblCkNyS/gVlNqI60M9Enpk4wZDYicDxdUFkoOw4Nl9dNZwlJsM17 SlhyiAty5p/25BsREpPVNq1n3puvWVLin4vomKnsWwBj3taCf6Kv3MLYQVvpY9YxyQh9 MVdZFQ4rMBL0PzDzUNwc7SFGoxJTSWB4/E8WIYe9fFL4W0ixfxsnoTBH4Tt2mXYLicgU AUarjV1KWCvyLiYSZx27RKn3y/wgYLmC5wEaMZ8nTzld3CGUqMqbBmIvi6qoIgHQIVTV loyiwkNw3M80akjAVqLgVNamqioomU3dbdJqQvYBQErqdbdA49jFyjj6vIaGYr2wG/j6 B2og== 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=o9GjKoH0+AOMrfGDEi9dAz7B+JycUUZRIUe+nCElTwI=; b=YCEQydkxts0XzLIZu3MaTgCFO7xK4avQhIy9DYCQKwD5evKzkQ2sQQy3PrpaAFJfkW Q8ireqpv8fxzdJjIcD9e4fVPPCqkPkYdLjYb8b5JFgQVkWfH9M8fWd6+cPB32CJoe7kX s0Vuhpfsq7O8NtCqiwiHQCneXoPJ5ZMotGt30U2i8SzK+I5KTuD7ZfvMuTD9hUSJtUdg D7e7IWjK/qfWRu2QvGDdyKYcNHDU81aR6CgnAq0oFqUFdZTzgBaqiFof4ehC+MAyAeOZ hmF3Q8Za8um6RLnu5+teW2EuI78Z6UFbvzFCQHL0MAsUeuerKoeT47rrQeNVkHdAJ7yx ZDsA== X-Gm-Message-State: AIkVDXIJh+Sxeq2kC+gmnMQ8DHs3wbyNm8xBQmxX7WIhdumQqJJ/Ry/b7Z73dQF/NjtKG0aGyy6Ovhco9BwAXw== X-Received: by 10.46.81.18 with SMTP id f18mr1810188ljb.62.1486154814480; Fri, 03 Feb 2017 12:46:54 -0800 (PST) MIME-Version: 1.0 Sender: morrison.levi@gmail.com Received: by 10.25.151.139 with HTTP; Fri, 3 Feb 2017 12:46:53 -0800 (PST) In-Reply-To: References: <19.45.38491.677D4985@pb1.pair.com> Date: Fri, 3 Feb 2017 13:46:53 -0700 X-Google-Sender-Auth: Sob71gWQXr50cZTIExyaiAFHZnE Message-ID: To: Niklas Keller Cc: Andrea Faulds , internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Re: [RFC][Discuss] Arrow Functions From: levim@php.net (Levi Morrison) On Fri, Feb 3, 2017 at 1:37 PM, Niklas Keller wrote: > 2017-02-03 21:23 GMT+01:00 Levi Morrison : >> >> On Fri, Feb 3, 2017 at 12:18 PM, Andrea Faulds wrote: >> > Hi David, >> > >> > David Rodrigues wrote: >> >> >> >> Hello folks! >> >> I just not understand why "function" should be abbreviated. It's abou= t >> >> "how >> >> less character better"? I don't see it too much on PHP. I guess that = is >> >> more simple keep what exists current "function", that all knows about >> >> (that >> >> should be better than the next example): >> >> >> >> $mapped =3D array_map(function($x) =3D> $x + $y); // vs current: >> >> $mapped =3D array_map(function($x) use($y) { return $x + $y }); >> > >> > >> > I feel the same way. It would be nice to have shorter syntax, but it >> > sacrifices readability and familiarity here, and adds yet another new >> > keyword. >> > >> > It also feels inconsistent=E2=80=A6 isn't "fn" just short for "functio= n"? Why is >> > it >> > exclusive to the =3D> syntax? >> >> This is not exactly on topic... unless you are implying you'd prefer >> the `|$x| =3D> $x + $y`? Maybe you missed [this][1] message? > > > Why is using "function" instead of "fn" not on topic? I did not ask for general syntax suggestions. What I am asking about is specifically what the preference people might have between these two options: fn(params) =3D> expr |params| =3D> expr As well as potential issues (thanks, Ilija, for pointing out a theoretical issue with union types). ---- As a disclaimer I'm trying to guide the discussion to these two options, not suppress suggestions I don't like.