www.digitalmars.com         C & C++   DMDScript  

D - dmd 0.40 release

reply "Walter" <walter digitalmars.com> writes:
Implemented templates.

ftp://ftp.digitalmars.com/dmdalpha.zip

Not well tested :-( just proof of concept.
Sep 08 2002
next sibling parent reply Patrick Down <pat codemoon.com> writes:
"Walter" <walter digitalmars.com> wrote in news:alglfa$6l0$1
 digitaldaemon.com:

 Implemented templates.
 
 ftp://ftp.digitalmars.com/dmdalpha.zip
 
 Not well tested :-( just proof of concept.
 
 
It not a template bug. But I've found the following problem. The following program incorrectly prints: Inside: 12,34 Outside: 14,11 struct Size { int width; int height; } Size computeSize() { Size foo; foo.width = 12; foo.height = 34; printf("Inside: %d,%d\n",foo.width,foo.height); return foo; } int main(char[][] argv) { Size bar; bar = computeSize(); printf("Outside: %d,%d\n",bar.width,bar.height); return 0; }
Sep 08 2002
parent "Walter" <walter digitalmars.com> writes:
"Patrick Down" <pat codemoon.com> wrote in message
news:Xns9283ED9A04DDBpatcodemooncom 63.105.9.61...
 It not a template bug.  But I've found the
 following problem.  The following program
 incorrectly prints:
Thanks, I have it fixed now. It'll go out in the next update.
Sep 08 2002
prev sibling parent reply "anderson" <anderson firestar.com.au> writes:
That was fast! D really moving along.


"Walter" <walter digitalmars.com> wrote in message
news:alglfa$6l0$1 digitaldaemon.com...
 Implemented templates.

 ftp://ftp.digitalmars.com/dmdalpha.zip

 Not well tested :-( just proof of concept.
Sep 09 2002
parent "Walter" <walter digitalmars.com> writes:
"anderson" <anderson firestar.com.au> wrote in message
news:alhk11$2k80$1 digitaldaemon.com...
 That was fast! D really moving along.
 "Walter" <walter digitalmars.com> wrote in message
 news:alglfa$6l0$1 digitaldaemon.com...
 Implemented templates.
There's about 1/4th as much code to do templates in D as opposed to templates in C++ ! The savings came from: 1) explicit, rather than implicit, instantiation 2) being about to group related declarations under one template declaration 3) elimination of the nuisance of const/volatile in type deduction 4) elimination of template parsing/lexical ambiguities 5) elimination of overloading rules between template and non-template functions 6) elimination of the type dependent and type independent name lookup rules One thing I kept was the brilliant C++ partial specialization idea. Stripped of the complexity of the C++ version, it is marvelous how slick it works. Of course, since nobody has yet attempted to build a D STL, I might be all screwed up here. We'll see.
Sep 09 2002