Regarding the proposed Binray Literals Deprecation

Walter Bright newshound2 at digitalmars.com
Sun Sep 11 20:11:36 UTC 2022


On 9/11/2022 12:02 AM, Max Samukha wrote:
> As I said, we could do it differently, but binary literals + comments are just 
> optimal for our use case.

You could do the 7 segment as:

enum ubyte[16] =
[
segment!"
   -
  | |
  | |
   -
",
segment!"
    |
    |
",
segment!"
   -
    |
   -
  |
   -
",
..
];

or even:

enum ubyte[16] = segment!"
  -        -   -
| |    |   |   |
           -   -
| |    | |     |
  -        -   -
";


D is ideal for doing micro-DSLs like this.



More information about the Digitalmars-d mailing list