Regarding the proposed Binray Literals Deprecation
H. S. Teoh
hsteoh at qfbox.info
Sun Sep 11 00:41:54 UTC 2022
On Sat, Sep 10, 2022 at 11:57:51PM +0200, Timon Gehr via Digitalmars-d wrote:
[...]
> Which situation is the simplest one?
>
> a)
>
> 0x... for hexadecimal
> 0o... for octal
> 0b... for binary
>
>
> b)
>
> 0x... for hexadecimal
> std.conv.octal!"..." for octal
> 0b"..." for binary
>
>
> c)
>
> 0x... for hexadecimal
> std.conv.octal!"..." for octal
> std.conv.binary!"..." for binary
There's also:
d)
std.conv.hex!"..." for hexadecimal
std.conv.octal!"..." for hexadecimal
std.conv.binary!"..." for hexadecimal
Which, judging by the way things are going, is where we're headed. The
logical conclusion of which is:
e)
std.conv.hex!"..." for hexadecimal
std.conv.octal!"..." for hexadecimal
std.conv.binary!"..." for hexadecimal
std.conv.decimal!"..." for decimal - because the language becomes *much*
simpler when it doesn't natively support any integer literals at
all.
:-P
T
--
Being able to learn is a great learning; being able to unlearn is a greater learning.
More information about the Digitalmars-d
mailing list