syntax for case ranges
Very interesting.
Once I wanted (and would have used a lot) something like a switchMatch
.
It would work like this:
switchMatch(value) {
case /\d+/: { ... }
case /\s+/: { ... }
case /.../: { ... }
default: {
console.log('Didn't match any of the options');
}
}
Of course you can have a regex like (\d+)|(\s+)|...
but it would be more
readable and would allow situations like yours to be easily solved, read,
thought and taught.
Very interesting. Once I wanted (and would have used a lot) something like a `switchMatch`. It would work like this: switchMatch(value) { case /\d+/: { ... } case /\s+/: { ... } case /.../: { ... } default: { console.log('Didn't match any of the options'); } } Of course you can have a regex like `(\d+)|(\s+)|...` but it would be more readable and would allow situations like yours to be easily solved, read, thought and taught. [ ]s *--* *Felipe N. Moura* Web Developer, Google Developer Expert <https://developers.google.com/experts/people/felipe-moura>, Founder of BrazilJS <https://braziljs.org/>, Nasc <http://nasc.io/> and On2 <https://on2.dev/>. Website: http://felipenmoura.com / http://nasc.io/ Twitter: @felipenmoura <http://twitter.com/felipenmoura> Facebook: http://fb.com/felipenmoura LinkedIn: http://goo.gl/qGmq --------------------------------- * Changing the world* is the least I expect from myself! On Fri, Jan 31, 2020 at 6:57 AM Sultan <thysultan at gmail.com> wrote: > For example, the following: > > switch (value) { > case 0...9: break > case 'a'...'z': break > } > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20200131/5b57e7f1/attachment.html>
This sounds like tc39/proposal-pattern-matching
This sounds like https://github.com/tc39/proposal-pattern-matching El 31/1/20 a les 10:57, Sultan ha escrit: For example, the following: switch (value) { case 0...9: break case 'a'...'z': break } _______________________________________________ es-discuss mailing list es-discuss at mozilla.org<mailto:es-discuss at mozilla.org> https://mail.mozilla.org/listinfo/es-discuss -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20200131/ad31cc22/attachment.html>
I agree with Oriol. We already have the proposal pattern matching, that has a very similar effect. I think that is better to improve pattern matching proposal in order to be able to match using ranges (or at least check if it's good to do) instead of create a new proposal.
I agree with Oriol. We already have the proposal pattern matching, that has a very similar effect. I think that is better to improve pattern matching proposal in order to be able to match using ranges (or at least check if it's good to do) instead of create a new proposal. On Fri, 31 Jan 2020 at 14:08, Oriol _ <oriol-bugzilla at hotmail.com> wrote: > This sounds like https://github.com/tc39/proposal-pattern-matching > > El 31/1/20 a les 10:57, Sultan ha escrit: > > For example, the following: > > switch (value) { > case 0...9: break > case 'a'...'z': break > } > > > _______________________________________________ > es-discuss mailing listes-discuss at mozilla.orghttps://mail.mozilla.org/listinfo/es-discuss > > > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20200131/d8441eb1/attachment-0001.html>
The pattern matching proposal does not handles the mentioned case:
switch(type) { case 0...5: }
being the equivalent of
switch(type) { case 0: case 1: case 2: case 3: case 4: case 5: }
The pattern matching proposal does not handles the mentioned case: switch(type) { case 0...5: } being the equivalent of switch(type) { case 0: case 1: case 2: case 3: case 4: case 5: } On Fri, Jan 31, 2020 at 7:36 PM Bruno Macabeus <bruno.macabeus at gmail.com> wrote: > I agree with Oriol. > We already have the proposal pattern matching, that has a very similar > effect. > I think that is better to improve pattern matching proposal in order to be > able to match using ranges (or at least check if it's good to do) instead > of create a new proposal. > > On Fri, 31 Jan 2020 at 14:08, Oriol _ <oriol-bugzilla at hotmail.com> wrote: > >> This sounds like https://github.com/tc39/proposal-pattern-matching >> >> El 31/1/20 a les 10:57, Sultan ha escrit: >> >> For example, the following: >> >> switch (value) { >> case 0...9: break >> case 'a'...'z': break >> } >> >> >> _______________________________________________ >> es-discuss mailing listes-discuss at mozilla.orghttps://mail.mozilla.org/listinfo/es-discuss >> >> >> _______________________________________________ >> 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20200131/5505bbd4/attachment.html>
Still better to discuss it there - it's highly related to your suggestion. And I'm pretty sure an issue already exists related to that.
Still better to discuss it there - it's highly related to your suggestion. And I'm pretty sure an issue already exists related to that. On Fri, Jan 31, 2020 at 09:06 Sultan <thysultan at gmail.com> wrote: > The pattern matching proposal does not handles the mentioned case: > > switch(type) { case 0...5: } being the equivalent of switch(type) { case > 0: case 1: case 2: case 3: case 4: case 5: } > > On Fri, Jan 31, 2020 at 7:36 PM Bruno Macabeus <bruno.macabeus at gmail.com> > wrote: > >> I agree with Oriol. >> We already have the proposal pattern matching, that has a very similar >> effect. >> I think that is better to improve pattern matching proposal in order to >> be able to match using ranges (or at least check if it's good to do) >> instead of create a new proposal. >> >> On Fri, 31 Jan 2020 at 14:08, Oriol _ <oriol-bugzilla at hotmail.com> wrote: >> >>> This sounds like https://github.com/tc39/proposal-pattern-matching >>> >>> El 31/1/20 a les 10:57, Sultan ha escrit: >>> >>> For example, the following: >>> >>> switch (value) { >>> case 0...9: break >>> case 'a'...'z': break >>> } >>> >>> >>> _______________________________________________ >>> es-discuss mailing listes-discuss at mozilla.orghttps://mail.mozilla.org/listinfo/es-discuss >>> >>> >>> _______________________________________________ >>> 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 >> > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > -- ----- Isiah Meadows contact at isiahmeadows.com www.isiahmeadows.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20200131/ba8c84fa/attachment.html>
Certain languages allow the expression 0<x<5. Does anybody know if this would be syntactically possible in JavaScript? Of course this would only apply for "if"/"while" statements.
Certain languages allow the expression 0<x<5. Does anybody know if this would be syntactically possible in JavaScript? Of course this would only apply for "if"/"while" statements. On Fri, 31 Jan 2020 at 22:41, Isiah Meadows <contact at isiahmeadows.com> wrote: > Still better to discuss it there - it's highly related to your suggestion. > And I'm pretty sure an issue already exists related to that. > > On Fri, Jan 31, 2020 at 09:06 Sultan <thysultan at gmail.com> wrote: > >> The pattern matching proposal does not handles the mentioned case: >> >> switch(type) { case 0...5: } being the equivalent of switch(type) { case >> 0: case 1: case 2: case 3: case 4: case 5: } >> >> On Fri, Jan 31, 2020 at 7:36 PM Bruno Macabeus <bruno.macabeus at gmail.com> >> wrote: >> >>> I agree with Oriol. >>> We already have the proposal pattern matching, that has a very similar >>> effect. >>> I think that is better to improve pattern matching proposal in order to >>> be able to match using ranges (or at least check if it's good to do) >>> instead of create a new proposal. >>> >>> On Fri, 31 Jan 2020 at 14:08, Oriol _ <oriol-bugzilla at hotmail.com> >>> wrote: >>> >>>> This sounds like https://github.com/tc39/proposal-pattern-matching >>>> >>>> El 31/1/20 a les 10:57, Sultan ha escrit: >>>> >>>> For example, the following: >>>> >>>> switch (value) { >>>> case 0...9: break >>>> case 'a'...'z': break >>>> } >>>> >>>> >>>> _______________________________________________ >>>> es-discuss mailing listes-discuss at mozilla.orghttps://mail.mozilla.org/listinfo/es-discuss >>>> >>>> >>>> _______________________________________________ >>>> 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 >>> >> _______________________________________________ >> es-discuss mailing list >> es-discuss at mozilla.org >> https://mail.mozilla.org/listinfo/es-discuss >> > -- > ----- > > Isiah Meadows > contact at isiahmeadows.com > www.isiahmeadows.com > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20200201/ccc4b75d/attachment.html>
3 < 2 < 1; // true
3 < 2 < 1; // true On Sat, Feb 1, 2020 at 3:03 AM Naveen Chawla <naveen.chwl at gmail.com> wrote: > Certain languages allow the expression 0<x<5. Does anybody know if this > would be syntactically possible in JavaScript? Of course this would only > apply for "if"/"while" statements. > > On Fri, 31 Jan 2020 at 22:41, Isiah Meadows <contact at isiahmeadows.com> > wrote: > >> Still better to discuss it there - it's highly related to your >> suggestion. And I'm pretty sure an issue already exists related to that. >> >> On Fri, Jan 31, 2020 at 09:06 Sultan <thysultan at gmail.com> wrote: >> >>> The pattern matching proposal does not handles the mentioned case: >>> >>> switch(type) { case 0...5: } being the equivalent of switch(type) { case >>> 0: case 1: case 2: case 3: case 4: case 5: } >>> >>> On Fri, Jan 31, 2020 at 7:36 PM Bruno Macabeus <bruno.macabeus at gmail.com> >>> wrote: >>> >>>> I agree with Oriol. >>>> We already have the proposal pattern matching, that has a very similar >>>> effect. >>>> I think that is better to improve pattern matching proposal in order to >>>> be able to match using ranges (or at least check if it's good to do) >>>> instead of create a new proposal. >>>> >>>> On Fri, 31 Jan 2020 at 14:08, Oriol _ <oriol-bugzilla at hotmail.com> >>>> wrote: >>>> >>>>> This sounds like https://github.com/tc39/proposal-pattern-matching >>>>> >>>>> El 31/1/20 a les 10:57, Sultan ha escrit: >>>>> >>>>> For example, the following: >>>>> >>>>> switch (value) { >>>>> case 0...9: break >>>>> case 'a'...'z': break >>>>> } >>>>> >>>>> >>>>> _______________________________________________ >>>>> es-discuss mailing listes-discuss at mozilla.orghttps://mail.mozilla.org/listinfo/es-discuss >>>>> >>>>> >>>>> _______________________________________________ >>>>> 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 >>>> >>> _______________________________________________ >>> es-discuss mailing list >>> es-discuss at mozilla.org >>> https://mail.mozilla.org/listinfo/es-discuss >>> >> -- >> ----- >> >> Isiah Meadows >> contact at isiahmeadows.com >> www.isiahmeadows.com >> _______________________________________________ >> 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 > -- Cheers, --MarkM -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20200201/3f0f0082/attachment.html>
I didn't understand your reply.
I think currently it would raise an error, because 1 < 2 < 3 is currently saying (probably) true < 3.
But a "new" syntax could possibly parse that as a "chain" of comparisons.
Would this be acceptable to introduce into JavaScript (just curious)?
I've probably missed your point entirely, because I saw a short message "3 < 2 < 1 //true", and I've assumed you meant it in reverse.
Hi! I didn't understand your reply. I think currently it would raise an error, because 1 < 2 < 3 is currently saying (probably) true < 3. But a "new" syntax could possibly parse that as a "chain" of comparisons. Would this be acceptable to introduce into JavaScript (just curious)? I've probably missed your point entirely, because I saw a short message "3 < 2 < 1 //true", and I've assumed you meant it in reverse. On Sat, 1 Feb 2020 at 23:12, Mark S. Miller <erights at gmail.com> wrote: > 3 < 2 < 1; // true > > > On Sat, Feb 1, 2020 at 3:03 AM Naveen Chawla <naveen.chwl at gmail.com> > wrote: > >> Certain languages allow the expression 0<x<5. Does anybody know if this >> would be syntactically possible in JavaScript? Of course this would only >> apply for "if"/"while" statements. >> >> On Fri, 31 Jan 2020 at 22:41, Isiah Meadows <contact at isiahmeadows.com> >> wrote: >> >>> Still better to discuss it there - it's highly related to your >>> suggestion. And I'm pretty sure an issue already exists related to that. >>> >>> On Fri, Jan 31, 2020 at 09:06 Sultan <thysultan at gmail.com> wrote: >>> >>>> The pattern matching proposal does not handles the mentioned case: >>>> >>>> switch(type) { case 0...5: } being the equivalent of switch(type) { >>>> case 0: case 1: case 2: case 3: case 4: case 5: } >>>> >>>> On Fri, Jan 31, 2020 at 7:36 PM Bruno Macabeus < >>>> bruno.macabeus at gmail.com> wrote: >>>> >>>>> I agree with Oriol. >>>>> We already have the proposal pattern matching, that has a very similar >>>>> effect. >>>>> I think that is better to improve pattern matching proposal in order >>>>> to be able to match using ranges (or at least check if it's good to do) >>>>> instead of create a new proposal. >>>>> >>>>> On Fri, 31 Jan 2020 at 14:08, Oriol _ <oriol-bugzilla at hotmail.com> >>>>> wrote: >>>>> >>>>>> This sounds like https://github.com/tc39/proposal-pattern-matching >>>>>> >>>>>> El 31/1/20 a les 10:57, Sultan ha escrit: >>>>>> >>>>>> For example, the following: >>>>>> >>>>>> switch (value) { >>>>>> case 0...9: break >>>>>> case 'a'...'z': break >>>>>> } >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> es-discuss mailing listes-discuss at mozilla.orghttps://mail.mozilla.org/listinfo/es-discuss >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> 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 >>>>> >>>> _______________________________________________ >>>> es-discuss mailing list >>>> es-discuss at mozilla.org >>>> https://mail.mozilla.org/listinfo/es-discuss >>>> >>> -- >>> ----- >>> >>> Isiah Meadows >>> contact at isiahmeadows.com >>> www.isiahmeadows.com >>> _______________________________________________ >>> 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 >> > > > -- > Cheers, > --MarkM > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20200203/4d3ce761/attachment.html>
Try typing 3 < 2 < 1
in the web console of your favourite browser, and see the result: it will evaluate to true
. No, your browser isn’t buggy, it is just following blindly the semantics of <
.
Modifying the meaning of 3 < 2 < 1
in order to make it evaluating to false
is a BC break. Is it acceptable? Dunno.
Try typing `3 < 2 < 1` in the web console of your favourite browser, and see the result: it will evaluate to `true`. No, your browser isn’t buggy, it is just following blindly the semantics of `<`. Modifying the meaning of `3 < 2 < 1` in order to make it evaluating to `false` is a BC break. Is it acceptable? Dunno. —Claude > Le 3 févr. 2020 à 15:23, Naveen Chawla <naveen.chwl at gmail.com> a écrit : > > Hi! > > I didn't understand your reply. > > I think currently it would raise an error, because 1 < 2 < 3 is currently saying (probably) true < 3. > > But a "new" syntax could possibly parse that as a "chain" of comparisons. > > Would this be acceptable to introduce into JavaScript (just curious)? > > I've probably missed your point entirely, because I saw a short message "3 < 2 < 1 //true", and I've assumed you meant it in reverse. > > On Sat, 1 Feb 2020 at 23:12, Mark S. Miller <erights at gmail.com <mailto:erights at gmail.com>> wrote: > 3 < 2 < 1; // true > > > On Sat, Feb 1, 2020 at 3:03 AM Naveen Chawla <naveen.chwl at gmail.com <mailto:naveen.chwl at gmail.com>> wrote: > Certain languages allow the expression 0<x<5. Does anybody know if this would be syntactically possible in JavaScript? Of course this would only apply for "if"/"while" statements. > > On Fri, 31 Jan 2020 at 22:41, Isiah Meadows <contact at isiahmeadows.com <mailto:contact at isiahmeadows.com>> wrote: > Still better to discuss it there - it's highly related to your suggestion. And I'm pretty sure an issue already exists related to that. > > On Fri, Jan 31, 2020 at 09:06 Sultan <thysultan at gmail.com <mailto:thysultan at gmail.com>> wrote: > The pattern matching proposal does not handles the mentioned case: > > switch(type) { case 0...5: } being the equivalent of switch(type) { case 0: case 1: case 2: case 3: case 4: case 5: } > > On Fri, Jan 31, 2020 at 7:36 PM Bruno Macabeus <bruno.macabeus at gmail.com <mailto:bruno.macabeus at gmail.com>> wrote: > I agree with Oriol. > We already have the proposal pattern matching, that has a very similar effect. > I think that is better to improve pattern matching proposal in order to be able to match using ranges (or at least check if it's good to do) instead of create a new proposal. > > On Fri, 31 Jan 2020 at 14:08, Oriol _ <oriol-bugzilla at hotmail.com <mailto:oriol-bugzilla at hotmail.com>> wrote: > This sounds like https://github.com/tc39/proposal-pattern-matching <https://github.com/tc39/proposal-pattern-matching> > > El 31/1/20 a les 10:57, Sultan ha escrit: >> For example, the following: >> >> switch (value) { >> case 0...9: break >> case 'a'...'z': break >> } >> >> >> _______________________________________________ >> es-discuss mailing list >> es-discuss at mozilla.org <mailto:es-discuss at mozilla.org> >> https://mail.mozilla.org/listinfo/es-discuss <https://mail.mozilla.org/listinfo/es-discuss> > > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org <mailto:es-discuss at mozilla.org> > https://mail.mozilla.org/listinfo/es-discuss <https://mail.mozilla.org/listinfo/es-discuss> > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org <mailto:es-discuss at mozilla.org> > https://mail.mozilla.org/listinfo/es-discuss <https://mail.mozilla.org/listinfo/es-discuss> > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org <mailto:es-discuss at mozilla.org> > https://mail.mozilla.org/listinfo/es-discuss <https://mail.mozilla.org/listinfo/es-discuss> > -- > ----- > > Isiah Meadows > contact at isiahmeadows.com <mailto:contact at isiahmeadows.com> > www.isiahmeadows.com <http://www.isiahmeadows.com/>_______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org <mailto:es-discuss at mozilla.org> > https://mail.mozilla.org/listinfo/es-discuss <https://mail.mozilla.org/listinfo/es-discuss> > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org <mailto:es-discuss at mozilla.org> > https://mail.mozilla.org/listinfo/es-discuss <https://mail.mozilla.org/listinfo/es-discuss> > > > -- > Cheers, > --MarkM > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20200203/d0b8700d/attachment-0001.html>
Does make me wonder if engines should start collecting statistics on how often it's used and how often that result differs from if a Python-style chained comparison was done instead.
Does make me wonder if engines should start collecting statistics on how often it's used and how often that result differs from if a Python-style chained comparison was done instead. On Mon, Feb 3, 2020 at 09:18 Claude Pache <claude.pache at gmail.com> wrote: > Try typing `3 < 2 < 1` in the web console of your favourite browser, and > see the result: it will evaluate to `true`. No, your browser isn’t buggy, > it is just following blindly the semantics of `<`. > > Modifying the meaning of `3 < 2 < 1` in order to make it evaluating to > `false` is a BC break. Is it acceptable? Dunno. > > —Claude > > Le 3 févr. 2020 à 15:23, Naveen Chawla <naveen.chwl at gmail.com> a écrit : > > Hi! > > I didn't understand your reply. > > I think currently it would raise an error, because 1 < 2 < 3 is currently > saying (probably) true < 3. > > But a "new" syntax could possibly parse that as a "chain" of comparisons. > > Would this be acceptable to introduce into JavaScript (just curious)? > > I've probably missed your point entirely, because I saw a short message "3 > < 2 < 1 //true", and I've assumed you meant it in reverse. > > On Sat, 1 Feb 2020 at 23:12, Mark S. Miller <erights at gmail.com> wrote: > >> 3 < 2 < 1; // true >> >> >> On Sat, Feb 1, 2020 at 3:03 AM Naveen Chawla <naveen.chwl at gmail.com> >> wrote: >> >>> Certain languages allow the expression 0<x<5. Does anybody know if this >>> would be syntactically possible in JavaScript? Of course this would only >>> apply for "if"/"while" statements. >>> >>> On Fri, 31 Jan 2020 at 22:41, Isiah Meadows <contact at isiahmeadows.com> >>> wrote: >>> >>>> Still better to discuss it there - it's highly related to your >>>> suggestion. And I'm pretty sure an issue already exists related to that. >>>> >>>> On Fri, Jan 31, 2020 at 09:06 Sultan <thysultan at gmail.com> wrote: >>>> >>>>> The pattern matching proposal does not handles the mentioned case: >>>>> >>>>> switch(type) { case 0...5: } being the equivalent of switch(type) { >>>>> case 0: case 1: case 2: case 3: case 4: case 5: } >>>>> >>>>> On Fri, Jan 31, 2020 at 7:36 PM Bruno Macabeus < >>>>> bruno.macabeus at gmail.com> wrote: >>>>> >>>>>> I agree with Oriol. >>>>>> We already have the proposal pattern matching, that has a very >>>>>> similar effect. >>>>>> I think that is better to improve pattern matching proposal in order >>>>>> to be able to match using ranges (or at least check if it's good to do) >>>>>> instead of create a new proposal. >>>>>> >>>>>> On Fri, 31 Jan 2020 at 14:08, Oriol _ <oriol-bugzilla at hotmail.com> >>>>>> wrote: >>>>>> >>>>>>> This sounds like https://github.com/tc39/proposal-pattern-matching >>>>>>> >>>>>>> El 31/1/20 a les 10:57, Sultan ha escrit: >>>>>>> >>>>>>> For example, the following: >>>>>>> >>>>>>> switch (value) { >>>>>>> case 0...9: break >>>>>>> case 'a'...'z': break >>>>>>> } >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> es-discuss mailing listes-discuss at mozilla.orghttps://mail.mozilla.org/listinfo/es-discuss >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> 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 >>>>>> >>>>> _______________________________________________ >>>>> es-discuss mailing list >>>>> es-discuss at mozilla.org >>>>> https://mail.mozilla.org/listinfo/es-discuss >>>>> >>>> -- >>>> ----- >>>> >>>> Isiah Meadows >>>> contact at isiahmeadows.com >>>> www.isiahmeadows.com >>>> _______________________________________________ >>>> 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 >>> >> >> >> -- >> Cheers, >> --MarkM >> > _______________________________________________ > 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 > -- ----- Isiah Meadows contact at isiahmeadows.com www.isiahmeadows.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20200203/891a7c07/attachment.html>
Thank you Claude! I did miss the point.
Have there ever been "BC" breaks introduced into the language before? If so, is there a sustainable standard for an "acceptable" one?
Thank you Claude! I did miss the point. Have there ever been "BC" breaks introduced into the language before? If so, is there a sustainable standard for an "acceptable" one? On Mon, 3 Feb 2020 at 22:47, Claude Pache <claude.pache at gmail.com> wrote: > Try typing `3 < 2 < 1` in the web console of your favourite browser, and > see the result: it will evaluate to `true`. No, your browser isn’t buggy, > it is just following blindly the semantics of `<`. > > Modifying the meaning of `3 < 2 < 1` in order to make it evaluating to > `false` is a BC break. Is it acceptable? Dunno. > > —Claude > > Le 3 févr. 2020 à 15:23, Naveen Chawla <naveen.chwl at gmail.com> a écrit : > > Hi! > > I didn't understand your reply. > > I think currently it would raise an error, because 1 < 2 < 3 is currently > saying (probably) true < 3. > > But a "new" syntax could possibly parse that as a "chain" of comparisons. > > Would this be acceptable to introduce into JavaScript (just curious)? > > I've probably missed your point entirely, because I saw a short message "3 > < 2 < 1 //true", and I've assumed you meant it in reverse. > > On Sat, 1 Feb 2020 at 23:12, Mark S. Miller <erights at gmail.com> wrote: > >> 3 < 2 < 1; // true >> >> >> On Sat, Feb 1, 2020 at 3:03 AM Naveen Chawla <naveen.chwl at gmail.com> >> wrote: >> >>> Certain languages allow the expression 0<x<5. Does anybody know if this >>> would be syntactically possible in JavaScript? Of course this would only >>> apply for "if"/"while" statements. >>> >>> On Fri, 31 Jan 2020 at 22:41, Isiah Meadows <contact at isiahmeadows.com> >>> wrote: >>> >>>> Still better to discuss it there - it's highly related to your >>>> suggestion. And I'm pretty sure an issue already exists related to that. >>>> >>>> On Fri, Jan 31, 2020 at 09:06 Sultan <thysultan at gmail.com> wrote: >>>> >>>>> The pattern matching proposal does not handles the mentioned case: >>>>> >>>>> switch(type) { case 0...5: } being the equivalent of switch(type) { >>>>> case 0: case 1: case 2: case 3: case 4: case 5: } >>>>> >>>>> On Fri, Jan 31, 2020 at 7:36 PM Bruno Macabeus < >>>>> bruno.macabeus at gmail.com> wrote: >>>>> >>>>>> I agree with Oriol. >>>>>> We already have the proposal pattern matching, that has a very >>>>>> similar effect. >>>>>> I think that is better to improve pattern matching proposal in order >>>>>> to be able to match using ranges (or at least check if it's good to do) >>>>>> instead of create a new proposal. >>>>>> >>>>>> On Fri, 31 Jan 2020 at 14:08, Oriol _ <oriol-bugzilla at hotmail.com> >>>>>> wrote: >>>>>> >>>>>>> This sounds like https://github.com/tc39/proposal-pattern-matching >>>>>>> >>>>>>> El 31/1/20 a les 10:57, Sultan ha escrit: >>>>>>> >>>>>>> For example, the following: >>>>>>> >>>>>>> switch (value) { >>>>>>> case 0...9: break >>>>>>> case 'a'...'z': break >>>>>>> } >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> es-discuss mailing listes-discuss at mozilla.orghttps://mail.mozilla.org/listinfo/es-discuss >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> 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 >>>>>> >>>>> _______________________________________________ >>>>> es-discuss mailing list >>>>> es-discuss at mozilla.org >>>>> https://mail.mozilla.org/listinfo/es-discuss >>>>> >>>> -- >>>> ----- >>>> >>>> Isiah Meadows >>>> contact at isiahmeadows.com >>>> www.isiahmeadows.com >>>> _______________________________________________ >>>> 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 >>> >> >> >> -- >> Cheers, >> --MarkM >> > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20200203/d9985afb/attachment-0001.html>
Yes, there have been numerous backwards-incompatible changes to the language over the years.
You can find a list of them in section E of the ECMAScript language standard. IIRC, that list is non-exhaustive.
Yes, there have been numerous backwards-incompatible changes to the language over the years. You can find a list of them in section E of the ECMAScript language standard. IIRC, that list is non-exhaustive. On Monday, February 3, 2020 6:35:12 PM CET Naveen Chawla wrote: > Thank you Claude! I did miss the point. > > Have there ever been "BC" breaks introduced into the language before? If > so, is there a sustainable standard for an "acceptable" one? > > On Mon, 3 Feb 2020 at 22:47, Claude Pache <claude.pache at gmail.com> wrote: > > Try typing `3 < 2 < 1` in the web console of your favourite browser, and > > see the result: it will evaluate to `true`. No, your browser isn’t buggy, > > it is just following blindly the semantics of `<`. > > > > Modifying the meaning of `3 < 2 < 1` in order to make it evaluating to > > `false` is a BC break. Is it acceptable? Dunno. > > > > —Claude > > > > Le 3 févr. 2020 à 15:23, Naveen Chawla <naveen.chwl at gmail.com> a écrit : > > > > Hi! > > > > I didn't understand your reply. > > > > I think currently it would raise an error, because 1 < 2 < 3 is currently > > saying (probably) true < 3. > > > > But a "new" syntax could possibly parse that as a "chain" of comparisons. > > > > Would this be acceptable to introduce into JavaScript (just curious)? > > > > I've probably missed your point entirely, because I saw a short message "3 > > < 2 < 1 //true", and I've assumed you meant it in reverse. > > > > On Sat, 1 Feb 2020 at 23:12, Mark S. Miller <erights at gmail.com> wrote: > >> 3 < 2 < 1; // true > >> > >> > >> On Sat, Feb 1, 2020 at 3:03 AM Naveen Chawla <naveen.chwl at gmail.com> > >> > >> wrote: > >>> Certain languages allow the expression 0<x<5. Does anybody know if this > >>> would be syntactically possible in JavaScript? Of course this would only > >>> apply for "if"/"while" statements. > >>> > >>> On Fri, 31 Jan 2020 at 22:41, Isiah Meadows <contact at isiahmeadows.com> > >>> > >>> wrote: > >>>> Still better to discuss it there - it's highly related to your > >>>> suggestion. And I'm pretty sure an issue already exists related to > >>>> that. > >>>> > >>>> On Fri, Jan 31, 2020 at 09:06 Sultan <thysultan at gmail.com> wrote: > >>>>> The pattern matching proposal does not handles the mentioned case: > >>>>> > >>>>> switch(type) { case 0...5: } being the equivalent of switch(type) { > >>>>> case 0: case 1: case 2: case 3: case 4: case 5: } > >>>>> > >>>>> On Fri, Jan 31, 2020 at 7:36 PM Bruno Macabeus < > >>>>> > >>>>> bruno.macabeus at gmail.com> wrote: > >>>>>> I agree with Oriol. > >>>>>> We already have the proposal pattern matching, that has a very > >>>>>> similar effect. > >>>>>> I think that is better to improve pattern matching proposal in order > >>>>>> to be able to match using ranges (or at least check if it's good to > >>>>>> do) > >>>>>> instead of create a new proposal. > >>>>>> > >>>>>> On Fri, 31 Jan 2020 at 14:08, Oriol _ <oriol-bugzilla at hotmail.com> > >>>>>> > >>>>>> wrote: > >>>>>>> This sounds like https://github.com/tc39/proposal-pattern-matching > >>>>>>> > >>>>>>> El 31/1/20 a les 10:57, Sultan ha escrit: > >>>>>>> > >>>>>>> For example, the following: > >>>>>>> > >>>>>>> switch (value) { > >>>>>>> > >>>>>>> case 0...9: break > >>>>>>> case 'a'...'z': break > >>>>>>> > >>>>>>> } > >>>>>>> > >>>>>>> > >>>>>>> _______________________________________________ > >>>>>>> es-discuss mailing > >>>>>>> listes-discuss at mozilla.orghttps://mail.mozilla.org/listinfo/es-disc > >>>>>>> uss > >>>>>>> > >>>>>>> > >>>>>>> _______________________________________________ > >>>>>>> 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 > >>>>> > >>>>> _______________________________________________ > >>>>> es-discuss mailing list > >>>>> es-discuss at mozilla.org > >>>>> https://mail.mozilla.org/listinfo/es-discuss > >>>> > >>>> -- > >>>> ----- > >>>> > >>>> Isiah Meadows > >>>> contact at isiahmeadows.com > >>>> www.isiahmeadows.com > >>>> _______________________________________________ > >>>> 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 > >> > >> -- > >> > >> Cheers, > >> --MarkM > > > > _______________________________________________ > > es-discuss mailing list > > es-discuss at mozilla.org > > https://mail.mozilla.org/listinfo/es-discuss -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: This is a digitally signed message part. URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20200203/861c4b01/attachment.sig>
While correct, each case asked the browser makers to make a risky and costly bet. When the risk was low and the payoff high, they've been great at doing so. This one does not fall into the viable risk vs reward territory.
While correct, each case asked the browser makers to make a risky and costly bet. When the risk was low and the payoff high, they've been great at doing so. This one does not fall into the viable risk vs reward territory. On Mon, Feb 3, 2020 at 7:58 AM kdex <kdex at kdex.de> wrote: > Yes, there have been numerous backwards-incompatible changes to the > language > over the years. > > You can find a list of them in section E of the ECMAScript language > standard. > IIRC, that list is non-exhaustive. > > On Monday, February 3, 2020 6:35:12 PM CET Naveen Chawla wrote: > > Thank you Claude! I did miss the point. > > > > Have there ever been "BC" breaks introduced into the language before? If > > so, is there a sustainable standard for an "acceptable" one? > > > > On Mon, 3 Feb 2020 at 22:47, Claude Pache <claude.pache at gmail.com> > wrote: > > > Try typing `3 < 2 < 1` in the web console of your favourite browser, > and > > > see the result: it will evaluate to `true`. No, your browser isn’t > buggy, > > > it is just following blindly the semantics of `<`. > > > > > > Modifying the meaning of `3 < 2 < 1` in order to make it evaluating to > > > `false` is a BC break. Is it acceptable? Dunno. > > > > > > —Claude > > > > > > Le 3 févr. 2020 à 15:23, Naveen Chawla <naveen.chwl at gmail.com> a > écrit : > > > > > > Hi! > > > > > > I didn't understand your reply. > > > > > > I think currently it would raise an error, because 1 < 2 < 3 is > currently > > > saying (probably) true < 3. > > > > > > But a "new" syntax could possibly parse that as a "chain" of > comparisons. > > > > > > Would this be acceptable to introduce into JavaScript (just curious)? > > > > > > I've probably missed your point entirely, because I saw a short > message "3 > > > < 2 < 1 //true", and I've assumed you meant it in reverse. > > > > > > On Sat, 1 Feb 2020 at 23:12, Mark S. Miller <erights at gmail.com> wrote: > > >> 3 < 2 < 1; // true > > >> > > >> > > >> On Sat, Feb 1, 2020 at 3:03 AM Naveen Chawla <naveen.chwl at gmail.com> > > >> > > >> wrote: > > >>> Certain languages allow the expression 0<x<5. Does anybody know if > this > > >>> would be syntactically possible in JavaScript? Of course this would > only > > >>> apply for "if"/"while" statements. > > >>> > > >>> On Fri, 31 Jan 2020 at 22:41, Isiah Meadows < > contact at isiahmeadows.com> > > >>> > > >>> wrote: > > >>>> Still better to discuss it there - it's highly related to your > > >>>> suggestion. And I'm pretty sure an issue already exists related to > > >>>> that. > > >>>> > > >>>> On Fri, Jan 31, 2020 at 09:06 Sultan <thysultan at gmail.com> wrote: > > >>>>> The pattern matching proposal does not handles the mentioned case: > > >>>>> > > >>>>> switch(type) { case 0...5: } being the equivalent of switch(type) { > > >>>>> case 0: case 1: case 2: case 3: case 4: case 5: } > > >>>>> > > >>>>> On Fri, Jan 31, 2020 at 7:36 PM Bruno Macabeus < > > >>>>> > > >>>>> bruno.macabeus at gmail.com> wrote: > > >>>>>> I agree with Oriol. > > >>>>>> We already have the proposal pattern matching, that has a very > > >>>>>> similar effect. > > >>>>>> I think that is better to improve pattern matching proposal in > order > > >>>>>> to be able to match using ranges (or at least check if it's good > to > > >>>>>> do) > > >>>>>> instead of create a new proposal. > > >>>>>> > > >>>>>> On Fri, 31 Jan 2020 at 14:08, Oriol _ <oriol-bugzilla at hotmail.com > > > > >>>>>> > > >>>>>> wrote: > > >>>>>>> This sounds like > https://github.com/tc39/proposal-pattern-matching > > >>>>>>> > > >>>>>>> El 31/1/20 a les 10:57, Sultan ha escrit: > > >>>>>>> > > >>>>>>> For example, the following: > > >>>>>>> > > >>>>>>> switch (value) { > > >>>>>>> > > >>>>>>> case 0...9: break > > >>>>>>> case 'a'...'z': break > > >>>>>>> > > >>>>>>> } > > >>>>>>> > > >>>>>>> > > >>>>>>> _______________________________________________ > > >>>>>>> es-discuss mailing > > >>>>>>> listes-discuss at mozilla.orghttps:// > mail.mozilla.org/listinfo/es-disc > > >>>>>>> uss > > >>>>>>> > > >>>>>>> > > >>>>>>> _______________________________________________ > > >>>>>>> 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 > > >>>>> > > >>>>> _______________________________________________ > > >>>>> es-discuss mailing list > > >>>>> es-discuss at mozilla.org > > >>>>> https://mail.mozilla.org/listinfo/es-discuss > > >>>> > > >>>> -- > > >>>> ----- > > >>>> > > >>>> Isiah Meadows > > >>>> contact at isiahmeadows.com > > >>>> www.isiahmeadows.com > > >>>> _______________________________________________ > > >>>> 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 > > >> > > >> -- > > >> > > >> Cheers, > > >> --MarkM > > > > > > _______________________________________________ > > > es-discuss mailing list > > > es-discuss at mozilla.org > > > https://mail.mozilla.org/listinfo/es-discuss -- Cheers, --MarkM -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20200203/943f9f6d/attachment-0001.html>
Thanks! Although I think it is a value judgement about how much risk is worth how much reward, and which reward, so I wouldn't classify it as necessarily a complete set of criteria yet, but it is certainly in the right direction. And very interesting to me. Thank you.
Thanks! Although I think it is a value judgement about how much risk is worth how much reward, and which reward, so I wouldn't classify it as necessarily a complete set of criteria yet, but it is certainly in the right direction. And very interesting to me. Thank you. On Tue, 4 Feb 2020 at 00:40, Mark S. Miller <erights at gmail.com> wrote: > While correct, each case asked the browser makers to make a risky and > costly bet. When the risk was low and the payoff high, they've been great > at doing so. This one does not fall into the viable risk vs reward > territory. > > > On Mon, Feb 3, 2020 at 7:58 AM kdex <kdex at kdex.de> wrote: > >> Yes, there have been numerous backwards-incompatible changes to the >> language >> over the years. >> >> You can find a list of them in section E of the ECMAScript language >> standard. >> IIRC, that list is non-exhaustive. >> >> On Monday, February 3, 2020 6:35:12 PM CET Naveen Chawla wrote: >> > Thank you Claude! I did miss the point. >> > >> > Have there ever been "BC" breaks introduced into the language before? If >> > so, is there a sustainable standard for an "acceptable" one? >> > >> > On Mon, 3 Feb 2020 at 22:47, Claude Pache <claude.pache at gmail.com> >> wrote: >> > > Try typing `3 < 2 < 1` in the web console of your favourite browser, >> and >> > > see the result: it will evaluate to `true`. No, your browser isn’t >> buggy, >> > > it is just following blindly the semantics of `<`. >> > > >> > > Modifying the meaning of `3 < 2 < 1` in order to make it evaluating >> to >> > > `false` is a BC break. Is it acceptable? Dunno. >> > > >> > > —Claude >> > > >> > > Le 3 févr. 2020 à 15:23, Naveen Chawla <naveen.chwl at gmail.com> a >> écrit : >> > > >> > > Hi! >> > > >> > > I didn't understand your reply. >> > > >> > > I think currently it would raise an error, because 1 < 2 < 3 is >> currently >> > > saying (probably) true < 3. >> > > >> > > But a "new" syntax could possibly parse that as a "chain" of >> comparisons. >> > > >> > > Would this be acceptable to introduce into JavaScript (just curious)? >> > > >> > > I've probably missed your point entirely, because I saw a short >> message "3 >> > > < 2 < 1 //true", and I've assumed you meant it in reverse. >> > > >> > > On Sat, 1 Feb 2020 at 23:12, Mark S. Miller <erights at gmail.com> >> wrote: >> > >> 3 < 2 < 1; // true >> > >> >> > >> >> > >> On Sat, Feb 1, 2020 at 3:03 AM Naveen Chawla <naveen.chwl at gmail.com> >> > >> >> > >> wrote: >> > >>> Certain languages allow the expression 0<x<5. Does anybody know if >> this >> > >>> would be syntactically possible in JavaScript? Of course this would >> only >> > >>> apply for "if"/"while" statements. >> > >>> >> > >>> On Fri, 31 Jan 2020 at 22:41, Isiah Meadows < >> contact at isiahmeadows.com> >> > >>> >> > >>> wrote: >> > >>>> Still better to discuss it there - it's highly related to your >> > >>>> suggestion. And I'm pretty sure an issue already exists related to >> > >>>> that. >> > >>>> >> > >>>> On Fri, Jan 31, 2020 at 09:06 Sultan <thysultan at gmail.com> wrote: >> > >>>>> The pattern matching proposal does not handles the mentioned case: >> > >>>>> >> > >>>>> switch(type) { case 0...5: } being the equivalent of switch(type) >> { >> > >>>>> case 0: case 1: case 2: case 3: case 4: case 5: } >> > >>>>> >> > >>>>> On Fri, Jan 31, 2020 at 7:36 PM Bruno Macabeus < >> > >>>>> >> > >>>>> bruno.macabeus at gmail.com> wrote: >> > >>>>>> I agree with Oriol. >> > >>>>>> We already have the proposal pattern matching, that has a very >> > >>>>>> similar effect. >> > >>>>>> I think that is better to improve pattern matching proposal in >> order >> > >>>>>> to be able to match using ranges (or at least check if it's good >> to >> > >>>>>> do) >> > >>>>>> instead of create a new proposal. >> > >>>>>> >> > >>>>>> On Fri, 31 Jan 2020 at 14:08, Oriol _ < >> oriol-bugzilla at hotmail.com> >> > >>>>>> >> > >>>>>> wrote: >> > >>>>>>> This sounds like >> https://github.com/tc39/proposal-pattern-matching >> > >>>>>>> >> > >>>>>>> El 31/1/20 a les 10:57, Sultan ha escrit: >> > >>>>>>> >> > >>>>>>> For example, the following: >> > >>>>>>> >> > >>>>>>> switch (value) { >> > >>>>>>> >> > >>>>>>> case 0...9: break >> > >>>>>>> case 'a'...'z': break >> > >>>>>>> >> > >>>>>>> } >> > >>>>>>> >> > >>>>>>> >> > >>>>>>> _______________________________________________ >> > >>>>>>> es-discuss mailing >> > >>>>>>> listes-discuss at mozilla.orghttps:// >> mail.mozilla.org/listinfo/es-disc >> > >>>>>>> uss >> > >>>>>>> >> > >>>>>>> >> > >>>>>>> _______________________________________________ >> > >>>>>>> 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 >> > >>>>> >> > >>>>> _______________________________________________ >> > >>>>> es-discuss mailing list >> > >>>>> es-discuss at mozilla.org >> > >>>>> https://mail.mozilla.org/listinfo/es-discuss >> > >>>> >> > >>>> -- >> > >>>> ----- >> > >>>> >> > >>>> Isiah Meadows >> > >>>> contact at isiahmeadows.com >> > >>>> www.isiahmeadows.com >> > >>>> _______________________________________________ >> > >>>> 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 >> > >> >> > >> -- >> > >> >> > >> Cheers, >> > >> --MarkM >> > > >> > > _______________________________________________ >> > > es-discuss mailing list >> > > es-discuss at mozilla.org >> > > https://mail.mozilla.org/listinfo/es-discuss > > > > -- > Cheers, > --MarkM > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20200204/eb1a0cbe/attachment.html>
@kdex (sorry i missed this; your message was in my spam folder) if you find a way that Annex E is non-exhaustive, please file an issue on the spec - I would like it to be exhaustive.
@kdex (sorry i missed this; your message was in my spam folder) if you find a way that Annex E is non-exhaustive, please file an issue on the spec - I would like it to be exhaustive. On Mon, Feb 3, 2020 at 11:16 AM Naveen Chawla <naveen.chwl at gmail.com> wrote: > Thanks! Although I think it is a value judgement about how much risk is > worth how much reward, and which reward, so I wouldn't classify it as > necessarily a complete set of criteria yet, but it is certainly in the > right direction. And very interesting to me. Thank you. > > On Tue, 4 Feb 2020 at 00:40, Mark S. Miller <erights at gmail.com> wrote: > >> While correct, each case asked the browser makers to make a risky and >> costly bet. When the risk was low and the payoff high, they've been great >> at doing so. This one does not fall into the viable risk vs reward >> territory. >> >> >> On Mon, Feb 3, 2020 at 7:58 AM kdex <kdex at kdex.de> wrote: >> >>> Yes, there have been numerous backwards-incompatible changes to the >>> language >>> over the years. >>> >>> You can find a list of them in section E of the ECMAScript language >>> standard. >>> IIRC, that list is non-exhaustive. >>> >>> On Monday, February 3, 2020 6:35:12 PM CET Naveen Chawla wrote: >>> > Thank you Claude! I did miss the point. >>> > >>> > Have there ever been "BC" breaks introduced into the language before? >>> If >>> > so, is there a sustainable standard for an "acceptable" one? >>> > >>> > On Mon, 3 Feb 2020 at 22:47, Claude Pache <claude.pache at gmail.com> >>> wrote: >>> > > Try typing `3 < 2 < 1` in the web console of your favourite browser, >>> and >>> > > see the result: it will evaluate to `true`. No, your browser isn’t >>> buggy, >>> > > it is just following blindly the semantics of `<`. >>> > > >>> > > Modifying the meaning of `3 < 2 < 1` in order to make it evaluating >>> to >>> > > `false` is a BC break. Is it acceptable? Dunno. >>> > > >>> > > —Claude >>> > > >>> > > Le 3 févr. 2020 à 15:23, Naveen Chawla <naveen.chwl at gmail.com> a >>> écrit : >>> > > >>> > > Hi! >>> > > >>> > > I didn't understand your reply. >>> > > >>> > > I think currently it would raise an error, because 1 < 2 < 3 is >>> currently >>> > > saying (probably) true < 3. >>> > > >>> > > But a "new" syntax could possibly parse that as a "chain" of >>> comparisons. >>> > > >>> > > Would this be acceptable to introduce into JavaScript (just curious)? >>> > > >>> > > I've probably missed your point entirely, because I saw a short >>> message "3 >>> > > < 2 < 1 //true", and I've assumed you meant it in reverse. >>> > > >>> > > On Sat, 1 Feb 2020 at 23:12, Mark S. Miller <erights at gmail.com> >>> wrote: >>> > >> 3 < 2 < 1; // true >>> > >> >>> > >> >>> > >> On Sat, Feb 1, 2020 at 3:03 AM Naveen Chawla <naveen.chwl at gmail.com >>> > >>> > >> >>> > >> wrote: >>> > >>> Certain languages allow the expression 0<x<5. Does anybody know if >>> this >>> > >>> would be syntactically possible in JavaScript? Of course this >>> would only >>> > >>> apply for "if"/"while" statements. >>> > >>> >>> > >>> On Fri, 31 Jan 2020 at 22:41, Isiah Meadows < >>> contact at isiahmeadows.com> >>> > >>> >>> > >>> wrote: >>> > >>>> Still better to discuss it there - it's highly related to your >>> > >>>> suggestion. And I'm pretty sure an issue already exists related to >>> > >>>> that. >>> > >>>> >>> > >>>> On Fri, Jan 31, 2020 at 09:06 Sultan <thysultan at gmail.com> wrote: >>> > >>>>> The pattern matching proposal does not handles the mentioned >>> case: >>> > >>>>> >>> > >>>>> switch(type) { case 0...5: } being the equivalent of >>> switch(type) { >>> > >>>>> case 0: case 1: case 2: case 3: case 4: case 5: } >>> > >>>>> >>> > >>>>> On Fri, Jan 31, 2020 at 7:36 PM Bruno Macabeus < >>> > >>>>> >>> > >>>>> bruno.macabeus at gmail.com> wrote: >>> > >>>>>> I agree with Oriol. >>> > >>>>>> We already have the proposal pattern matching, that has a very >>> > >>>>>> similar effect. >>> > >>>>>> I think that is better to improve pattern matching proposal in >>> order >>> > >>>>>> to be able to match using ranges (or at least check if it's >>> good to >>> > >>>>>> do) >>> > >>>>>> instead of create a new proposal. >>> > >>>>>> >>> > >>>>>> On Fri, 31 Jan 2020 at 14:08, Oriol _ < >>> oriol-bugzilla at hotmail.com> >>> > >>>>>> >>> > >>>>>> wrote: >>> > >>>>>>> This sounds like >>> https://github.com/tc39/proposal-pattern-matching >>> > >>>>>>> >>> > >>>>>>> El 31/1/20 a les 10:57, Sultan ha escrit: >>> > >>>>>>> >>> > >>>>>>> For example, the following: >>> > >>>>>>> >>> > >>>>>>> switch (value) { >>> > >>>>>>> >>> > >>>>>>> case 0...9: break >>> > >>>>>>> case 'a'...'z': break >>> > >>>>>>> >>> > >>>>>>> } >>> > >>>>>>> >>> > >>>>>>> >>> > >>>>>>> _______________________________________________ >>> > >>>>>>> es-discuss mailing >>> > >>>>>>> listes-discuss at mozilla.orghttps:// >>> mail.mozilla.org/listinfo/es-disc >>> > >>>>>>> uss >>> > >>>>>>> >>> > >>>>>>> >>> > >>>>>>> _______________________________________________ >>> > >>>>>>> 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 >>> > >>>>> >>> > >>>>> _______________________________________________ >>> > >>>>> es-discuss mailing list >>> > >>>>> es-discuss at mozilla.org >>> > >>>>> https://mail.mozilla.org/listinfo/es-discuss >>> > >>>> >>> > >>>> -- >>> > >>>> ----- >>> > >>>> >>> > >>>> Isiah Meadows >>> > >>>> contact at isiahmeadows.com >>> > >>>> www.isiahmeadows.com >>> > >>>> _______________________________________________ >>> > >>>> 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 >>> > >> >>> > >> -- >>> > >> >>> > >> Cheers, >>> > >> --MarkM >>> > > >>> > > _______________________________________________ >>> > > es-discuss mailing list >>> > > es-discuss at mozilla.org >>> > > https://mail.mozilla.org/listinfo/es-discuss >> >> >> >> -- >> Cheers, >> --MarkM >> > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20200219/167b3aec/attachment.html>
For example, the following:
switch (value) { case 0...9: break case 'a'...'z': break }