70 changes: 35 additions & 35 deletions templates-revisited.dd
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ a<b<c>>d;

$(P
are syntactically ambiguous, both to the compiler and the programmer.
If you run across $(TT a<b,c>d;) in unfamiliar code, you've got to slog through
an arbitrarily large amount of declarations and $(TT .h) files to figure out
If you run across $(D a<b,c>d;) in unfamiliar code, you've got to slog through
an arbitrarily large amount of declarations and $(D .h) files to figure out
if it is a template or not.
How much effort has been expended by programmers, compiler writers, and
language standard writers to deal with this?
)

$(P
There's got to be a better way. D solves it by noticing that ! is not used
as a binary operator, so replacing:
Expand All @@ -95,7 +95,7 @@ a!(b,c)
$(P
is syntactically unambiguous. This makes it easy to parse, easy to generate
reasonable error messages for, and makes it easy for someone inspecting the
code to determine that yes, $(TT a) must be a template.
code to determine that yes, $(D a) must be a template.
)


Expand Down Expand Up @@ -137,7 +137,7 @@ template Foo(T, U)
----

$(P
The $(TT Foo) forms a name space for the templates, which are accessed by,
The $(D Foo) forms a name space for the templates, which are accessed by,
for example:
)

Expand Down Expand Up @@ -193,7 +193,7 @@ definition, and an exported template.
Because D has a true module system, rather than textual #include files,
there are only template definitions in D. The need for template declarations
and export is irrelevant. For example, given a template definition in
module $(TT A):
module $(D A):
)

---
Expand All @@ -206,7 +206,7 @@ template Foo(T)
---

$(P
it can be accessed from module $(TT B) like:
it can be accessed from module $(D B) like:
)

---
Expand Down Expand Up @@ -394,7 +394,7 @@ template<int n> class factorial
enum
{
result = n * factorial<n - 1>::result
};
};
};

template<> class factorial<1>
Expand Down Expand Up @@ -427,7 +427,7 @@ template factorial(int n : 1)

void test()
{
writefln(factorial!(4)); // prints 24
writefln(factorial!(4)); // prints 24
}
---

Expand All @@ -448,11 +448,11 @@ template factorial(int n)

$(P
reducing 13 lines of code to an arguably much cleaner 7 lines.
$(TT static if)'s are the equivalent of C++'s $(TT #if).
But $(TT #if) cannot access template
$(D static if)'s are the equivalent of C++'s $(D #if).
But $(D #if) cannot access template
arguments, so all template conditional compilation must be handled with
partial and explicitly specialized templates.
$(TT static if) dramatically simplifies
$(D static if) dramatically simplifies
such constructions.
)

Expand Down Expand Up @@ -503,14 +503,14 @@ void test()
)

$(P
Template $(TT IsFunctionT) relies on two side effects to achieve its result.
Template $(D IsFunctionT) relies on two side effects to achieve its result.
First, it relies on arrays of functions being an invalid C++ type.
Thus, if $(TT U) is a function type, the second $(TT test) will not be selected
Thus, if $(D U) is a function type, the second $(D test) will not be selected
since to do so would cause an error ($(SFINAE)).
The first $(TT test) will be selected.
If $(TT U) is not a function type, the second $(TT test) is a better fit than ... .
Next, it is determined which $(TT test) was selected by examining the size
of the return value, i.e. $(TT sizeof(One)) or $(TT sizeof(Two)).
The first $(D test) will be selected.
If $(D U) is not a function type, the second $(D test) is a better fit than ... .
Next, it is determined which $(D test) was selected by examining the size
of the return value, i.e. $(D sizeof(One)) or $(D sizeof(Two)).
Unfortunately, template metaprogramming in C++ often seems to be relying
on side effects rather than being able to expressly code what is desired.
)
Expand All @@ -537,10 +537,10 @@ void test()
---

$(P
The $(TT is(T[])) is the equivalent of $(SFINAE).
It tries to build an array of $(TT T),
and if $(TT T) is a function type, it is an array of functions. Since this is
an invalid type, the $(TT T[]) fails and $(TT is(T[])) returns false.
The $(D is(T[])) is the equivalent of $(SFINAE).
It tries to build an array of $(D T),
and if $(D T) is a function type, it is an array of functions. Since this is
an invalid type, the $(D T[]) fails and $(D is(T[])) returns false.
)

$(P
Expand All @@ -562,7 +562,7 @@ void test()
$(P
Let's move on to things that are impractical with templates in C++.
For example, this template returns the square root of
real number $(TT x) using the Babylonian method:
real number $(D x) using the Babylonian method:
)

---
Expand Down Expand Up @@ -629,16 +629,16 @@ converts an integer to a string at compile time:
template decimalDigit(int n) // [3]
{
const string decimalDigit = "0123456789"[n..n+1];
}
}

template itoa(long n)
{
{
static if (n < 0)
const string itoa = "-" ~ itoa!(-n);
const string itoa = "-" ~ itoa!(-n);
else static if (n < 10)
const string itoa = decimalDigit!(n);
const string itoa = decimalDigit!(n);
else
const string itoa = itoa!(n/10L) ~ decimalDigit!(n%10L);
const string itoa = itoa!(n/10L) ~ decimalDigit!(n%10L);
}

string foo()
Expand Down Expand Up @@ -864,7 +864,7 @@ template parseTextToken(string pattern)
else
const string parseTextToken =
pattern[0..1] ~ parseTextToken!(pattern[1..$]);
}
}
else
const string parseTextToken="";
}
Expand Down Expand Up @@ -918,7 +918,7 @@ template parseUntil(string pattern,char terminator,bool fuzzy=false)
terminator ~
" to terminate group expression");
static assert(false);
}
}
}

