Regarding the proposed Binray Literals Deprecation

mw mingwu at gmail.com
Sat Sep 10 20:43:29 UTC 2022


On Saturday, 10 September 2022 at 20:12:05 UTC, mw wrote:
> I'm fine with: (e.g. uint32)
>

Actually I just realized this is a good example, so I align this 
two literals here:

```
0b0000_0110_0110_0110_0110_0110_0110_0110
  "...._.XX._.XX._.XX._.XX._.XX._.XX._.XX."

```

Can we have a poll here? which is more readable for uint32?

1) the binary literal
2) the string literal


And I have another argument for *NOT* deprecating binary 
literals, let's talk about int binary literal => string repr => 
int round trip: many of people (including me) write some kind of 
code generators / formatters sometime, so the builtin "%b" format 
char:

```
   writeln(format("%b", 0xcc));  // output 11001100

```

For the round trip, it can be easily convert back to int again.

Now, how much more work I need to do to make those string 
"XX..XX.." works in such round-trip?!



More information about the Digitalmars-d mailing list