tc39 / proposal-extended-numeric-literals

Extensible numeric literals for JavaScript
https://tc39.github.io/proposal-extended-numeric-literals/
72 stars 18 forks source link

Overlap with strongly-typed literal proposal (and maybe pattern matching?) #6

Open dead-claudia opened 6 years ago

dead-claudia commented 6 years ago

I noticed some similarities between this (esp. if #3 is allowed) and the strongly-typed literal proposal, and thought these could potentially inform each other. In particular, you could use extensible literals instead of createFromLiteral for the general case, making that idiomatic and the escape hatch much more glaringly obvious.

Oh, and also, the possible "extensible map/array literals" has even more overlap with the pattern matching proposal, where if you extend that with the obvious extensible destructuring, such extensible map/array literals are effectively the opposite of that (and have come up more than once in that proposal's issues).

littledan commented 6 years ago

Yes, there's an intersection with the strongly typed literals proposal. We could give the object here an internal slot to brand it as a literal, making this proposal (possibly) more useful. This is something to add to the explainer.

I'm going to leave extensible map/array literals for a future proposal and out of scope for this one.