You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
golang/go#28256 got closed, sadly, but that made me think about possibly implementing something like that in WDTE instead. I'd like to do it slightly differently than it was proposed in there, however.
Currently, WDTE has no support for any base other than decimal. The idea is to allow an optional prefix to a number in the form <digit>x, such as 8x. The digit given would indicated the highest digit of the base being used, so 8x would be octal, 2x would be binary, and Fx would be hex. It's likely that it'll be required to be uppercase for digits above 9.
In addition to this, underscores would be allowed to be inserted in number literals, similar to golang/go#28493, allowing the user to break up, among other things, long binary literals. A number would be required to start with at least one digit, so Fx3_2 would be legal, but Fx_32 would not.
Also, non-decimal bases will probably not be allowed for non-integers, but I'm not entirely sure yet.
The text was updated successfully, but these errors were encountered:
For my own language, I ultimately decided on 0r for an arbitrary radix (in addition to the typical well known prefixes b, o ,x used across many languages), because it's easy to remember, no potential confusion with hex literal 0x (seems weird that x can function as an arbitrary base except when 0 which actually means 16, so 0x123 and 16x123 mean the same thing o_O), and because I was already using '#' for other purposes.
golang/go#28256 got closed, sadly, but that made me think about possibly implementing something like that in WDTE instead. I'd like to do it slightly differently than it was proposed in there, however.
Currently, WDTE has no support for any base other than decimal. The idea is to allow an optional prefix to a number in the form
<digit>x
, such as8x
. The digit given would indicated the highest digit of the base being used, so8x
would be octal,2x
would be binary, andFx
would be hex. It's likely that it'll be required to be uppercase for digits above 9.In addition to this, underscores would be allowed to be inserted in number literals, similar to golang/go#28493, allowing the user to break up, among other things, long binary literals. A number would be required to start with at least one digit, so
Fx3_2
would be legal, butFx_32
would not.Also, non-decimal bases will probably not be allowed for non-integers, but I'm not entirely sure yet.
The text was updated successfully, but these errors were encountered: