Jump to page: 1 2
Thread overview
SDWest paper "Templates Revisited" now available
Mar 18, 2006
Walter Bright
Mar 18, 2006
Hasan Aljudy
Mar 18, 2006
Lars Ivar Igesund
Mar 18, 2006
Walter Bright
Re: SDWest paper
Mar 18, 2006
pragma
Mar 18, 2006
Walter Bright
Re: SDWest paper
Mar 18, 2006
Dave
Mar 18, 2006
Thomas Kuehne
Mar 18, 2006
John Demme
Mar 19, 2006
Kyle Furlong
Template specialization rules and alias parameters.
Apr 09, 2006
Bruno Medeiros
March 18, 2006
www.digitalmars.com/d/templates-revisited.html


March 18, 2006
Walter Bright wrote:
> www.digitalmars.com/d/templates-revisited.html 
> 
> 

Nice! 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 = &regexMatch!(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.

-------------------
March 18, 2006
Walter Bright wrote:

> www.digitalmars.com/d/templates-revisited.html

So, how did it go? :)
March 18, 2006
In article <dvgeh5$18j9$1@digitaldaemon.com>, Walter Bright says...
>
>www.digitalmars.com/d/templates-revisited.html
>
>

Very 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


March 18, 2006
Walter Bright wrote:

> www.digitalmars.com/d/templates-revisited.html 

Interesting 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
March 18, 2006
Dave schrieb am 2006-03-18:
> In article <dvgeh5$18j9$1@digitaldaemon.com>, Walter Bright says...
>>
>>www.digitalmars.com/d/templates-revisited.html
>>
>>
>
> Very 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.

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.d

>
> 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


March 18, 2006
"Lars Ivar Igesund" <larsivar@igesund.net> wrote in message news:dvgjoj$1nd2$1@digitaldaemon.com...
> Walter Bright wrote:
>
>> www.digitalmars.com/d/templates-revisited.html
>
> So, how did it go? :)

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.


March 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
March 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...
>> Walter Bright wrote:
>>
>>> www.digitalmars.com/d/templates-revisited.html
>>
>> So, how did it go? :)
>
>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.

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.

>
>The people who did attend, however, really enjoyed it and it was well received by them.

Fantastic.

- EricAnderton at yahoo
March 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.


« First   ‹ Prev
1 2