Den 2019-04-10 kl. 10:39, skrev Rowan Collins:> On Tue, 9 Apr 2019 at 11:20, Nikita PopovCould then the \($x) syntax be a good compromise between readability & implementation? It also has the advantage of having less BC impact, since the fn keyword must be a full keyword according to RFC. As a side note I'm thinking on if the Hacklang implementation could shed some light on tooling issues that they got, due to their implementation of the ==> syntax. r//BjÃ¶rn L
email@example.com> wrote: > >> The ==> syntax is the other one I implemented ( >> https://github.com/php/php-src/pull/3945). The implementation is based on >> lexer lookahead, which is ugly but still manageable. I haven't seen much >> support for this variant in this discussion though. And of course, if >> there's no strong preference for ==>, I'd rather go with the variant that >> is easier for us (and all 3rd party tooling) to support from a technical >> perspective. >> > > I'd just like to amplify this mention of 3rd party tooling: if we go with > something which requires complex lexer/parser rules, then every editor, > IDE, and static analysis tool will need to also work with that syntax. > > For those saying they "slightly prefer" ==> please ask yourself, do you > prefer it enough to add complexity to every tool that wants to process PHP > source code? > > Regards, Hi,
On 10 April 2019 21:56:41 BST, "BjÃ¶rn Larsson"
firstname.lastname@example.org> wrote:>Could then the \($x) syntax be a good compromise between >readability & implementation?Personally, I don't find it "more readable"; on the one hand, it's one character shorter; on the other, it stands out less from everything else. My personal bias against it is that I'm too used to reading \ as "escape", so every time I see examples my first reaction is "what does an escaped parenthesis mean?" I'm sure I'd get used to it, but I prefer "fn" because it more immediately makes me think "function". Regards, -- Rowan Collins [IMSoP]
On Thu, 11 Apr 2019 at 00:43, Rowan Collins
email@example.com> wrote:> > On 10 April 2019 21:56:41 BST, "BjÃ¶rn Larsson"This syntax does make sense to me, although only as I've seen it before in Haskell, which does something similar: https://wiki.haskell.org/Anonymous_function I think that people will get used to whatever becomes common. firstname.lastname@example.org> wrote: > >Could then the \($x) syntax be a good compromise between > >readability & implementation? >