Foolproof HTML
> If you have a good strategy for validating your template files, I'd love to hear it!Use S-expression syntax instead of SGML syntax, i.e. instead of:contentwrite((tag attr value ...) content)and use Lisp to process it.  It's actually quite straightforward.  You can apply it to XML as well.  Everything actually ends up looking a lot prettier this way.See http://weitz.de/cl-who/ for an example of an implemented system that works this way.  I've been using it in production for years.  It works like a charm.