Definitely good to see new languages being designed and implemented.

JS is not going to break compatibility on the old fall-through behavior of switch, inherited from Java from C++ from C. All the C-like languages copy this flaw, because to do otherwise with the same keyword would be worse (confused users cross-training and -coding among languages would want our scalps), and IMHO using novel reserved words would be hardly better.

/be
Nathan Wall <mailto:[email protected]>
February 11, 2014 at 3:21 PM
Hi Giacomo,

Not sure whether this will be of interest to you, but I have been working on a JS-derived language called Proto (still highly experimental) which has a switch statement that works exactly as you described:

https://github.com/Nathan-Wall/proto/blob/master/docs/control/switch.md

Perhaps you will at least find it interesting. :)

Nathan



________________________________
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Giacomo Cau <mailto:[email protected]>
February 9, 2014 at 1:41 AM
Hello to all
I wish to submit a little proposal.
Today the switch statement has an
    explicit break at the end of the statement and an
    implicit continue to the next case
but this break is very boring and error prone.
Wouldn’t it be possible to think a switch that has an
    explicit continue to the next case and an
    implicit break at the end of the statement?
This is the hypothetical new statement syntax
with a new keyword:
    hctiws ( ... ) { ... }
    select ( ... ) { ... }
or without a new keyword:
    switch ( ... ) break { ... }
but with the current switch equals to
    switch ( ... ) continue { ... }
bye
    Giacomo Cau
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to