Skip to content

Commit

Permalink
Removed or commented out obsolete pages
Browse files Browse the repository at this point in the history
  • Loading branch information
andralex committed Dec 12, 2011
1 parent e5a81d1 commit 995e538
Show file tree
Hide file tree
Showing 60 changed files with 1,135 additions and 3,459 deletions.
12 changes: 6 additions & 6 deletions 32-64-portability.dd
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ else
$(SECTION2 Size Changes,

$(P The size of pointers and references will increase from 4
to 8 bytes. The $(TT size_t) alias moves from $(TT uint) to
$(TT ulong), and the $(TT ptrdiff_t) alias moves from $(TT int)
to $(TT long).
to 8 bytes. The $(D size_t) alias moves from $(D uint) to
$(D ulong), and the $(D ptrdiff_t) alias moves from $(D int)
to $(D long).
)

$(P The sizes of compound types based on these will also increase.
Expand Down Expand Up @@ -64,7 +64,7 @@ $(SECTION2 Classes,

$(SECTION2 printf,

$(P Since $(TT printf) is a C function, it follows C typing rules.
$(P Since $(D printf) is a C function, it follows C typing rules.
This can have consequences for using them with D types.
)

Expand All @@ -78,7 +78,7 @@ $(SECTION2 printf,
$(TR $(TD size_t) $(TD %zu) $(TD %zu))
)

$(P For 32 bit code, it was common to use the $(TT %.*s) format
$(P For 32 bit code, it was common to use the $(D %.*s) format
to print strings. This relied on the 32 bit C ABI interpreting the
components of a dynamic array as separate length and pointer arguments.
64 bit parameter passing is different, and so the length and pointer
Expand Down Expand Up @@ -117,7 +117,7 @@ $(SECTION2 Variadic Arguments,

$(P How variadic arguments work in 64 bits is radically different from
32 bits. They are not a simple array on the stack. You will need to use
the functions and templates in $(TT std.c.stdarg) to access them.
the functions and templates in $(D std.c.stdarg) to access them.
)

)
Expand Down
2 changes: 1 addition & 1 deletion COM.dd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Ddoc

$(SPEC_S COM Programming,

$(P COM interfaces are all derived from std.c.windows.com.IUnknown.
$(P COM interfaces are all derived from $(D std.c.windows.com.IUnknown).
)
)

Expand Down
16 changes: 8 additions & 8 deletions D1toD2.dd
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ $(UL
$(ITEM new_keywords, New Keywords)

$(P D2 adds the following keywords:
$(D_KEYWORD pure)
$(D_KEYWORD nothrow)
$(D_KEYWORD shared)
$(D_KEYWORD immutable)
$(D_KEYWORD pure),
$(D_KEYWORD nothrow),
$(D_KEYWORD shared), and
$(D_KEYWORD immutable).
Any use of them in D1 code must be renamed.
Any variable names starting with two underscores
should be renamed.
Expand Down Expand Up @@ -78,10 +78,10 @@ void foo($(B ref) int[3] array); // D2 equivalent

$(ITEM immutable_string, String Literals are Immutable)

$(P String literals in D1 have type $(D_CODE char[]), but in
D2 they have type $(D_CODE immutable(char)[]).
To migrate usually involves doing a global search replace:
)
$(P String literals in D1 have type $(D char[]), but in D2 they
have type $(D immutable(char)[]), which is aliased for convenience
under the name $(D string). To migrate usually involves doing a
global search replace: )

$(TABLE1
$(TR $(TH from)$(TH to))
Expand Down
8 changes: 4 additions & 4 deletions abi.dd
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ $(I SymbolName):
)

$(P The $(B M) means that the symbol is a function that requires
a $(TT this) pointer.)
a $(D this) pointer.)

$(P Template Instance Names have the types and values of its parameters
encoded into it:
Expand Down Expand Up @@ -326,7 +326,7 @@ $(DL

$(DT $(B A) $(I Number) $(I Value)...)
$(DD An array or asssociative array literal.
$(I Number) is the length of the array.
$(I Number) is the length of the array.
$(I Value) is repeated $(I Number) times for a normal array,
and 2 * $(I Number) times for an associative array.
)
Expand Down Expand Up @@ -879,12 +879,12 @@ $(SECTION3 Exception Handling,

$(SECTION3 Garbage Collection,

$(P The interface to this is found in $(TT phobos/internal/gc).)
$(P The interface to this is found in $(D phobos/internal/gc).)
)

$(SECTION3 Runtime Helper Functions,

$(P These are found in $(TT phobos/internal).)
$(P These are found in $(D phobos/internal).)
)

$(SECTION3 Module Initialization and Termination,
Expand Down
1 change: 1 addition & 0 deletions acknowledgements.dd
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ $(P
Dave Fladebo,
David Friedman,
Stewart Gordon,
Kenji Hara,
Christian Hartung,
David Held,
Ben Hinkle,
Expand Down
64 changes: 32 additions & 32 deletions arrays.dd
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ int* p;
is no length associated with it, and so there is no way for the
compiler or runtime to do bounds checking, etc., on it.
Most conventional uses for pointers can be replaced with
dynamic arrays, $(TT out) and $(TT ref) parameters,
dynamic arrays, $(D out) and $(D ref) parameters,
and reference types.
)

Expand Down Expand Up @@ -593,16 +593,16 @@ $(V2 $(TD Returns an array literal with each element of the literal being the

$(P For the $(B .sort) property to work on arrays of class
objects, the class definition must define the function:
$(TT int opCmp(Object)). This is used to determine the
$(D int opCmp(Object)). This is used to determine the
ordering of the class objects. Note that the parameter
is of type $(TT Object), not the type of the class.)
is of type $(D Object), not the type of the class.)

$(P For the $(B .sort) property to work on arrays of
structs or unions, the struct or union definition must
define the function:
$(TT int opCmp(S)) or
$(TT int opCmp(S*)).
The type $(TT S) is the type of the struct or union.
$(D int opCmp(S)) or
$(D int opCmp(S*)).
The type $(D S) is the type of the struct or union.
This function will determine the sort ordering.
)

Expand All @@ -626,7 +626,7 @@ a.dup; // creates an array of a.length elements, copies

<h3>$(LNAME2 resize, Setting Dynamic Array Length)</h3>

$(P The $(B $(TT .length)) property of a dynamic array can be set
$(P The $(B $(D .length)) property of a dynamic array can be set
as the lvalue of an = operator:
)

Expand Down Expand Up @@ -714,7 +714,7 @@ a[15] = 'z'; // does not affect c, because either a or c has reallocated.

$(P To guarantee copying behavior, use the .dup property to ensure
a unique array that can be resized. $(V2 Also, one may use the phobos
$(TT .capacity) property to determine how many elements can be appended
$(D .capacity) property to determine how many elements can be appended
to the array without reallocating.)
)

Expand Down Expand Up @@ -762,7 +762,7 @@ array.length = i;
input from the console - it's unlikely to be longer than 80.
)

$(V2 $(P Also, you may wish to utilize the phobos $(TT reserve)
$(V2 $(P Also, you may wish to utilize the phobos $(D reserve)
function to pre-allocate array data to use with the append operator.))

<h3>$(LNAME2 func-as-property, Functions as Array Properties)</h3>
Expand Down Expand Up @@ -956,7 +956,7 @@ char* p = str; // pointer to 1st element
str ~= "\0";
---------

$(P or use the function $(TT std.string.toStringz).)
$(P or use the function $(D std.string.toStringz).)

$(P The type of a string is determined by the semantic phase of
compilation. The type is
Expand Down Expand Up @@ -1049,31 +1049,31 @@ writefln("the string is '%s'", str);

<h3>$(LNAME2 implicit-conversions, Implicit Conversions)</h3>

$(P A pointer $(TT $(I T)*) can be implicitly converted to
$(P A pointer $(D $(I T)*) can be implicitly converted to
one of the following:)

$(UL
$(LI $(TT void*))
$(LI $(D void*))
)

$(P A static array $(TT $(I T)[$(I dim)]) can be implicitly
$(P A static array $(D $(I T)[$(I dim)]) can be implicitly
converted to
one of the following:
)

$(UL
$(LI $(TT $(I T)[]))
$(LI $(TT $(I U)[]))
$(LI $(TT void[]))
$(LI $(D $(I T)[]))
$(LI $(D $(I U)[]))
$(LI $(D void[]))
)

$(P A dynamic array $(TT $(I T)[]) can be implicitly converted to
$(P A dynamic array $(D $(I T)[]) can be implicitly converted to
one of the following:
)

$(UL
$(LI $(TT $(I U)[]))
$(LI $(TT void[]))
$(LI $(D $(I U)[]))
$(LI $(D void[]))
)

$(P Where $(I U) is a base class of $(I T).)
Expand Down Expand Up @@ -1124,20 +1124,20 @@ if (p != $(B null))

$(P Classes can be used as the $(I KeyType). For this to work,
the class definition must override the following member functions
of class $(TT Object):)
of class $(D Object):)

$(UL
$(LI $(TT hash_t toHash()))
$(V1 $(LI $(TT int opEquals(Object))))
$(V2 $(LI $(TT bool opEquals(Object))))
$(LI $(TT int opCmp(Object)))
$(LI $(D hash_t toHash()))
$(V1 $(LI $(D int opEquals(Object))))
$(V2 $(LI $(D bool opEquals(Object))))
$(LI $(D int opCmp(Object)))
)

$(P $(TT hash_t) is an alias to an integral type.)
$(P $(D hash_t) is an alias to an integral type.)

$(P Note that the parameter to $(TT opCmp) and $(TT opEquals) is
$(P Note that the parameter to $(D opCmp) and $(D opEquals) is
of type
$(TT Object), not the type of the class in which it is defined.)
$(D Object), not the type of the class in which it is defined.)

$(P For example:)

Expand All @@ -1163,9 +1163,9 @@ $(V1 int $(B opEquals)(Object o))$(V2 bool $(B opEquals)(Object o)) {
}
---

$(P The implementation may use either $(TT opEquals) or $(TT opCmp) or
$(P The implementation may use either $(D opEquals) or $(D opCmp) or
both. Care should be taken so that the results of
$(TT opEquals) and $(TT opCmp) are consistent with each other when
$(D opEquals) and $(D opCmp) are consistent with each other when
the class objects are the same or not.)

<h3>$(LNAME2 structs-as-keys, Using Structs or Unions as the KeyType)</h3>
Expand Down Expand Up @@ -1235,9 +1235,9 @@ struct MyString {
)


$(P The implementation may use either $(TT opEquals) or $(TT opCmp) or
$(P The implementation may use either $(D opEquals) or $(D opCmp) or
both. Care should be taken so that the results of
$(TT opEquals) and $(TT opCmp) are consistent with each other when
$(D opEquals) and $(D opCmp) are consistent with each other when
the struct/union objects are the same or not.)

<h3>$(LNAME2 aa-properties, Properties)</h3>
Expand Down Expand Up @@ -1362,7 +1362,7 @@ void main (string[] args) {
inWord = false;
}
++charCount;

// Let's consider the file has LF EOL.
if (c == '\n')
++lineCount;
Expand Down
4 changes: 2 additions & 2 deletions attribute.dd
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ align (1) struct S {

$(P Do not align references or pointers that were allocated
using $(I NewExpression) on boundaries that are not
a multiple of $(TT size_t). The garbage collector assumes that pointers
and references to gc allocated objects will be on $(TT size_t)
a multiple of $(D size_t). The garbage collector assumes that pointers
and references to gc allocated objects will be on $(D size_t)
byte boundaries. If they are not, undefined behavior will
result.
)
Expand Down
32 changes: 16 additions & 16 deletions builtin.dd
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ $(SECTION2 Dynamic Arrays,
)

$(UL
$(LI $(TT basic_string))
$(LI $(TT vector))
$(LI $(TT valarray))
$(LI $(TT deque))
$(LI $(TT slice_array))
$(LI $(TT gslice_array))
$(LI $(TT mask_array))
$(LI $(TT indirect_array))
$(LI $(D basic_string))
$(LI $(D vector))
$(LI $(D valarray))
$(LI $(D deque))
$(LI $(D slice_array))
$(LI $(D gslice_array))
$(LI $(D mask_array))
$(LI $(D indirect_array))
)

$(P Fixing the builtin array support means the need for each of these
Expand All @@ -92,11 +92,11 @@ $(SECTION2 Dynamic Arrays,
This starts with having an array literal, and follows with some
new operators specific to arrays. A library array implementation
has to make due with overloading existing operators.
The indexing operator, $(TT a[i]), it shares with C++.
Added are the array concatenation operator $(TT ~), array append operator
$(TT ~=), array slice operator $(TT a[i..j]),
The indexing operator, $(D a[i]), it shares with C++.
Added are the array concatenation operator $(D ~), array append operator
$(D ~=), array slice operator $(D a[i..j]),
and the array vector operator
$(TT a[]).
$(D a[]).
)

$(P The ~ and ~= concatenation operators resolve a problem that comes
Expand All @@ -112,8 +112,8 @@ $(SECTION2 Dynamic Arrays,

$(SECTION2 Strings,

$(P A <a href="cppstrings.html">detailed comparison with C++'s std::string</a>.
)
$(REDO $(P A <a href="cppstrings.html">detailed comparison with C++'s std::string</a>.
))

$(P C++ has, of course, builtin string support in the form of string
literals and char arrays. It's just that they suffer from all
Expand All @@ -138,8 +138,8 @@ $(SECTION2 Strings,
$(SECTION2 Associative Arrays,

$(P The main benefit for this is, once again, syntactic sugar.
An associative array keying off of a type $(TT T) and storing an
$(TT int) value is naturally written
An associative array keying off of a type $(D T) and storing an
$(D int) value is naturally written
as:
)

Expand Down
Loading

0 comments on commit 995e538

Please sign in to comment.