<br><br><div class="gmail_quote">On Sun, Mar 14, 2010 at 21:29, Walter Bright <span dir="ltr"><<a href="mailto:newshound1@digitalmars.com">newshound1@digitalmars.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">Philippe Sigaud wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
1- thanks Walter for opening new vistas to me. Doing templated code<br>
in D is so fun and powerful that you transformed forever the way I<br>
look at problems.<br>
</blockquote>
<br></div>
Years ago, although I had implemented templates for C++, I didn't "get" them. Not at all. I didn't even plan to put templates in D, because they seemed overly complex, ugly, and had little value.<br></blockquote>
<div><br>That's interesting to know that you could implement templates, without understanding them.<br> <br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I eventually realized that what was preventing me from understanding C++ templates was the syntax. Change the syntax, and what is happening suddenly becomes obvious.<br>
(snip)<br>
Yes, it looks like a trivial change, and perhaps it is. But it makes a world of difference, because it now looks like something I do get - a parameter list to something.<br></blockquote><div><br>That's my first 15' with D right there, Walter.<br>
It may be due to my not knowing what 'template' means in English at the time I was exposed to them in C++. But reading the D docs, it became clear that they were just 'potential code', waiting to be created, with parameters governing what could happen.<br>
<br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I had another epiphany from watching Scott Meyers give a presentation about an application for templated type lists in C++. Nearly the full hour was spent detailing a titanic struggle with the syntax. I suddenly realized that the whole presentation would have been over in 5 minutes if the syntax of type lists was simply that of an array of types. We already understand arrays of values, so why should an array of types be any different?<br>
</blockquote><div><br>Seconded, and thanks again for making that accessible.<br>I was looking at Boost MPL (Meta-Programming Library) a few days ago, and thinking "How complicated the C++ syntax makes all this". I consider the MPL one of the most impressive part of Boost, but I don't think I'll ever use it. I have trouble extracting the intent among all the syntactic noise.<br>
<br>Whereas in D, the first time I read some of Andrei's templates, (something akin to staticMap!(Unqual, Types)) the meaning was clear.<br><br>The third 'leg' on which D templates rest is the alias parameters. I can have access to any symbol, including other templates? Oh yes!<br>
<br><br> Philippe<br><br></div></div>