Const sucks

0ffh spam at frankhirsch.net
Tue Sep 11 10:28:38 PDT 2007


Janice Caron wrote:
> I dislike your macro idea, because I want my consts to have a type. I
> /like/ type safety, and I want to keep it. I want my constants to be
> of the type I declare them to be, not just a piece of text.

Hmmmm... if I got that right, macros will definitely *not* be "pieces
of text", but abstract syntax trees.
So, if you'd do "macro x=5;" (or whatever the macro syntax will be),
and you try `char[] s="abc"~x;` you'll get a nice, clean type error.

	As you liek it! :)

regards, Frank



More information about the Digitalmars-d mailing list