d at domenic.me (2015-06-16T16:45:42.086Z)
Independent of the current issue, I just want to go on record stating that dynamically scoped variables are a "cure" worse than any disease we might think to apply them to. Avoid at all costs.
Independent of the current issue, I just want to go on record stating that dynamically scoped variables are a "cure" worse than any disease we might think to apply them to. Avoid at all costs.
Independent of the current issue, I just want to go on record stating that dynamically scoped variables are a "cure" worse than any disease we might think to apply them to. Avoid at all costs. On Wed, Jun 10, 2015 at 8:44 AM, C. Scott Ananian <ecmascript at cscott.net> wrote: > I don't agree that @@species is useful at all for changing constructor > signatures, since there is no closure argument. > > If we had dynamically scoped variables, then: > ``` > LabelledPromise[Symbol.species] = function() { return > LabelledPromise.bind(label/*dynamically scoped*/); }; > function() { > let label = "foo"; > return LabelledPromise.resolve(x); > } > ``` > would indeed be very interesting. But in the absence of some sort of > closure, the only way you can make @@species into a custom constructor is > for odd special cases where you are just rearranging deck chairs. > > Why not: > ``` > class LabelledPromise { > constructor(exec, label) { > super(exec); > this.label = label === undefined ? "<derived promise>" : label; > } > } > ``` > --scott > > > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > > -- Text by me above is hereby placed in the public domain Cheers, --MarkM -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150610/8b452053/attachment-0001.html>