Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104707 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 89370 invoked from network); 14 Mar 2019 07:11:47 -0000 Received: from unknown (HELO mail-io1-f44.google.com) (209.85.166.44) by pb1.pair.com with SMTP; 14 Mar 2019 07:11:47 -0000 Received: by mail-io1-f44.google.com with SMTP id k21so3731414ior.13 for ; Wed, 13 Mar 2019 21:02:05 -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 :cc; bh=Js/pREVWdnJOwqNDq7rv1G3RqtnZiDkNit22vF+i0Mg=; b=TIiI3V3ayYX1KxSqthOl2oWyEgxtorfw6tRXWjOh/r04NiqHGmuVYvxvwUMGrbb51L CuEuxSHmubt9Mp3ewZ3vDuyhUlISjMT5gSpiKxUxQi/5OLUJHtMu09EIKPrnBuH5wDie 8eisVnRZoRqZh1n5QvgospnrAfQ7iK28mxhZ3DCyfqoifKMb8anYLpm7NftSHdw5OCRR 7A26zMVNLFxbN18Hh1HcwuYWgAjCFNWXN7rrACl/4hdpRAH/n6dBByTTxwuZa0aaaOZO 9qNkyHG5yIcmosuC1BIVbnbLpsjS5O4J1j2I2LRF7Mif+ZOrtlo+Qy8SH+g4Y8jjxit2 L9Wg== 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:cc; bh=Js/pREVWdnJOwqNDq7rv1G3RqtnZiDkNit22vF+i0Mg=; b=ogsn0MoSH/5Ncp/v1DOOxOXRO7gx2tYutB0ocjSZ7SCdWKyg9B9fRnGLiznYiIaSMt jP9jqPCpOUgrv3Bd/O5Lu4tutLh7xtNpobZFo0RFvDDtv3NnUmCh+/FdyBgv9a/wmIls yFh++QBehOKr7jqaAmQzOpLs6NN0WFEdMSlDyHEvpfVLZCuFzUzMmjlEG8NbESemst5G WXWKLpwWHpIrjijC8ZQLZY5M4G/LQbg/Iipr9diRyto+OOICZ05XchHYYbnANsoMJxpz 2njLCpQiijLoKp3emzGPD3P3vLkUG7cfgjC543KcxhLkpHcyZZj9hoXbxKz8WiWn5250 2y/w== X-Gm-Message-State: APjAAAVxFafQjsITSxadRhcY2XnYAeDVuBssknBiw6cwlmwqV7008O3Q kjAcR79WPMcDXty6zDcnanWPbpVWfrd2U1uq+a0= X-Google-Smtp-Source: APXvYqx4JsCffrGBDCeu1rs/u/v9YlzruE6T2opxCqmUJcTYw1l7J/BqWHZvlxGUMa3Iw205F/kwNN4f/vC+tk7iK0s= X-Received: by 2002:a6b:440b:: with SMTP id r11mr6529231ioa.48.1552536125032; Wed, 13 Mar 2019 21:02:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 14 Mar 2019 01:01:54 -0300 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000003be44b058405fc61" Subject: Re: [PHP-DEV] [RFC] Arrow functions / short closures From: david.proweb@gmail.com (David Rodrigues) --0000000000003be44b058405fc61 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I have two doubts about the RFC: 1. Your example with "($x) =3D> $x" consider the use of "$x =3D> $x", but n= ot specifically "($x) =3D> $x". I mean: maybe it can accept "($x) =3D> $x" but= not "$x =3D> $x" because of the array conflict (as mentioned), and with that we avoid to create a new keyword "fn". So parentheses is required. 2. I don't remember. haha Em qua, 13 de mar de 2019 =C3=A0s 12:57, Nikita Popov escreveu: > Hi internals, > > Motivated by the recent list comprehensions RFC, I think it's time we too= k > 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 t= he > syntax > > fn($x) =3D> $x * $multiplier > > and implicit by-value variable binding. This example is roughly equivalen= t > to: > > function($x) use($multiplier) { return $x * $multiplier; } > > The RFC contains a detailed discussion of syntax choices and binding mode= s. > > Regards, > Nikita > --=20 David Rodrigues --0000000000003be44b058405fc61--