/**
Expand Down Expand Up @@ -948,7 +948,7 @@ template regexCompileCharClass2(string pattern)
{
pragma(msg,
"Error: expected char following '-' in char class");
static assert(false);
static assert(false);
}
}
else // not '-'
Expand Down Expand Up @@ -1011,7 +1011,7 @@ template regexCompileCharClassRecurse(alias termFn,string pattern)
*/

template regexCompileCharClass(string pattern)
{
{
static if (pattern.length > 0)
{
static if (pattern[0] == ']')
Expand All @@ -1029,7 +1029,7 @@ template regexCompileCharClass(string pattern)
else
{
pragma(msg,"Error: expected closing ']' for character class");
static assert(false);
static assert(false);
}
}

Expand Down Expand Up @@ -1129,10 +1129,10 @@ template regexCompile(string pattern)
const string next = pattern[token.length .. $];
alias testText!(token) test;
}

alias regexCompilePredicate!(test, next) term;
const string remaining = next[term.consumed .. next.length];

alias regexCompileRecurse!(term,remaining).fn fn;
}
else
Expand Down
4 changes: 2 additions & 2 deletions todo.dd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $(P Want to contribute to D? You're in the right place. This is a list containin

$(P You are of course gladly invited to contribute with any suggestions, bug reports, bug fixes, and proposals you might have&mdash;anything that pushes forward the language. The list below is an attempt at structuring and focusing potential contributions. If you work on an item of this list, you can be sure it will be integrated within the reference compiler and/or standard library, assuming of course work is of good quality.)

$(SECTION2 $(TT gdc))
$(SECTION2 $(D gdc))

$(P $(WEB bitbucket.org/goshawk/gdc/wiki/Home, gdc) is a project that integrates the front-end of the D reference compiler with gcc's backend. The goal of the project is to fully integrate D in the GNU compiler suite version 4.7. All legal documents have been completed, which leaves things to "a small matter of programming".

Expand All @@ -27,7 +27,7 @@ class Widget {
}
----

$(P Details may vary (e.g. $(TT enableReflection()) may take the name of
$(P Details may vary (e.g. $(D enableReflection()) may take the name of
the class as a string), but essentially the language should provide
everything necessary for achieving full runtime reflection. That
includes inspecting a class' data members and methods, creating
Expand Down
122 changes: 61 additions & 61 deletions type.dd
Original file line number Diff line number Diff line change
Expand Up @@ -5,136 +5,136 @@ $(SPEC_S Types,
$(SECTION2 Basic Data Types,

$(TABLE2 Basic Data Types,
$(THEAD Keyword, Description, Default Initializer ($(TT .init)))
$(THEAD Keyword, Description, Default Initializer ($(D .init)))
$(TROW
$(TT void),
$(D void),
no type,
$(TT -)
$(D -)
)
$(TROW
$(TT bool),
$(D bool),
boolean value,
$(TT false)
$(D false)
)
$(TROW
$(TT byte),
$(D byte),
signed 8 bits,
$(TT 0)
$(D 0)
)
$(TROW
$(TT ubyte),
$(D ubyte),
unsigned 8 bits,
$(TT 0)
$(D 0)
)
$(TROW
$(TT short),
$(D short),
signed 16 bits,
$(TT 0)
$(D 0)
)
$(TROW
$(TT ushort),
$(D ushort),
unsigned 16 bits,
$(TT 0)
$(D 0)
)
$(TROW
$(TT int),
$(D int),
signed 32 bits,
$(TT 0)
$(D 0)
)
$(TROW
$(TT uint),
$(D uint),
unsigned 32 bits,
$(TT 0)
$(D 0)
)
$(TROW
$(TT long),
$(D long),
signed 64 bits,
$(TT 0L)
$(D 0L)
)
$(TROW
$(TT ulong),
$(D ulong),
unsigned 64 bits,
$(TT 0L)
$(D 0L)
)
$(TROW
$(TT cent),
$(D cent),
signed 128 bits (reserved for future use),
$(TT 0)
$(D 0)
)
$(TROW
$(TT ucent),
$(D ucent),
unsigned 128 bits (reserved for future use),
$(TT 0)
$(D 0)
)
$(TROW
$(TT float),
$(D float),
32 bit floating point,
$(TT float.nan)
$(D float.nan)
)
$(TROW
$(TT double),
$(D double),
64 bit floating point,
$(TT double.nan)
$(D double.nan)
)
$(TROW
$(TT real),
$(D real),
largest hardware implemented floating
point size ($(B Implementation Note:) 80 bits for x86 CPUs)
or double size$(COMMA) whichever is larger,
$(TT real.nan)
$(D real.nan)
)
$(TROW
$(TT ifloat),
$(D ifloat),
imaginary float,
$(TT float.nan * 1.0i)
$(D float.nan * 1.0i)
)
$(TROW
$(TT idouble),
$(D idouble),
imaginary double,
$(TT double.nan * 1.0i)
$(D double.nan * 1.0i)
)
$(TROW
$(TT ireal),
$(D ireal),
imaginary real,
$(TT real.nan * 1.0i)
$(D real.nan * 1.0i)
)
$(TROW
$(TT cfloat),
$(D cfloat),
a complex number of two float values,
$(TT float.nan + float.nan * 1.0i)
$(D float.nan + float.nan * 1.0i)
)
$(TROW
$(TT cdouble),
$(D cdouble),
complex double,
$(TT double.nan + double.nan * 1.0i)
$(D double.nan + double.nan * 1.0i)
)
$(TROW
$(TT creal),
$(D creal),
complex real,
$(TT real.nan + real.nan * 1.0i)
$(D real.nan + real.nan * 1.0i)
)
$(TROW
$(TT char),
$(D char),
unsigned 8 bit UTF-8,
$(TT 0xFF)
$(D 0xFF)
)
$(TROW
$(TT wchar),
$(D wchar),
unsigned 16 bit UTF-16,
$(TT 0xFFFF)
$(D 0xFFFF)
)
$(TROW
$(TT dchar),
$(D dchar),
unsigned 32 bit UTF-32,
$(TT 0x0000FFFF)
$(D 0x0000FFFF)
)
)
)


$(SECTION2 Derived Data Types,

$(UL
$(UL
$(LI pointer)
$(LI array)
$(LI associative array)
Expand Down Expand Up @@ -222,39 +222,39 @@ $(SECTION2 Integer Promotions,
)

$(TABLE2 Integer Promotions,
$(TR
$(TR
$(TH from)
$(TH to)
)
$(TR
$(TR
$(TD bool)
$(TD int)
)
$(TR
$(TR
$(TD byte)
$(TD int)
)
$(TR
$(TR
$(TD ubyte)
$(TD int)
)
$(TR
$(TR
$(TD short)
$(TD int)
)
$(TR
$(TR
$(TD ushort)
$(TD int)
)
$(TR
$(TR
$(TD char)
$(TD int)
)
$(TR
$(TR
$(TD wchar)
$(TD int)
)
$(TR
$(TR
$(TD dchar)
$(TD uint)
)
Expand Down Expand Up @@ -289,7 +289,7 @@ $(SECTION2 Usual Arithmetic Conversions,
$(LI Else the integer promotions are done on each operand,
followed by:

$(OL
$(OL
$(LI If both are the same type, no more conversions are done.)

$(LI If both are signed or both are unsigned, the
Expand Down Expand Up @@ -397,7 +397,7 @@ int (*fp)(int); // fp is pointer to a function
int func(int);
fp = &func; // fp points to func

class OB {
class OB {
int member(int);
}
OB o;
Expand Down
2 changes: 1 addition & 1 deletion unittest.dd
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ unittest {
for $(B dmd), will
cause the unittest test code to be compiled and incorporated into
the resulting executable. The unittest code gets run after
static initialization is run and before the $(TT main())
static initialization is run and before the $(D main())
function is called.
)

Expand Down
8 changes: 4 additions & 4 deletions version.dd
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ else
------

$(V2 $(P The $(B version(unittest)) is satisfied if and only if the code is
compiled with unit tests enabled (the $(TT -unittest) option on $(B dmd)).
compiled with unit tests enabled (the $(D -unittest) option on $(B dmd)).
)
)

Expand Down Expand Up @@ -212,7 +212,7 @@ version($(I identifier)) // add in version code if version
------

$(P These are presumably set by the command line as
$(TT -version=$(I n)) and $(TT -version=$(I identifier)).
$(D -version=$(I n)) and $(D -version=$(I identifier)).
)


Expand Down Expand Up @@ -402,7 +402,7 @@ debug($(I identifier)) { } // add in debug code if debug keyword is $(I identifi
------

$(P These are presumably set by the command line as
$(TT -debug=$(I n)) and $(TT -debug=$(I identifier)).
$(D -debug=$(I n)) and $(D -debug=$(I identifier)).
)

<h2>Static If Condition</h2>
Expand Down Expand Up @@ -469,7 +469,7 @@ INT!(17) c; // error, static assert trips
$(I IfStatement) in the following ways:
)

$(OL
$(OL
$(LI It can be used to conditionally compile declarations,
not just statements.
)
Expand Down
24 changes: 12 additions & 12 deletions warnings.dd
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ a = b + c;
The warning can be resolved by:
)

$(OL
$(OL
$(LI Inserting a cast:
---
a = cast(byte)(b + c);
Expand All @@ -63,8 +63,8 @@ a = cast(byte)(b + c);
that bypasses type checking, this can mask another bug that could
be introduced if the types of $(I a), $(I b) or $(I c)
change in the future, or if their types are set by a template
instantiation. (In generic code, the $(TT cast(byte)) would
probably be $(TT cast(typeof(a)))).
instantiation. (In generic code, the $(D cast(byte)) would
probably be $(D cast(typeof(a)))).
)

$(LI Changing the type of $(I a) to $(B int).
Expand All @@ -87,13 +87,13 @@ a = cast(byte)tmp;

$(P Some proposed language solutions are:)

$(OL
$(OL
$(LI Having the compiler automatically insert the equivalent of
the option 3 runtime check.
)

$(LI Add a new construct,
$(TT $(B implicit_cast)($(I type))$(I expression))
$(D $(B implicit_cast)($(I type))$(I expression))
that is a restricted form of the general cast, and will only
work where implicit casts would normally be allowed.
)
Expand Down Expand Up @@ -125,7 +125,7 @@ return a[length - 1]; // returns a[9], not a[3]

$(P The warning can be resolved by:)

$(OL
$(OL
$(LI Renaming the outer $(I length) to another name.
)

Expand All @@ -141,7 +141,7 @@ return a[length - 1]; // returns a[9], not a[3]

$(P Some proposed language solutions are:)

$(OL
$(OL
$(LI Make the $(I length) a special symbol or a keyword instead
of an implicitly declared variable.
)
Expand Down Expand Up @@ -189,7 +189,7 @@ int foo(int k, Collection c)
$(P The warning can be resolved by:
)

$(OL
$(OL
$(LI Putting a return statement at the close of the function,
returning some arbitrary value (after all, it will never be
executed):
Expand Down Expand Up @@ -305,14 +305,14 @@ switch (i)
to accidentally omit a case, or to add a new value in one part of
the program and overlook adding a case for it in another part.
Although D will catch this error at runtime by throwing
an instance of $(TT std.switcherr.SwitchError), some prefer at least
an instance of $(D std.switcherr.SwitchError), some prefer at least
a warning so such errors can be caught at compile time.
)

$(P The warning can be resolved by:
)

$(OL
$(OL
$(LI Inserting an explict default of the form:

---
Expand Down Expand Up @@ -353,7 +353,7 @@ int foo(int i)
$(P The warning can be resolved by:
)

$(OL
$(OL
$(LI Commenting out the dead code with /+ ... +/ comments:
---
int foo(int i)
Expand All @@ -366,7 +366,7 @@ int foo(int i)
---
)

$(LI Putting the dead code inside a $(TT version(none)) conditional:
$(LI Putting the dead code inside a $(D version(none)) conditional:
---
int foo(int i)
{
Expand Down
114 changes: 46 additions & 68 deletions win32.mak
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,26 @@

DMD=dmd

SRC= $(SPECSRC) \
cpptod.dd ctod.dd pretod.dd cppstrings.dd cppdbc.dd \
index.dd overview.dd dnews.dd \
mixin.dd \
memory.dd interface.dd \
windows.dd dll.dd \
htomodule.dd faq.dd dstyle.dd wc.dd future.dd changelog.dd \
SRC= $(SPECSRC) cpptod.dd ctod.dd pretod.dd cppdbc.dd index.dd \
overview.dd dnews.dd mixin.dd memory.dd interface.dd windows.dd \
dll.dd htomodule.dd faq.dd dstyle.dd wc.dd changelog.dd \
glossary.dd acknowledgements.dd dcompiler.dd builtin.dd \
comparison.dd rationale.dd \
code_coverage.dd exception-safe.dd rdmd.dd templates-revisited.dd \
warnings.dd ascii-table.dd windbg.dd htod.dd regular-expression.dd \
lazy-evaluation.dd lisp-java-d.dd variadic-function-templates.dd \
howto-promote.dd tuple.dd template-comparison.dd \
final-const-invariant.dd const.dd COM.dd \
hijack.dd features2.dd safed.dd \
cpp0x.dd const-faq.dd concepts.dd \
d-floating-point.dd migrate-to-shared.dd D1toD2.dd \
pdf-intro-cover.dd pdf-spec-cover.dd \
pdf-tools-cover.dd intro-to-datetime.dd

SPECSRC=spec.dd lex.dd module.dd declaration.dd type.dd property.dd \
attribute.dd pragma.dd expression.dd statement.dd arrays.dd \
hash-map.dd struct.dd class.dd interface.dd enum.dd const3.dd \
function.dd operatoroverloading.dd template.dd template-mixin.dd \
dbc.dd version.dd traits.dd errors.dd unittest.dd garbage.dd \
float.dd iasm.dd ddoc.dd interfaceToC.dd cpp_interface.dd \
portability.dd html.dd entity.dd memory-safe-d.dd abi.dd
comparison.dd rationale.dd code_coverage.dd exception-safe.dd \
rdmd.dd templates-revisited.dd warnings.dd ascii-table.dd \
windbg.dd htod.dd regular-expression.dd lazy-evaluation.dd \
variadic-function-templates.dd howto-promote.dd tuple.dd \
template-comparison.dd COM.dd hijack.dd features2.dd safed.dd \
const-faq.dd concepts.dd d-floating-point.dd migrate-to-shared.dd \
D1toD2.dd pdf-intro-cover.dd pdf-spec-cover.dd pdf-tools-cover.dd \
intro-to-datetime.dd

SPECSRC=spec.dd lex.dd module.dd declaration.dd type.dd property.dd \
attribute.dd pragma.dd expression.dd statement.dd arrays.dd \
hash-map.dd struct.dd class.dd interface.dd enum.dd const3.dd \
function.dd operatoroverloading.dd template.dd template-mixin.dd \
dbc.dd version.dd traits.dd errors.dd unittest.dd garbage.dd \
float.dd iasm.dd ddoc.dd interfaceToC.dd cpp_interface.dd \
portability.dd entity.dd memory-safe-d.dd abi.dd

DDOC=macros.ddoc windows.ddoc doc.ddoc

Expand All @@ -37,46 +30,45 @@ IMG=dmlogo.gif cpp1.gif d002.ico c1.gif d3.gif d4.gif d5.gif favicon.gif

PREMADE=download.html dcompiler.html language-reference.html appendices.html howtos.html articles.html

TARGETS=cpptod.html ctod.html pretod.html cppstrings.html \
cppdbc.html index.html overview.html lex.html \
module.html dnews.html declaration.html type.html property.html \
attribute.html pragma.html expression.html statement.html \
arrays.html struct.html class.html enum.html function.html \
operatoroverloading.html template.html mixin.html dbc.html \
version.html errors.html garbage.html memory.html float.html \
iasm.html interface.html portability.html html.html entity.html \
abi.html windows.html dll.html htomodule.html faq.html dstyle.html \
wc.html future.html changelog.html glossary.html \
TARGETS=cpptod.html ctod.html pretod.html cppdbc.html index.html \
overview.html lex.html module.html dnews.html declaration.html \
type.html property.html attribute.html pragma.html \
expression.html statement.html arrays.html struct.html class.html \
enum.html function.html operatoroverloading.html template.html \
mixin.html dbc.html version.html errors.html garbage.html \
memory.html float.html iasm.html interface.html portability.html \
entity.html abi.html windows.html dll.html htomodule.html \
faq.html dstyle.html wc.html changelog.html glossary.html \
acknowledgements.html builtin.html interfaceToC.html \
comparison.html rationale.html ddoc.html code_coverage.html \
exception-safe.html rdmd.html templates-revisited.html \
warnings.html ascii-table.html windbg.html htod.html \
regular-expression.html lazy-evaluation.html lisp-java-d.html \
regular-expression.html lazy-evaluation.html \
variadic-function-templates.html howto-promote.html tuple.html \
template-comparison.html template-mixin.html \
final-const-invariant.html const.html traits.html COM.html \
template-comparison.html template-mixin.html traits.html COM.html \
cpp_interface.html hijack.html const3.html features2.html \
safed.html cpp0x.html const-faq.html dmd-windows.html \
dmd-linux.html dmd-osx.html dmd-freebsd.html concepts.html \
memory-safe-d.html d-floating-point.html migrate-to-shared.html \
D1toD2.html unittest.html hash-map.html pdf-intro-cover.html \
safed.html const-faq.html dmd-windows.html dmd-linux.html \
dmd-osx.html dmd-freebsd.html concepts.html memory-safe-d.html \
d-floating-point.html migrate-to-shared.html D1toD2.html \
unittest.html hash-map.html pdf-intro-cover.html \
pdf-spec-cover.html pdf-tools-cover.html intro-to-datetime.html

PDFINTRO=index.html overview.html wc.html warnings.html builtin.html \
ctod.html cpptod.html pretod.html template-comparison.html cppstrings.html \
cppdbc.html lisp-java-d.html cpp0x.html
PDFINTRO=index.html overview.html wc.html warnings.html builtin.html \
ctod.html cpptod.html pretod.html template-comparison.html \
cppdbc.html

PDFFEATURES=comparison.html features2.html

PDFFAQ=faq.html const-faq.html rationale.html future.html
PDFFAQ=faq.html const-faq.html rationale.html

PDFSPEC=lex.html module.html declaration.html type.html property.html \
attribute.html pragma.html expression.html statement.html arrays.html \
hash-map.html struct.html class.html interface.html enum.html const3.html \
function.html operatoroverloading.html template.html template-mixin.html \
dbc.html version.html traits.html errors.html unittest.html garbage.html \
float.html iasm.html ddoc.html interfaceToC.html cpp_interface.html \
portability.html html.html entity.html memory-safe-d.html abi.html
PDFSPEC=lex.html module.html declaration.html type.html property.html \
attribute.html pragma.html expression.html statement.html \
arrays.html hash-map.html struct.html class.html interface.html \
enum.html const3.html function.html operatoroverloading.html \
template.html template-mixin.html dbc.html version.html \
traits.html errors.html unittest.html garbage.html float.html \
iasm.html ddoc.html interfaceToC.html cpp_interface.html \
portability.html entity.html memory-safe-d.html abi.html

PDFHOWTOS=windows.html dll.html COM.html htomodule.html

Expand Down Expand Up @@ -139,8 +131,6 @@ comparison.html : $(DDOC) comparison.dd

concepts.html : $(DDOC) concepts.dd

const.html : $(DDOC) const.dd

const3.html : $(DDOC) const3.dd

const-faq.html : $(DDOC) const-faq.dd
Expand All @@ -149,10 +139,6 @@ cpp_interface.html : $(DDOC) cpp_interface.dd

cppdbc.html : $(DDOC) cppdbc.dd

cpp0x.html : $(DDOC) cpp0x.dd

cppstrings.html : $(DDOC) cppstrings.dd

cpptod.html : $(DDOC) cpptod.dd

ctod.html : $(DDOC) ctod.dd
Expand Down Expand Up @@ -187,14 +173,10 @@ faq.html : $(DDOC) faq.dd

features2.html : $(DDOC) features2.dd

final-const-invariant.html : $(DDOC) final-const-invariant.dd

float.html : $(DDOC) float.dd

function.html : $(DDOC) function.dd

future.html : $(DDOC) future.dd

garbage.html : $(DDOC) garbage.dd

glossary.html : $(DDOC) glossary.dd
Expand All @@ -205,8 +187,6 @@ hijack.html : $(DDOC) hijack.dd

howto-promote.html : $(DDOC) howto-promote.dd

html.html : $(DDOC) html.dd

htod.html : $(DDOC) htod.dd

htomodule.html : $(DDOC) htomodule.dd
Expand All @@ -225,8 +205,6 @@ lazy-evaluation.html : $(DDOC) lazy-evaluation.dd

lex.html : $(DDOC) lex.dd

lisp-java-d.html : $(DDOC) lisp-java-d.dd

memory.html : $(DDOC) memory.dd

memory-safe-d.html : $(DDOC) memory-safe-d.dd
Expand Down
24 changes: 12 additions & 12 deletions windbg.dd
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ Ddoc

$(D_S Debugging D on Windows,

$(P The Microsoft Windows debugger $(TT $(DMDDIR)\windows\bin\windbg.exe) can be used to
$(P The Microsoft Windows debugger $(D $(DMDDIR)\windows\bin\windbg.exe) can be used to
symbolically debug D programs, even though it is a C++ debugger.
Versions of $(TT windbg.exe) other than the one supplied may not work with D.
Versions of $(D windbg.exe) other than the one supplied may not work with D.
(Jascha Wetzel's $(LINK2 http://ddbg.mainia.de/releases.html, Ddbg for Windows)
is also available.)
is also available.)
)

$(P To prepare a program for symbolic debugging, compile
Expand All @@ -25,7 +25,7 @@ windbg myprogram args...
)

$(P
where $(TT args...) are the command line arguments to myprogram.exe.
where $(D args...) are the command line arguments to myprogram.exe.
)

$(P When the debugger comes up, entering the command in the command window:)
Expand All @@ -34,7 +34,7 @@ $(CONSOLE
g _Dmain
)

$(P will execute the program up until the entry into $(TT main()).
$(P will execute the program up until the entry into $(D main()).
From thence, pressing the $(B F10) key will single step each line
of code.)

Expand All @@ -56,7 +56,7 @@ $(DD Single step, stepping over function calls.)
)

$(P For more comprehensive information on $(B windbg), consult the
file $(TT $(DMDDIR)\windows\bin\windbg.hlp).
file $(D $(DMDDIR)\windows\bin\windbg.hlp).
)

$(COMMENT
Expand Down Expand Up @@ -111,20 +111,20 @@ $(P and the debugger window comes up:)

<img src="foo.bmp">

$(P Advance to the beginning of $(TT main()) by entering $(TT g _Dmain):)
$(P Advance to the beginning of $(D main()) by entering $(D g _Dmain):)

<img src="windbg2.gif">

$(P now were at the beginning of main(). The upper left black window shows
the console output so far, the middle window shows the current location
and next instruction (the $(TT xor)), The lower right window shows the
and next instruction (the $(D xor)), The lower right window shows the
current location in the source code, highlighted in yellow.)

$(P In order to run until the exception happens, use the $(TT g) command:)
$(P In order to run until the exception happens, use the $(D g) command:)

<img src="windbg3.gif">

$(P The $(TT First chance exception) says an exception was thrown. The
$(P The $(D First chance exception) says an exception was thrown. The
lower right window now shows the line on which the exception happened
highlighted in yellow.)

Expand All @@ -143,8 +143,8 @@ the register window, where EAX holds the value 00000000.)

<img src="windbg7.gif">

$(P The trouble is clearly that $(TT p) is $(TT null). Fix it by allocating
an instance for $(TT p):)
$(P The trouble is clearly that $(D p) is $(D null). Fix it by allocating
an instance for $(D p):)

----------
import std.stdio;
Expand Down
20 changes: 10 additions & 10 deletions windows.dd
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ export void func(int foo);
<h2>Windows Executables</h2>

$(P Windows GUI applications can be written with D.
A sample such can be found in $(TT $(DMDDIR)\samples\d\winsamp.d)
A sample such can be found in $(D $(DMDDIR)\samples\d\winsamp.d)
)

$(P These are required:)

$(OL
$(OL

$(LI Instead of a $(CODE main) function serving as the entry point,
a $(CODE WinMain) function is needed.
Expand All @@ -82,7 +82,7 @@ int $(B WinMain)(HINSTANCE hInstance,
}

try
{
{
Runtime.initialize(&exceptionHandler);

result = $(B myWinMain)(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
Expand All @@ -109,8 +109,8 @@ int $(B myWinMain)(HINSTANCE hInstance,
}
--------------------

The $(TT myWinMain()) function is where the user code goes, the
rest of $(TT WinMain) is boilerplate to initialize and shut down
The $(D myWinMain()) function is where the user code goes, the
rest of $(D WinMain) is boilerplate to initialize and shut down
the D runtime system.
)

Expand All @@ -128,21 +128,21 @@ SUBSYSTEM WINDOWS
the application is run.
)

$(LI The presence of $(TT WinMain()) is recognized by the compiler
$(LI The presence of $(D WinMain()) is recognized by the compiler
causing it to emit a reference to
$(LINK2 http://www.digitalmars.com/ctg/acrtused.html, __acrtused_dll)
and the phobos.lib runtime library.
)

)

<h2>Windows Programming Examples</h2>

A collection of over 140 Windows D programming code examples is available at
$(LINK2 https://github.com/AndrejMitrovic/DWindowsProgramming, this Github repository.)
$(LINK2 https://github.com/AndrejMitrovic/DWindowsProgramming, this Github repository.)

)



Macros:
Expand Down