[dmd-internals] How important are the exact formats of __DATE__, __TIME__, and __TIMESTAMP___?

Jonathan M Davis jmdavisProg at gmx.com
Tue Mar 8 20:09:48 PST 2011


On Tuesday 08 March 2011 19:55:28 Benjamin Shropshire wrote:
> On 03/08/2011 07:36 PM, Jonathan M Davis wrote:
> > Do they _have_ to be in a particular format? I ask because I've slowly
> > been going through the lexer code, translating it to D for
> > std.lang.d.lex, and I'm very tempted to just use std.datetime to produce
> > the values for __DATE__, __TIME__, __TIMESTAMP__. The resulting values
> > would look cleaner IMHO, and the code would be simpler. However, that
> > _would_ result in a slightly different format for __DATE__ and
> > __TIMESTAMP__.
> > 
> > Honestly, I didn't even know that these "macros" existed before I ran
> > into them in the lexer - there's no mention of them on the site as far
> > as I can determine.
> 
> http://www.digitalmars.com/d/2.0/lex.html#specialtokens
> 
> That also sets the format.

Bleh. Okay. I'd have preferred to just use std.datetime's format, but such is 
life. And obviously the search function on the site doesn't search the language 
documentation, since I specifically searched for all of those special tokens, and 
the search didn't find any of them.

In any case, thanks for pointing that out to me.

- Jonathan M Davis


More information about the dmd-internals mailing list