digitalmars.D.announce - SDWest paper "Templates Revisited" now available
- Walter Bright (1/1) Mar 17 2006 www.digitalmars.com/d/templates-revisited.html
- Hasan Aljudy (27/30) Mar 18 2006 Nice! not that I'm into templates or anything ..
- Lars Ivar Igesund (2/3) Mar 18 2006 So, how did it go? :)
- Walter Bright (8/11) Mar 18 2006 It wasn't well attended because the conference people scheduled it at th...
- pragma (6/19) Mar 18 2006 Yikes, who was the brainiac that devised that schedule?! That's a sham...
- Walter Bright (3/6) Mar 18 2006 You did the work, Eric. Of course you'll get the credit.
- Dave (31/32) Mar 18 2006 Very cool stuff!
- Thomas Kuehne (72/85) Mar 18 2006 -----BEGIN PGP SIGNED MESSAGE-----
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (7/8) Mar 18 2006 Interesting paper, it really makes me wish that the
- John Demme (6/7) Mar 18 2006 "Printf Revisited".... "Templates Revisited"... Will your book on D
- Kyle Furlong (2/13) Mar 19 2006 That would be fantastic, I think if we could all do things like this it ...
- Bruno Medeiros (32/32) Apr 09 2006 Both in the D doc, and in
www.digitalmars.com/d/templates-revisited.html
Mar 17 2006
Walter Bright wrote:www.digitalmars.com/d/templates-revisited.htmlNice! not that I'm into templates or anything .. note: somethings are duplicated, for example, this segment: ------- Partial and explicit specialization work as they do in C++, except that there is no notion of a 'primary' template in D. All the templates with the same name are examined upon template instantiation, and the one with the best fit of arguments to parameters is instantiated. Specialization Partial and explicit specialization work as they do in C++, except that there is no notion of a 'primary' template. All the templates with the same name are examined upon template instantiation, and the one with the best fit of arguments to parameters is instantiated. -------------- and this one: ---------- import std.stdio; import regex; void main() { auto exp = ®exMatch!(r"[a-z]*\s*\w*"); writefln("matches: %s", exp("hello world")); } What follows is a cut-down version of Eric Andertons regex compiler. It is just enough to compile the regular expression above, serving to illustrate how it is done. -------------------
Mar 18 2006
Walter Bright wrote:www.digitalmars.com/d/templates-revisited.htmlSo, how did it go? :)
Mar 18 2006
"Lars Ivar Igesund" <larsivar igesund.net> wrote in message news:dvgjoj$1nd2$1 digitaldaemon.com...Walter Bright wrote:It wasn't well attended because the conference people scheduled it at the same time as David Abraham's talk on templates *and* Stephen Dewhurst's template class. Anyone interested in template programming would have had a hard time picking between the three. The people who did attend, however, really enjoyed it and it was well received by them.www.digitalmars.com/d/templates-revisited.htmlSo, how did it go? :)
Mar 18 2006
In article <dvhesn$2u2t$1 digitaldaemon.com>, Walter Bright says..."Lars Ivar Igesund" <larsivar igesund.net> wrote in message news:dvgjoj$1nd2$1 digitaldaemon.com...Yikes, who was the brainiac that devised that schedule?! That's a shame. Well, as they say: "there's no such thing as bad publicity". And with that, I am *very* grateful that you cited me in your paper. Thank you Walter.Walter Bright wrote:It wasn't well attended because the conference people scheduled it at the same time as David Abraham's talk on templates *and* Stephen Dewhurst's template class. Anyone interested in template programming would have had a hard time picking between the three.www.digitalmars.com/d/templates-revisited.htmlSo, how did it go? :)The people who did attend, however, really enjoyed it and it was well received by them.Fantastic. - EricAnderton at yahoo
Mar 18 2006
"pragma" <pragma_member pathlink.com> wrote in message news:dvhufj$i4c$1 digitaldaemon.com...Well, as they say: "there's no such thing as bad publicity". And with that, I am *very* grateful that you cited me in your paper. Thank you Walter.You did the work, Eric. Of course you'll get the credit.
Mar 18 2006
In article <dvgeh5$18j9$1 digitaldaemon.com>, Walter Bright says...www.digitalmars.com/d/templates-revisited.htmlVery cool stuff! For v0.149, I had to change 'const sqrt' to 'const real sqrt' and 'const hash' to 'const real hash' for those examples. Also on Linux for the sqrt example, I'm getting these linker errors: t.o(.gnu.linkonce.d._D1t38__T4sqrtVi2Vee78d9befa33f304b5ff3fVi4Z4sqrte+0x0): multiple definition of `_D1t38__T4sqrtVi2Vee78d9befa33f304b5ff3fVi4Z4sqrte' t.o(.gnu.linkonce.d._D1t38__T4sqrtVi2Vee78d9befa33f304b5ff3fVi4Z4sqrte+0x0): first defined here t.o(.gnu.linkonce.d._D1t38__T4sqrtVi2Vee05050505050505b5ff3fVi3Z4sqrte+0x0): multiple definition of `_D1t38__T4sqrtVi2Vee05050505050505b5ff3fVi3Z4sqrte' t.o(.gnu.linkonce.d._D1t38__T4sqrtVi2Vee05050505050505b5ff3fVi3Z4sqrte+0x0): first defined here t.o(.gnu.linkonce.d._D1t38__T4sqrtVi2Vee56555555555555b5ff3fVi2Z4sqrte+0x0): multiple definition of `_D1t38__T4sqrtVi2Vee56555555555555b5ff3fVi2Z4sqrte' t.o(.gnu.linkonce.d._D1t38__T4sqrtVi2Vee56555555555555b5ff3fVi2Z4sqrte+0x0): first defined here t.o(.gnu.linkonce.d._D1t38__T4sqrtVi2Vee05050505050505b5ff3fVi3Z4sqrte+0x0): multiple definition of `_D1t38__T4sqrtVi2Vee05050505050505b5ff3fVi3Z4sqrte' t.o(.gnu.linkonce.d._D1t38__T4sqrtVi2Vee05050505050505b5ff3fVi3Z4sqrte+0x0): first defined here t.o(.gnu.linkonce.d._D1t38__T4sqrtVi2Vee00000000000000c0ff3fVi1Z4sqrte+0x0): multiple definition of `_D1t38__T4sqrtVi2Vee00000000000000c0ff3fVi1Z4sqrte' t.o(.gnu.linkonce.d._D1t38__T4sqrtVi2Vee00000000000000c0ff3fVi1Z4sqrte+0x0): first defined here t.o(.gnu.linkonce.d._D1t38__T4sqrtVi2Vee56555555555555b5ff3fVi2Z4sqrte+0x0): multiple definition of `_D1t38__T4sqrtVi2Vee56555555555555b5ff3fVi2Z4sqrte' t.o(.gnu.linkonce.d._D1t38__T4sqrtVi2Vee56555555555555b5ff3fVi2Z4sqrte+0x0): first defined here Thanks, - Dave
Mar 18 2006
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dave schrieb am 2006-03-18:In article <dvgeh5$18j9$1 digitaldaemon.com>, Walter Bright says...Added to DStress as http://dstress.kuehne.cn/run/a/auto_17_A.d http://dstress.kuehne.cn/run/a/auto_17_B.d http://dstress.kuehne.cn/run/a/auto_17_C.d http://dstress.kuehne.cn/run/a/auto_17_D.d http://dstress.kuehne.cn/run/a/auto_17_E.d http://dstress.kuehne.cn/run/a/auto_17_F.d http://dstress.kuehne.cn/run/c/const_36_A.d http://dstress.kuehne.cn/run/c/const_36_B.d http://dstress.kuehne.cn/run/c/const_36_C.d http://dstress.kuehne.cn/run/c/const_36_D.d http://dstress.kuehne.cn/run/c/const_36_E.d http://dstress.kuehne.cn/run/c/const_36_F.d http://dstress.kuehne.cn/run/c/const_36_G.d http://dstress.kuehne.cn/run/c/const_36_H.d http://dstress.kuehne.cn/run/c/const_36_I.d http://dstress.kuehne.cn/run/c/const_37_A.d http://dstress.kuehne.cn/run/c/const_37_B.d http://dstress.kuehne.cn/run/c/const_37_C.d http://dstress.kuehne.cn/run/c/const_37_D.d http://dstress.kuehne.cn/run/c/const_37_E.d http://dstress.kuehne.cn/run/c/const_37_F.d http://dstress.kuehne.cn/run/s/static_36_A.d http://dstress.kuehne.cn/run/s/static_36_B.d http://dstress.kuehne.cn/run/s/static_36_C.d http://dstress.kuehne.cn/run/s/static_36_D.d http://dstress.kuehne.cn/run/s/static_36_E.d http://dstress.kuehne.cn/run/s/static_36_F.dwww.digitalmars.com/d/templates-revisited.htmlVery cool stuff! For v0.149, I had to change 'const sqrt' to 'const real sqrt' and 'const hash' to 'const real hash' for those examples.Also on Linux for the sqrt example, I'm getting these linker errors: t.o(.gnu.linkonce.d._D1t38__T4sqrtVi2Vee78d9befa33f304b5ff3fVi4Z4sqrte+0x0): multiple definition of `_D1t38__T4sqrtVi2Vee78d9befa33f304b5ff3fVi4Z4sqrte' t.o(.gnu.linkonce.d._D1t38__T4sqrtVi2Vee78d9befa33f304b5ff3fVi4Z4sqrte+0x0): first defined here[snip] Added to DStress as http://dstress.kuehne.cn/run/t/template_32_A.d http://dstress.kuehne.cn/run/t/template_32_B.d http://dstress.kuehne.cn/run/t/template_32_C.d http://dstress.kuehne.cn/run/t/template_32_D.d http://dstress.kuehne.cn/run/t/template_32_E.d http://dstress.kuehne.cn/run/t/template_32_F.d http://dstress.kuehne.cn/run/t/template_32_G.d http://dstress.kuehne.cn/run/t/template_32_H.d http://dstress.kuehne.cn/run/t/template_32_I.d http://dstress.kuehne.cn/run/t/template_32_J.d http://dstress.kuehne.cn/run/t/template_32_K.d http://dstress.kuehne.cn/run/t/template_32_L.d http://dstress.kuehne.cn/run/t/template_32_M.d http://dstress.kuehne.cn/run/t/template_32_N.d http://dstress.kuehne.cn/run/t/template_32_O.d http://dstress.kuehne.cn/run/t/template_32_P.d http://dstress.kuehne.cn/run/t/template_32_Q.d http://dstress.kuehne.cn/run/t/template_32_R.d http://dstress.kuehne.cn/run/t/template_32_S.d http://dstress.kuehne.cn/run/t/template_32_T.d http://dstress.kuehne.cn/run/t/template_32_U.d http://dstress.kuehne.cn/run/t/template_33_A.d http://dstress.kuehne.cn/run/t/template_33_B.d http://dstress.kuehne.cn/run/t/template_33_C.d http://dstress.kuehne.cn/run/t/template_33_D.d http://dstress.kuehne.cn/run/t/template_33_E.d http://dstress.kuehne.cn/run/t/template_33_F.d http://dstress.kuehne.cn/run/t/template_33_G.d http://dstress.kuehne.cn/run/t/template_33_H.d http://dstress.kuehne.cn/run/t/template_33_I.d Might be related: http://dstress.kuehne.cn/www/dstress.html#template_class_14_A http://dstress.kuehne.cn/www/dstress.html#template_struct_05_C Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFEHCsF3w+/yD4P9tIRAntDAJ43e56qVZMg55mlvm1Gl5id6oULIQCfZ10c /s1LswTx9HzYhGPnTK91xkA= =NBdW -----END PGP SIGNATURE-----
Mar 18 2006
Walter Bright wrote:www.digitalmars.com/d/templates-revisited.htmlInteresting paper, it really makes me wish that the templates were actually working on my Mac OS X 10.3... It's working with GCC 4.x, just that I'm not there yet. (guess we need a port for GCC 3.x, from Apple's sources) So for now, I'll just have to stay clear of them... :-( --anders
Mar 18 2006
Walter Bright wrote:www.digitalmars.com/d/templates-revisited.html"Printf Revisited".... "Templates Revisited"... Will your book on D programming be called "Programming Revisited"? Good stuff, BTW. I may be doing your NW C++ presentation for my LUG here at University of Maryland, and follow it up with this one. ~John Demme
Mar 18 2006
John Demme wrote:Walter Bright wrote:That would be fantastic, I think if we could all do things like this it would really help to evangelize.www.digitalmars.com/d/templates-revisited.html"Printf Revisited".... "Templates Revisited"... Will your book on D programming be called "Programming Revisited"? Good stuff, BTW. I may be doing your NW C++ presentation for my LUG here at University of Maryland, and follow it up with this one. ~John Demme
Mar 19 2006
Both in the D doc, and in www.digitalmars.com/d/templates-revisited.html the rules about template specialization are omissive about alias parameters. I think a clarification is important, even more because the actual behavior seems a bit strange to me. See the code below. class Foo { } class FooBar : Foo {} template Xpto(T:FooBar) { int a = 1; } template Xpto(alias T) { int a = 2; } template Xpto(T:Foo) { int a = 3; } template Xpto(T) { int a = 4; } int main(char[][] args) { writefln( Xpto!(FooBar).a ); } The templates are shown ordered according to the order of preference in which they are chosen to specialize the Xpto!(FooBar) instance. As you can see the alias parameter is in the middle of the preference order, which seems strange to me. Shouldn't it be the first, or the last? (the last more likely, since it is less specific than a type parameter) -- Bruno Medeiros - CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
Apr 09 2006