Re: [RFC]Discuss] Syntax for Arrow Functions
| From: | Björn Larsson | Date: | Mon, 05 Jun 2017 20:18:49 +0000 |
| Subject: | Re: [RFC]Discuss] Syntax for Arrow Functions | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-99384@lists.php.net to get a copy of this message | ||
Den 2017-06-05 kl. 21:23, skrev Ryan Pallas:
On Mon, Jun 5, 2017 at 1:09 PM, Fleshgrinder <php@fleshgrinder.com> wrote:but could also live with ==>. I recall there was a discussion about how easy it was to use tilde on different keyboards / languages. So at that point the discussion was about either ~> or ==> for syntax. But back to Levi's list it looks like, at least to me that option 2 & 4 are off the table. Leaving option 3 & 1, maybe also option 5. Do you think this is a reasonable assumption? Also some other proposals has arisen, like using lamda instead of fn as a keyword and lastly the ~> one. r//BjörnOn 6/5/2017 9:03 PM, Ryan Pallas wrote:I can get behind using the tilde. Keeps it concise, but it's visually different than existing syntax, making it easier to recognize (IMO). I think ~>was a proposal in the short closure RFC. Personally I liked it,However, ($obj) -> $var is valid variable property syntax.Gosh, we really have support for everything. :D That one is even very important for stuff like(new A)->f(). How about ~> which I at least cannot think of any place it is used at all. ~ in binary negation and the only place we use it (I checked the language parser this time to make sure). I really dislike the ==> idea. One of the main reasons here is to write less and it looks too much like => or even >= which I really don't like.($a, $b) ==> $a >= $b($a, $b) ~> $a >= $b