Proposal: anaphoric if and while syntax

Mark Volkmann r.mark.volkmann at gmail.com
Sat Oct 1 04:00:36 UTC 2016


For what it's worth, I'm on the side of people that do not want to see
assignment statements in control structures. I don't think it is necessary
and it results in code that is harder to read.

On Wed, Sep 14, 2016 at 8:51 PM, Alan Johnson <alan at breakrs.com> wrote:

> What about `else if`?
>
> On Sep 14, 2016 9:28 PM, "Bergi" <a.d.bergi at web.de> wrote:
>
>> Danielle McLean wrote:
>>
>> variables declared
>>> using `let` or `const` would be scoped to the individual `if` or `while`
>>> statement, rather than the containing block. In other words, the above
>>> syntax
>>> would be equivalent to the following currently-valid form I ended up
>>> writing:
>>>
>>>     {
>>>       const oldValue = _.get(object, 'some.long.path');
>>>       if (oldValue) object.some.long.path = transform(oldValue);
>>>     }
>>>
>>
>> What about `else` blocks, would the variables be available in them as
>> well?
>>
>> - Bergi
>>
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>


-- 
R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20161001/f8616b7e/attachment.html>


More information about the es-discuss mailing list