DMD 1.013 release

jcc7 technocrat7 at gmail.com
Fri Apr 20 05:53:03 PDT 2007


== Quote from Roberto Mariottini (rmariottini at mail.com)'s article
> Walter Bright wrote:
> > Bug fixes, some of them rather nasty.
> >
> > http://www.digitalmars.com/d/changelog.html
>  > Issue #1147: Typo in phobos/std/file.d: 4069 should be 4096
>  >
>  > phobos/std/file.d line 1422:
>  >     size_t BUFSIZ = 4069 * 16;
> What about having some predefined suffix to represent common two's powers?
> int x = 4_k; // == 4 * 1024   == 4_096
> int y = 8_M; // == 8 * 1024_k == 8_388_608
> int z = 2_G; // == 2 * 1024_M == 2_147_483_648
> and obviously:
> size_t BUFSIZ = 16 * 4_k;
> This could prevent many typos.
> Ciao

Or how about just use CTFE with a power function? Let's put our new toys to use.

I guess it'll take a little longer to compile, but I think the extra time would be
worth it to gain code clarity (and I think that clear code is less likely to have
typos).

jcc7



More information about the Digitalmars-d-announce mailing list