Why not used a tagged template literal, as in

```
base32`123EFG`
```

Bob


On Mon, Oct 8, 2018 at 1:05 PM kdex <[email protected]> wrote:

> Sorry, but I highly doubt that it's worth reserving syntax for two bases
> for
> which even the author suggests their lesser usefulness.
>
> This is best kept in user-space. Base-4 numbers should already be covered
> by
> this[1] proposal.
>
> As for base 32, Carsten has already pointed out the problem of non-unique
> encodings (and this is true for every radix greater than 10).
>
> If (your specific encoding of) base-32 literals were to be implemented in
> user-space, I think we could get away with extensible string literals,
> i.e.
> something akin to:
>
> ```js
> const base32 = string => { /* …  */ };
> console.log("10"_base32); // logs 32
> ```
>
> [1] https://github.com/tc39/proposal-extended-numeric-literals
>
> On Monday, October 8, 2018 2:51:04 AM CEST Shaun Moss wrote:
> > Hi all
> >
> > I'm new to the list so please forgive me if I breach etiquette.
> >
> > I have drafted a proposal for addition to the ES spec:
> >
> https://github.com/mossy2100/ecmascript/blob/master/base4and32literals.md
> >
> > If anyone has a few spare minutes, I'd be grateful if you could please
> give
> > it a quick look over. I'd really appreciate any feedback on how to
> improve
> > or advance it. I haven't looked into implementation details yet but I
> will
> > soon.
> >
> > Thank you
> > Shaun_______________________________________________
> 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