On Tue, Sep 1, 2015 at 9:36 AM, Yasuo Ohgaki <yohg...@ohgaki.net> wrote:

> Hi Anthony and Bob,
>
> On Tue, Sep 1, 2015 at 2:53 PM, Anthony Ferrara <ircmax...@gmail.com>
> wrote:
> > Most programming languages today have a "short form" closure or lambda
> syntax
> >
> > HackLang: ($x) ==> $x + 1;
> > C++: [](int x) -> int { return x + 1; }
> > Java: (int x) -> x + 1;
> > Python: lambda x: x+1
> > Ruby: lambda |x| { x + 1 }
> > Rust: |x| x + 1
> > JavaScript (ES6): x => x + 1
> > C#: x => x + 1
> > Objective C: ^(int x) { return x + 1; }
>
> Nice summary!
> The syntax may look strange at first, but proposed syntax is close enough
> to
> other languages. There will be no barrier for our users in the long run.
>
> I thought scope variables enabled by default is destructive at first,
> but Bob clarify
> they are passed by value. Therefore, it would not be issue.
>
> Bob, is there reason not to use the same syntax as Hack "==>"?
>

https://wiki.php.net/rfc/short_closures#symbol_choice

-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu

Reply via email to