templates and files.

kenny funisher at gmail.com
Sun Jan 7 06:35:31 PST 2007


I was looking at h3retic's raytracer, and it got me thinking about using 
  d's templates as a parser. Seriously thinking actually. The template 
language is strong enough, do you suppose we could use some of the 
phobos file functions inside of D templates to allow for file input and 
output?

Uses I can think of off of the top of my head:

1. instead of having to store revision number in a d file, the template 
can look in .svn/entries or get the output of the linux command "date"
2. preparsed resources, including bitmaps, icons, and meshes (for games?)
3. preparsed interpreted languages (compiled DMDScript, lol?)
4. XML build script options
5. gui that is built off of an XML -- at compile time


My primary use would be to generate D code based on an external script. 
For example, I could write generic code, then have a configuration file, 
which will be parsed for the directives at compile time instead of 
execution time. Mostly thinking about #5 though.

Kenny



More information about the Digitalmars-d mailing list