Yes, it does the exact same thing.
I think using = and operators is a bit cleaner than 'do'.
However, The biggest advantage for this feature is you can write functional
code without extra syntax.
Allowing block to return value will allow you to write concise code like in
ocaml Haskell or scala.

On Sunday, October 30, 2016, Olivier Lalonde <[email protected]> wrote:

> Sounds like the "do expressions" proposal. http://wiki.ecmascript.org/
> doku.php?id=strawman:do_expressions
>
> On Sat, Oct 29, 2016 at 5:32 PM, Yongxu Ren <[email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote:
>
>> potentially, this syntax can be extended to functions
>> ```
>> function f() ={stat}
>> // is equivalent to
>> function f() {return stat}
>>
>>
>> let f = () => ={stat}
>> // are equivalent to
>> let f = () => stat
>> ```
>>
>> it can also be applied to `try...catch`.... and more, such as
>>
>> ```
>> // pattern matching
>> match(expr) {
>>   pattern1:={
>>     //block
>>   }
>>   pattern2:={
>>     //block
>>   }
>>   pattern3:={
>>     //block
>>   }
>> }
>>
>> _______________________________________________
>> es-discuss mailing list
>> [email protected]
>> <javascript:_e(%7B%7D,'cvml','[email protected]');>
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>>
>
>
> --
> - Oli
>
> Oli Lalonde
> http://www.syskall.com <-- connect with me!
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to