Template news (2012+)

Philippe Sigaud philippe.sigaud at gmail.com
Fri Jan 4 07:28:03 PST 2013


I've a tutorial on templates here:

https://github.com/PhilippeSigaud/D-templates-tutorial

For the past few days, I transformed the LaTeX files into 
markdown files, which can then generate pdf, epub and html. 
Everything works well, that's cool [1]. I'm following Walter's 
advice from a year ago to provide text for people using 
e-readers/tablets.

This post is not really an announce :) I'm correcting bugs & 
mistakes and seeing the good work the developers put into DMD. 
Several things that were flagged as impossible or buggy when I 
wrote the tutorial a year ago are now possible. Many other things 
have changed on the template front in 2012 and I need help to 
list them all, so as to update my doc.

So, here is my own small list:

- is(Type name = A!(Args), Args...) now exists. The Args... part 
is new.
- the new (a,b) => a+b syntax was introduced
- the eponymous trick works even when other non-eponymous members 
are defined
- error reporting got better
- CTFE got better.
- auto ref?
- __ctfe. I think it arrived just when I wrote the doc. I've now 
used it and it works great!
- UFCS: not a template feature per se, but quite useful in 
conjunction with templates.
- UDA. ditto, except I know zilch about them. But, type & value 
manipulation at compile-time, them I know.


Other changes I'm not sure and that should be tested:

- any change on __LINE__ and __FILE__?
- any change for mixin templates?


Do any of you see missing feature/modification that happened in 
2012(-2013)?


Philippe

[1] I'm using pandoc to convert .md into .pdf, .epub, .mobi and 
.html and it works quite well. Also, its extended markdown syntax 
is nice. Here is an example of a real-world Haskell executable...



More information about the Digitalmars-d mailing list