diff -uNr dmd-0.176/dmd/html/d/abi.html dmd-0.177/dmd/html/d/abi.html --- dmd-0.176/dmd/html/d/abi.html 2006-11-30 02:37:58.000000000 +0100 +++ dmd-0.177/dmd/html/d/abi.html 2006-12-05 18:54:32.000000000 +0100 @@ -32,7 +32,7 @@ -
Last update Thu Nov 30 02:37:57 2006 +
Last update Tue Dec 5 18:54:30 2006
@@ -130,54 +130,50 @@

D Application Binary Interface

- A D implementation that conforms to the D ABI (Application Binary Interface) - will be able to generate libraries, DLL's, etc., that can interoperate with +

A D implementation that conforms to the D ABI (Application Binary + Interface) + will be able to generate libraries, DLL's, etc., that can interoperate + with D binaries built by other implementations. -

+

- Most of this specification remains TBD (To Be Defined). +

Most of this specification remains TBD (To Be Defined). +

C ABI

- The C ABI referred to in this specification means the C Application +

The C ABI referred to in this specification means the C Application Binary Interface of the target system. C and D code should be freely linkable together, in particular, D code shall have access to the entire C ABI runtime library. +

Basic Types

- TBD +

TBD

Structs

- Conforms to the target's C ABI struct layout. +

Conforms to the target's C ABI struct layout.

Classes

- An object consists of: -

+

An object consists of:

- - -
offset contents -
0 pointer to vtable -
4 monitor -
8... non-static members + + + +
offset contents
0 pointer to vtable
4 monitor
8... non-static members
-

- The vtable consists of: -

+

The vtable consists of:

- - -
offset contents -
0 pointer to instance of ClassInfo -
4... pointers to virtual member functions + + +
offset contents
0 pointer to instance of ClassInfo
4... pointers to virtual member functions
-

- The class definition: +

The class definition:

class XXXX
 {
@@ -185,30 +181,26 @@
 };
 
- Generates the following: +

Generates the following:

-
    -
  • An instance of Class called ClassXXXX. +
    • An instance of Class called ClassXXXX.
    • -
    • A type called StaticClassXXXX which defines all the static members. +
    • A type called StaticClassXXXX which defines all the static members.
    • -
    • An instance of StaticClassXXXX called StaticXXXX for the static members. +
    • An instance of StaticClassXXXX called StaticXXXX for the static members.

    Interfaces

    - TBD +

    TBD

    Arrays

    - A dynamic array consists of: -

    +

    A dynamic array consists of:

    - - - - - + + - + @@ -434,7 +435,8 @@ Although printf is designed to handle 0 terminated strings, not D dynamic arrays of chars, it turns out that since D dynamic arrays are a length followed by a pointer to the data, - the %.*s format works perfectly: + the %.*s + format works perfectly:
    void foo(char[] string)
     {
    @@ -449,7 +451,8 @@
     	

    An improved D function for formatted output is - std.stdio.writef(). + std.stdio.writef() +.

    Structs and Unions

    diff -uNr dmd-0.176/dmd/html/d/intro.html dmd-0.177/dmd/html/d/intro.html --- dmd-0.176/dmd/html/d/intro.html 2006-11-27 18:15:54.000000000 +0100 +++ dmd-0.177/dmd/html/d/intro.html 2006-12-05 18:54:30.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Mon Nov 27 18:15:52 2006 +
    Last update Tue Dec 5 18:54:28 2006
    @@ -199,11 +199,9 @@ practical experience implementing compilers." -- Michael

    -

    "Great, just what I need.. another D in programming." -- Segfault

    -

    D is a systems programming language. Its focus is on combining the power and high performance of C and C++ with the programmer productivity of modern languages like Ruby and Python. diff -uNr dmd-0.176/dmd/html/d/lazy-evaluation.html dmd-0.177/dmd/html/d/lazy-evaluation.html --- dmd-0.176/dmd/html/d/lazy-evaluation.html 2006-11-27 18:16:00.000000000 +0100 +++ dmd-0.177/dmd/html/d/lazy-evaluation.html 2006-12-09 00:40:30.000000000 +0100 @@ -32,7 +32,7 @@ -

    Last update Mon Nov 27 18:15:58 2006 +
    Last update Sat Dec 9 00:40:28 2006
    @@ -210,10 +210,13 @@ }
    -

    The second expression p[0] is not evaluated unless p +

    The second expression p[0] + is not evaluated unless p + is not null. If the second expression was not lazily evaluated, it would -generate a runtime fault if p was null. +generate a runtime fault if p + was null.

    While invaluable, the lazy evaluation operators have significant @@ -264,7 +267,8 @@

    but that just papers over the problem. Preprocessor macros have well known shortcomings:

    -
    • The logging variable is exposed in the user's namespace.
    • +
      • The logging + variable is exposed in the user's namespace.
      • Macros are invisible to symbolic debuggers.
      • Macros are global only, and cannot be scoped.
      • Macros cannot be class members.
      • @@ -291,15 +295,18 @@

        Now, the string building expression only gets evaluated if logging is true, and encapsulation is maintained. The only trouble is that -few are going to want to wrap expressions with { return exp; }. +few are going to want to wrap expressions with { return exp; } +.

        So D takes it one small, but crucial, step further (suggested by Andrei Alexandrescu). Any expression -can be implicitly converted to a delegate that returns either void or +can be implicitly converted to a delegate that returns either void + or the type of the expression. -The delegate declaration is replaced by the lazy storage class +The delegate declaration is replaced by the lazy + storage class (suggested by Tomasz Stachowiak). The functions then become:

        diff -uNr dmd-0.176/dmd/html/d/lex.html dmd-0.177/dmd/html/d/lex.html --- dmd-0.176/dmd/html/d/lex.html 2006-11-27 18:15:54.000000000 +0100 +++ dmd-0.177/dmd/html/d/lex.html 2006-12-09 00:40:28.000000000 +0100 @@ -32,7 +32,7 @@
      -
      Last update Mon Nov 27 18:15:52 2006 +
      Last update Sat Dec 9 00:40:27 2006
      @@ -335,8 +335,11 @@ Comments cannot be used as token concatenators, for example, - abc/**/def is two tokens, abc and def, - not one abcdef token. + abc/**/def is two tokens, abc + and def +, + not one abcdef + token.

      Tokens

      @@ -1108,7 +1111,8 @@ parsing.

      - There is currently only one special token sequence, #line. + There is currently only one special token sequence, #line +.

      SpecialTokenSequence
       	# line Integer EndOfLine
      diff -uNr dmd-0.176/dmd/html/d/lisp-java-d.html dmd-0.177/dmd/html/d/lisp-java-d.html
      --- dmd-0.176/dmd/html/d/lisp-java-d.html	2006-11-27 18:16:00.000000000 +0100
      +++ dmd-0.177/dmd/html/d/lisp-java-d.html	2006-12-05 18:54:34.000000000 +0100
      @@ -31,7 +31,7 @@
       	
    -
    Last update Mon Nov 27 18:15:58 2006 +
    Last update Tue Dec 5 18:54:32 2006
    diff -uNr dmd-0.176/dmd/html/d/memory.html dmd-0.177/dmd/html/d/memory.html --- dmd-0.176/dmd/html/d/memory.html 2006-11-30 02:37:58.000000000 +0100 +++ dmd-0.177/dmd/html/d/memory.html 2006-12-09 00:40:28.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Thu Nov 30 02:37:57 2006 +
    Last update Sat Dec 9 00:40:27 2006
    @@ -411,7 +411,9 @@ to run. For specialized purposes, this can be handled by creating NewDeclarations and DeleteDeclarations. For example, to allocate using the C runtime library's - malloc and free: + malloc + and free +:
    import std.c.stdlib;
     import std.outofmemory;
    @@ -676,7 +678,8 @@
     	

    Therefore, the ISR thread should not be paused. Threads created with the std.thread functions will be paused. But threads created with C's - _beginthread() or equivalent won't be, the GC + _beginthread() + or equivalent won't be, the GC won't know they exist.

    @@ -684,7 +687,8 @@
    • The ISR thread cannot allocate any memory using the GC. - This means that the global new cannot be used. + This means that the global new + cannot be used. Nor can dynamic arrays be resized, nor can any elements be added to associative arrays. Any use of the D runtime library should be examined for any possibility of allocating GC memory - diff -uNr dmd-0.176/dmd/html/d/mixin.html dmd-0.177/dmd/html/d/mixin.html --- dmd-0.176/dmd/html/d/mixin.html 2006-11-27 18:15:56.000000000 +0100 +++ dmd-0.177/dmd/html/d/mixin.html 2006-12-05 18:54:32.000000000 +0100 @@ -32,7 +32,7 @@
    -
    Last update Mon Nov 27 18:15:54 2006 +
    Last update Tue Dec 5 18:54:30 2006
    diff -uNr dmd-0.176/dmd/html/d/module.html dmd-0.177/dmd/html/d/module.html --- dmd-0.176/dmd/html/d/module.html 2006-11-27 18:15:54.000000000 +0100 +++ dmd-0.177/dmd/html/d/module.html 2006-12-05 18:54:30.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Mon Nov 27 18:15:52 2006 +
    Last update Tue Dec 5 18:54:28 2006
    @@ -209,7 +209,7 @@ Example: -
    module c.stdio;    // this is module <b>stdio</b> in the <b>c</b> package
    +
    module c.stdio;    // this is module stdio in the c package
     
    By convention, package and module names are all lower case. This is diff -uNr dmd-0.176/dmd/html/d/operatoroverloading.html dmd-0.177/dmd/html/d/operatoroverloading.html --- dmd-0.176/dmd/html/d/operatoroverloading.html 2006-11-27 18:15:54.000000000 +0100 +++ dmd-0.177/dmd/html/d/operatoroverloading.html 2006-12-08 00:41:20.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Mon Nov 27 18:15:53 2006 +
    Last update Fri Dec 8 00:41:19 2006
    @@ -137,43 +137,42 @@

    Unary Operator Overloading

    -
    offset contents -
    0 array dimension -
    4 pointer to array data + + +
    offset contents
    0 array dimension
    4 pointer to array data

    @@ -247,7 +239,7 @@

    int[3] abc;
     
    - Passing abc to functions results in these implicit conversions: +

    Passing abc to functions results in these implicit conversions:

    void func(int[3] array); // actually <reference to><array[3] of><int>
     void func(int* p);       // abc is converted to a pointer
    @@ -258,11 +250,13 @@
     
     

    Name Mangling

    - D accomplishes typesafe linking by mangling a D identifier +

    D accomplishes typesafe linking by mangling a D identifier to include scope and type information. +

    MangledName:
         _D QualifiedName Type
    +    _D QualifiedName M Type
     
     QualifiedName:
         SymbolName
    @@ -273,8 +267,13 @@
         TemplateInstanceName
     
    - Template Instance Names have the types and values of its parameters +

    The M means that the symbol is a function that requires + a this + pointer.

    + +

    Template Instance Names have the types and values of its parameters encoded into it: +

    TemplateInstanceName:
          __T LName TemplateArgs Z
    @@ -292,8 +291,19 @@
         n
         Number
         N Number
    -    e 20HexDigits
    -    c 20HexDigits 20HexDigits
    +    e HexFloat
    +    c HexFloat c HexFloat
    +
    +HexFloat:
    +    NAN
    +    INF
    +    NINF
    +    N HexDigits P Exponent
    +    HexDigits P Exponent
    +
    +Exponent:
    +    N Number
    +    Number
     
     HexDigits:
         HexDigit
    @@ -301,25 +311,37 @@
     
     HexDigit:
         Digit
    -    a
    -    b
    -    c
    -    d
    -    e
    -    f
    +    A
    +    B
    +    C
    +    D
    +    E
    +    F
     
    - n is for null arguments.
    - Number is for positive numeric literals (including - character literals).
    - N Number is for negative numeric literals.
    - e 20HexDigits is for real and imaginary floating point literals.
    - c 20HexDigits 20HexDigits is for complex floating point literals.
    - Width Number _ HexDigits: - Width is whether the characters +
    n
    +
    is for null arguments.
    + +
    Number
    +
    is for positive numeric literals (including + character literals).
    + +
    N Number
    +
    is for negative numeric literals.
    + +
    e HexFloat
    +
    is for real and imaginary floating point literals.
    + +
    c HexFloat c HexFloat
    +
    is for complex floating point literals.
    + +
    Width Number _ HexDigits
    +
    Width is whether the characters are 1 byte (a), 2 bytes (w) or 4 bytes (d) in size. Number is the number of characters in the string. The HexDigits are the hex data for the string. +
    +
    Name:
         Namestart
    @@ -338,11 +360,7 @@
         Namechar Namechars
     
    -
    Type:
    -	TBD
    -
    - - A Name is a standard D identifier. +

    A Name is a standard D identifier.

    LName:
         Number Name
    @@ -364,8 +382,178 @@
         9
     
    - An LName is a name preceded by a Number giving +

    An LName is a name preceded by a Number giving the number of characters in the Name. +

    + +

    Type Mangling

    + +

    Types are mangled using a simple linear scheme:

    + +
    Type:
    +    TypeArray
    +    TypeSarray
    +    TypeAarray
    +    TypePointer
    +    TypeFunction
    +    TypeIdent
    +    TypeClass
    +    TypeStruct
    +    TypeEnum
    +    TypeTypedef
    +    TypeDelegate
    +    TypeNone
    +    TypeVoid
    +    TypeByte
    +    TypeUbyte
    +    TypeShort
    +    TypeUshort
    +    TypeInt
    +    TypeUint
    +    TypeLong
    +    TypeUlong
    +    TypeFloat
    +    TypeDouble
    +    TypeReal
    +    TypeIfloat
    +    TypeIdouble
    +    TypeIreal
    +    TypeCfloat
    +    TypeCdouble
    +    TypeCreal
    +    TypeBool
    +    TypeChar
    +    TypeWchar
    +    TypeDchar
    +    TypeTuple
    +
    +TypeArray:
    +    A Type
    +
    +TypeSarray:
    +    G Number Type
    +
    +TypeAarray:
    +    H Type Type
    +
    +TypePointer:
    +    P Type
    +
    +TypeFunction:
    +    CallConvention Arguments ArgClose Type
    +
    +CallConvention:
    +    F
    +    U
    +    W
    +    V
    +    R
    +
    +Arguments:
    +    Argument
    +    Argument Arguments
    +
    +Argument:
    +    Type
    +    J Type
    +    K Type
    +    L Type
    +
    +ArgClose
    +    X
    +    Y
    +    Z
    +
    +TypeIdent:
    +    I LName
    +
    +TypeClass:
    +    C LName
    +
    +TypeStruct:
    +    S LName
    +
    +TypeEnum:
    +    E LName
    +
    +TypeTypedef:
    +    T LName
    +
    +TypeDelegate:
    +    D TypeFunction
    +
    +TypeNone:
    +    n
    +
    +TypeVoid:
    +    v
    +
    +TypeByte:
    +    g
    +
    +TypeUbyte:
    +    h
    +
    +TypeShort:
    +    s
    +
    +TypeUshort:
    +    t
    +
    +TypeInt:
    +    i
    +
    +TypeUint:
    +    k
    +
    +TypeLong:
    +    l
    +
    +TypeUlong:
    +    m
    +
    +TypeFloat:
    +    f
    +
    +TypeDouble:
    +    d
    +
    +TypeReal:
    +    e
    +
    +TypeIfloat:
    +    o
    +
    +TypeIdouble:
    +    p
    +
    +TypeIreal:
    +    j
    +
    +TypeCfloat:
    +    q
    +
    +TypeCdouble:
    +    r
    +
    +TypeCreal:
    +    c
    +
    +TypeBool:
    +    b
    +
    +TypeChar:
    +    a
    +
    +TypeWchar:
    +    u
    +
    +TypeDchar:
    +    w
    +
    +TypeTuple:
    +    B Number Arguments
    +

    Function Calling Conventions

    diff -uNr dmd-0.176/dmd/html/d/acknowledgements.html dmd-0.177/dmd/html/d/acknowledgements.html --- dmd-0.176/dmd/html/d/acknowledgements.html 2006-11-27 18:15:56.000000000 +0100 +++ dmd-0.177/dmd/html/d/acknowledgements.html 2006-12-05 18:54:32.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Mon Nov 27 18:15:55 2006 +
    Last update Tue Dec 5 18:54:31 2006
    diff -uNr dmd-0.176/dmd/html/d/arrays.html dmd-0.177/dmd/html/d/arrays.html --- dmd-0.176/dmd/html/d/arrays.html 2006-11-30 02:37:58.000000000 +0100 +++ dmd-0.177/dmd/html/d/arrays.html 2006-12-09 00:40:28.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Thu Nov 30 02:37:57 2006 +
    Last update Sat Dec 9 00:40:27 2006
    @@ -154,7 +154,9 @@ 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, out and inout parameters, + dynamic arrays, out + and inout + parameters, and reference types.

    Static Arrays

    @@ -534,16 +536,21 @@

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

    + is of type Object +, not the type of the class.

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

    @@ -562,7 +569,8 @@

    Setting Dynamic Array Length

    - The .length property of a dynamic array can be set + The .length + property of a dynamic array can be set as the lvalue of an = operator:
    array.length = 7;
    @@ -791,7 +799,8 @@
     
    str ~= "\0";
     
    -

    or use the function std.string.toStringz.

    +

    or use the function std.string.toStringz +.

    The type of a string is determined by the semantic phase of compilation. The type is @@ -866,9 +875,12 @@

    Implicit Conversions

    -

    A pointer T* can be implicitly converted to - a void*. - A static array T[dim] can be implicitly +

    A pointer T* + can be implicitly converted to + a void* +. + A static array T[dim] + can be implicitly converted to one of the following:

    @@ -877,30 +889,39 @@
  • T*
  • T[]
  • void* +
  • void[] + -

    A dynamic array T[] can be implicitly converted to +

    A dynamic array T[] + can be implicitly converted to one of the following:

    • T*
    • void* +
    • void[] + +
    • U[] +
    +

    Where U is a base class of T.

    +

    Associative Arrays

    - D goes one step further with arrays - adding associative arrays. - Associative arrays have an index that is not necessarily an integer, +

    Associative arrays have an index that is not necessarily an integer, and can be sparsely populated. The index for an associative array is called the key, and its type is called the KeyType. -

    +

    - Associative arrays are declared by placing the KeyType +

    Associative arrays are declared by placing the KeyType within the [] of an array declaration: +

    int[char[]] b;		// associative array b of ints that are
     			// indexed by an array of characters.
    @@ -962,16 +983,23 @@
     
     	

    Classes can be used as the KeyType. For this to work, the class definition must override the following member functions - of class Object:

    + of class Object +:

    -
    • hash_t toHash()
    • -
    • int opEquals(Object)
    • -
    • int opCmp(Object)
    • +
      • hash_t toHash() +
      • +
      • int opEquals(Object) +
      • +
      • int opCmp(Object) +
      -

      Note that the parameter to opCmp and opEquals is +

      Note that the parameter to opCmp + and opEquals + is of type - Object, not the type of the class in which it is defined.

      + Object +, not the type of the class in which it is defined.

      For example:

      @@ -1003,12 +1031,19 @@ the struct or union definition must define the following member functions:

      -
      • hash_t toHash()
      • -
      • int opEquals(S) or int opEquals(S*)
      • -
      • int opCmp(S) or int opCmp(S*)
      • +
        • hash_t toHash() +
        • +
        • int opEquals(S) + or int opEquals(S*) +
        • +
        • int opCmp(S) + or int opCmp(S*) +
        -

        Note that the parameter to opCmp and opEquals +

        Note that the parameter to opCmp + and opEquals + can be either the struct or union type, or a pointer to the struct or untion type.

        diff -uNr dmd-0.176/dmd/html/d/ascii-table.html dmd-0.177/dmd/html/d/ascii-table.html --- dmd-0.176/dmd/html/d/ascii-table.html 2006-11-27 18:15:58.000000000 +0100 +++ dmd-0.177/dmd/html/d/ascii-table.html 2006-12-05 18:54:32.000000000 +0100 @@ -32,7 +32,7 @@
      -
      Last update Mon Nov 27 18:15:57 2006 +
      Last update Tue Dec 5 18:54:31 2006
      diff -uNr dmd-0.176/dmd/html/d/attribute.html dmd-0.177/dmd/html/d/attribute.html --- dmd-0.176/dmd/html/d/attribute.html 2006-11-27 18:15:54.000000000 +0100 +++ dmd-0.177/dmd/html/d/attribute.html 2006-12-05 18:54:30.000000000 +0100 @@ -32,7 +32,7 @@
    -
    Last update Mon Nov 27 18:15:52 2006 +
    Last update Tue Dec 5 18:54:29 2006
    @@ -203,7 +203,7 @@
    LinkageAttribute:
     	extern
    -	extern ( LinkageType )
    +	extern ( LinkageType )
     
     LinkageType:
     	C
    @@ -257,7 +257,7 @@
     
     
    AlignAttribute:
     	align
    -	align ( Integer )
    +	align ) Integer )
     
    Specifies the alignment of struct members. align by itself diff -uNr dmd-0.176/dmd/html/d/builtin.html dmd-0.177/dmd/html/d/builtin.html --- dmd-0.176/dmd/html/d/builtin.html 2006-11-27 18:15:56.000000000 +0100 +++ dmd-0.177/dmd/html/d/builtin.html 2006-12-09 00:40:30.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Mon Nov 27 18:15:55 2006 +
    Last update Sat Dec 9 00:40:28 2006
    @@ -149,13 +149,21 @@
    • basic_string +
    • vector +
    • valarray +
    • deque +
    • slice_array +
    • gslice_array +
    • mask_array +
    • indirect_array +
    Fixing the builtin array support means the need for each of these @@ -168,11 +176,16 @@ 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, a[i], it shares with C++. - Added are the array concatenation operator ~, array append operator - ~=, array slice operator a[i..j], + The indexing operator, a[i] +, it shares with C++. + Added are the array concatenation operator ~ +, array append operator + ~= +, array slice operator a[i..j] +, and the array vector operator - a[]. + a[] +.

    The ~ and ~= concatenation operators resolve a problem that comes @@ -207,8 +220,10 @@

    Associative Arrays

    The main benefit for this is, once again, syntactic sugar. - An associative array keying off of a type T and storing an - int value is naturally written + An associative array keying off of a type T + and storing an + int + value is naturally written as:
    int[T] foo;
    diff -uNr dmd-0.176/dmd/html/d/changelog1.html dmd-0.177/dmd/html/d/changelog1.html
    --- dmd-0.176/dmd/html/d/changelog1.html	2006-11-27 18:15:58.000000000 +0100
    +++ dmd-0.177/dmd/html/d/changelog1.html	2006-12-09 00:40:30.000000000 +0100
    @@ -32,7 +32,7 @@
     	
     	
     
    -	
    Last update Mon Nov 27 18:15:57 2006 +
    Last update Sat Dec 9 00:40:28 2006
    @@ -441,7 +441,8 @@
  • Fixed D.bugs/5198
  • Fixed D.bugs/5199
  • Fixed Linux C ABI compatibility bug with returning structs - from extern (C) functions. this can break + from extern (C) + functions. this can break existing code.
  • @@ -825,8 +826,10 @@ The IsExpressions are significantly more general and powerful.
  • Added VoidInitializers. -
  • delete aa[key] is now deprecated, use - aa.remove(key) instead. +
  • delete aa[key] + is now deprecated, use + aa.remove(key) + instead.
  • Added non-static nested classes.
  • Added anonymous non-static nested classes. @@ -1076,7 +1079,8 @@

    New/Changed Features

      -
    • In -release builds implicit switch defaults, +
    • In -release + builds implicit switch defaults, implicit return statements, and assert(0) expressions are replaced with HLT instructions.
    • Renamed -gt command line switch that invokes the profiler @@ -1121,7 +1125,6 @@
    • fix File.open() error message to say "Cannot open or create file"

    -

    Bugs Fixed

    @@ -1227,9 +1230,11 @@

    New/Changed Features

    • Added pragma(lib, "library name"); +
    • cent and ucent are now keywords, to ensure they stay reserved. -
    • version=all cannot be explicitly set; +
    • version=all + cannot be explicitly set; all is always on anyway.
    @@ -1285,7 +1290,9 @@
  • If a module statement name is used with a package prefix, as in:
     	module foo.bar;
    - then bar is not in scope, one must use foo.bar. + then bar + is not in scope, one must use foo.bar +.

    Bugs Fixed

    @@ -1351,7 +1358,6 @@ Fixed major bug in the linux version.

    -
  • Improved error message for overloaded function mismatches.
  • Added man pages to \dmd\man\man1 (thanks to Anders F Bjorklund) @@ -1463,7 +1469,6 @@
  • uncommented MmFileStream and cleaned it up to use MmFile's mode property.

    -

    Bugs Fixed

    @@ -1566,7 +1571,8 @@ for many double lookups.
  • .offset property is now deprecated, use .offsetof instead. This makes for better compatibility with C and fewer conflicts - with offset as a field name. + with offset + as a field name.
  • Added .ptr property to arrays, which is handier and more typesafe than casting an array to a pointer.
  • Added Ben Hinkle's changes to std.stream: @@ -1844,6 +1850,7 @@
    • One can now 'new' a scalar type, for example:
      int* p = new int; +

    Bugs Fixed

    @@ -2176,6 +2183,7 @@

    Bugs Fixed

    • An error is now issued when the argument to delete + is a COM interface object.
    • Incorporated Antonio Monteiro's fixes for std.date and std.zip.
    • Error now diagnosed when EnumBaseType is not integral. @@ -2334,8 +2342,11 @@
    • Added pragmas.
    • Added expression lists to case statements. -
    • Added goto default; and goto case; and +
    • Added goto default; + and goto case; + and goto case Expression; + for use in switch statements.
    • Added template alias parameters. @@ -2465,11 +2476,13 @@

      Bugs Fixed

      • Fixed bug with in and out instructions in inline assembler. -
      • Fixed speed problem with %.*s printf format. +
      • Fixed speed problem with %.*s + printf format.
      • Fixed problem with foreach over array of arrays or structs.
      • Fixed compiler error with array rehash.
      • Now correctly issues error on self-initializations like:
        - int a = a;
        + int a = a; +
      • Fixed problem converting "string" to char[], it should be an exact conversion, not an implicit conversion.
      @@ -2630,10 +2643,15 @@

      linux version

        -
      • dmd.conf now needs to be installed as - /etc/dmd.conf. -
      • phobos.a has been renamed as libphobos.a - and been placed in the /usr/lib directory. +
      • dmd.conf + now needs to be installed as + /etc/dmd.conf +. +
      • phobos.a + has been renamed as libphobos.a + + and been placed in the /usr/lib + directory.
      • dmd will now do the link step automatically.
      • The bad section name bug is hopefully fixed.
      @@ -2779,8 +2797,10 @@
      • The argument to a with statement can now be a template instance. -
      • The inline asm for FCOMI/FCOMIP/FUCOMI/FUCOMIP can now - accept the ST,ST(i) form of the instruction to match the +
      • The inline asm for FCOMI/FCOMIP/FUCOMI/FUCOMIP + can now + accept the ST,ST(i) + form of the instruction to match the Intel documentation.
      • Fixed numerous minor bugs.
      @@ -2806,8 +2826,10 @@
      • To convert to type bit now requires an explicit cast, - rather than implicit. The conversion (cast(bit)i) is - now performed as (i?true:false). + rather than implicit. The conversion (cast(bit)i) + is + now performed as (i?true:false) +.
      • Added library functions string.toString(). diff -uNr dmd-0.176/dmd/html/d/changelog.html dmd-0.177/dmd/html/d/changelog.html --- dmd-0.176/dmd/html/d/changelog.html 2006-12-02 20:10:54.000000000 +0100 +++ dmd-0.177/dmd/html/d/changelog.html 2006-12-09 01:16:28.000000000 +0100 @@ -32,7 +32,7 @@
      -
      Last update Sat Dec 2 20:10:53 2006 +
      Last update Sat Dec 9 01:16:27 2006
      @@ -194,6 +194,8 @@
        +
      • What's new for D 0.177
      • +
      • What's new for D 0.176
      • What's new for D 0.175
      • @@ -281,6 +283,46 @@
        +

        + What's New for + D 0.177 +

        + + +Dec 9, 2006 + +

        New/Changed Features

        + +
        • Casting a value v to a struct S is now rewritten as S(v).
        • +
        • Initializing a struct S from a value v is now rewritten as S(v).
        • +
        • TypeInfo now always generated for enum, struct, and typedef's, + to enable more thorough rtti.
        • +
        • classinfo.name now has the fully qualified name
        • +
        • Arrays no longer implicitly convert to pointers unless -d is used.
        • +
        • Need to recompile because: +
          • Improved name mangling for floating point constants
          • +
          • Nested and member functions needing 'this' are preceded by 'M' + in the mangled type.
          • +
          +
        • +
        + +

        Bugs Fixed

        + +
        • Doc fixed for Bugzilla 510: Nonworking implicit conversions between arrays and pointers
        • +
        • Doc fixed for Bugzilla 511: Various problems in the documentation
        • +
        • Doc fixed for Bugzilla 567: Compiler crash with conflicting templates
        • +
        • Fixed Bugzilla 607: toString can't handle char[]
        • +
        • Fixed Bugzilla 628: Assertion failure: '0' on line 91 in file 'init.c'
        • +
        • Fixed Bugzilla 636: Excessive "1: " in error message
        • +
        • Fixed Bugzilla 637: internal symbols are missing the leading underscore
        • +
        • Fixed Bugzilla 638: additional leading D in symbol D_D3std9dateparse9DateParse8classifyFAaZE3std9dateparse9DateParse2DP6DateID6__initZ
        • +
        • Fixed Bugzilla 653: AAs are slightly broken
        • +
        • Fixed Bugzilla 656: lazy in main
        • +
        + +
        +

        What's New for D 0.176 @@ -338,7 +380,7 @@
      • Fixed Bugzilla 587: DMD crashes compiling char[][] initialization
      • Fixed Bugzilla 589: std.string.newline should be char[] not char[2]
      • Fixed Bugzilla 591: version=LittleEndian crash the compiler
      • -
      • Fixed Bugzilla 592: can't deduce from arrayliteral
      • +
      • Fixed Bugzilla 593: can't deduce from arrayliteral
      • Fixed Bugzilla 597: std.socket TcpSocket and UdpSocket are missing.
      • Fixed Bugzilla 598: missing reentrant Linux functions
      • Fixed Bugzilla 610: Undocumented behaviour: ~ and ~= can now concatenate an array with a single element
      • @@ -431,11 +473,15 @@
      • Improved the statement grammar thanks to Stewart Gordon.
      • Added DMD switch -v1 for D language 1.0 compatibility.
      • deprecated === and !== no longer allowed
      • -
      • deprecated iftype no longer allowed
      • -
      • deprecated on_scope_xxxx no longer allowed
      • +
      • deprecated iftype + no longer allowed
      • +
      • deprecated on_scope_xxxx + no longer allowed
      • deprecated 'l' numeric literal suffix no longer allowed
      • -
      • deprecated if (v; e) no longer allowed
      • -
      • deprecated instance no longer allowed
      • +
      • deprecated if (v; e) + no longer allowed
      • +
      • deprecated instance + no longer allowed
      • scope can now be used for RAII declarations; use auto for type inference.
      @@ -678,7 +724,8 @@ NewExpression.
    • Added array literals.
    • std.format will now work with struct arguments as long - as they define a char[] toString() member function.
    • + as they define a char[] toString() + member function.

    Bugs Fixed

    @@ -962,7 +1009,8 @@

    Bugs Fixed

    • Fixed Bugzilla 50, but the o must appear as - o.new Inner
    • + o.new Inner +
    • Fixed Bugzilla 139
    • Fixed Bugzilla 148
    • Fixed Bugzilla 149
    • @@ -1309,8 +1357,10 @@
      • Changed on_scope_exit to scope(exit)
      • Changed on_scope_success to scope(success)
      • Changed on_scope_failure to scope(failure)
      • -
      • Changed IfStatement to allow: (auto v = expression), - and (type v = expression) forms.
      • +
      • Changed IfStatement to allow: (auto v = expression) +, + and (type v = expression) + forms.
      • & | ^ &= |= ^= ! && || ?: are now only operators allowed on bools
      • opSliceAssign now overloads assignment to a slice.
      • @@ -1490,7 +1540,8 @@

        Bugs Fixed

        • Constant folding of string==string now works.
        • -
        • Constant folding of length for char literals now works.
        • +
        • Constant folding of length + for char literals now works.
        • Constant folding of char literals appending chars now works.
        • Constant folding of char literal slices now works.
        • Fixed D.bugs/6003
        • diff -uNr dmd-0.176/dmd/html/d/class.html dmd-0.177/dmd/html/d/class.html --- dmd-0.176/dmd/html/d/class.html 2006-11-27 18:15:54.000000000 +0100 +++ dmd-0.177/dmd/html/d/class.html 2006-12-09 00:40:28.000000000 +0100 @@ -32,7 +32,7 @@
        -
        Last update Mon Nov 27 18:15:53 2006 +
        Last update Sat Dec 9 00:40:27 2006
        @@ -393,25 +393,25 @@
        this() { }
         
        - is implicitly generated. -

        +

        is implicitly generated.

        + +

        Class object construction is very flexible, but some restrictions + apply:

        - Class object construction is very flexible, but some restrictions - apply: -
          -
        1. It is illegal for constructors to mutually call each other: +
          1. It is illegal for constructors to mutually call each other:
            this() { this(1); }
             this(int i) { this(); }	// illegal, cyclic constructor calls
             
            +
          2. -
          3. If any constructor call appears inside a constructor, any +
          4. If any constructor call appears inside a constructor, any path through the constructor must make exactly one constructor call:
            this()	{ a || super(); }	// illegal
             
            -this() { if (a) ? this(1) : super(); }	// ok
            +this() { (a) ? this(1) : super(); }	// ok
             
             this()
             {
            @@ -421,19 +421,22 @@
                 }
             }
             
            +
          5. + +
          6. It is illegal to refer to this implicitly or explicitly + prior to making a constructor call.
          7. + +
          8. Constructor calls cannot appear after labels (in order to make + it easy to check for the previous conditions in the presence of goto's).
          9. -
          10. It is illegal to refer to this implicitly or explicitly - prior to making a constructor call. -
          11. Constructor calls cannot appear after labels (in order to make - it easy to check for the previous conditions in the presence of goto's).
          - Instances of class objects are created with NewExpressions: +

          Instances of class objects are created with NewExpressions:

          A a = new A(3);
           
          - The following steps happen: +

          The following steps happen:

          1. Storage is allocated for the object. @@ -524,7 +527,8 @@ A static constructor is defined as a function that performs initializations before the - main() function gets control. Static constructors are used to + main() + function gets control. Static constructors are used to initialize static class members with values that cannot be computed at compile time. @@ -559,7 +563,8 @@ initializations, and it is not possible to read a value that has not been initialized. Dynamic initialization is performed by a static constructor, defined with - a special syntax static this(). + a special syntax static this() +.
            class Foo
             {
            @@ -575,8 +580,10 @@
             }
             
            - static this() is called by the startup code before - main() is called. If it returns normally + static this() + is called by the startup code before + main() + is called. If it returns normally (does not throw an exception), the static destructor is added to the list of functions to be called on program termination. @@ -613,7 +620,8 @@
  • A static destructor is defined as a special static function with the - syntax static ~this(). + syntax static ~this() +.
    class Foo
     {
    @@ -707,7 +715,8 @@
     
    Invariants contain assert expressions, and so when they fail, - they throw a AssertErrors. + they throw a AssertError +s. Class invariants are inherited, that is, any class invariant is implicitly anded with the invariants of its base classes. @@ -745,6 +754,7 @@ 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 main() + function is called.

    @@ -792,7 +802,8 @@ set to the size in bytes of the memory to be allocated for the instance. The allocator must allocate the memory and return it as a - void*. + void* +. If the allocator fails, it must not return a null, but must throw an exception. If there is more than one parameter to the allocator, the @@ -841,7 +852,8 @@

    is called a class deallocator. - The deallocator must have exactly one parameter of type void*. + The deallocator must have exactly one parameter of type void* +. Only one can be specified for a class. When a delete expression: diff -uNr dmd-0.176/dmd/html/d/code_coverage.html dmd-0.177/dmd/html/d/code_coverage.html --- dmd-0.176/dmd/html/d/code_coverage.html 2006-11-27 18:15:58.000000000 +0100 +++ dmd-0.177/dmd/html/d/code_coverage.html 2006-12-09 00:40:30.000000000 +0100 @@ -31,7 +31,7 @@ -
    Last update Mon Nov 27 18:15:57 2006 +
    Last update Sat Dec 9 00:40:28 2006
    @@ -294,7 +294,8 @@ sieve
    -

    The output file will be created called sieve.lst, the contents of +

    The output file will be created called sieve.lst +, the contents of which are:

           |/* Eratosthenes Sieve prime number calculation. */
    @@ -335,11 +336,13 @@
     

    There are 3 lines with an exection count -of 1, these were each executed once. The declaration line for i, prime, +of 1, these were each executed once. The declaration line for i, prime +, etc., has 5 because there are 5 declarations, and the initialization of each declaration counts as one statement.

    -

    The first for loop shows 22. This is the sum of the 3 parts +

    The first for + loop shows 22. This is the sum of the 3 parts of the for header. If the for header is broken up into 3 lines, the data is similarly divided:

    @@ -350,8 +353,11 @@

    which adds up to 22.

    -

    e1&&e2 and e1||e2 expressions conditionally -execute the rvalue e2. +

    e1&&e2 + and e1||e2 + expressions conditionally +execute the rvalue e2 +. Therefore, the rvalue is treated as a separate statement with its own counter:

    @@ -374,8 +380,11 @@ |}
    -

    Similarly, for the e?e1:e2 expressions, e1 and -e2 are treated as separate statements.

    +

    Similarly, for the e?e1:e2 + expressions, e1 + and +e2 + are treated as separate statements.

    Controlling the Coverage Analyser

    diff -uNr dmd-0.176/dmd/html/d/comparison.html dmd-0.177/dmd/html/d/comparison.html --- dmd-0.176/dmd/html/d/comparison.html 2006-11-27 18:15:56.000000000 +0100 +++ dmd-0.177/dmd/html/d/comparison.html 2006-12-05 18:54:32.000000000 +0100 @@ -31,7 +31,7 @@ -
    Last update Mon Nov 27 18:15:55 2006 +
    Last update Tue Dec 5 18:54:31 2006
    @@ -91,7 +91,6 @@

    To D, or not to D. -- Willeam NerdSpeare

    - This table is a quick and rough comparison of various features of D diff -uNr dmd-0.176/dmd/html/d/cppcomplex.html dmd-0.177/dmd/html/d/cppcomplex.html --- dmd-0.176/dmd/html/d/cppcomplex.html 2006-11-27 18:15:52.000000000 +0100 +++ dmd-0.177/dmd/html/d/cppcomplex.html 2006-12-05 18:54:30.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Mon Nov 27 18:15:51 2006 +
    Last update Tue Dec 5 18:54:28 2006
    @@ -229,7 +229,6 @@ Arithmetic; it needs the Imaginary type."

    - The semantic problems are:
      diff -uNr dmd-0.176/dmd/html/d/cppdbc.html dmd-0.177/dmd/html/d/cppdbc.html --- dmd-0.176/dmd/html/d/cppdbc.html 2006-11-27 18:15:54.000000000 +0100 +++ dmd-0.177/dmd/html/d/cppdbc.html 2006-12-09 00:40:28.000000000 +0100 @@ -32,7 +32,7 @@
    -
    Last update Mon Nov 27 18:15:52 2006 +
    Last update Sat Dec 9 00:40:27 2006
    @@ -145,20 +145,27 @@

    Contract Programming in C++

    -

    The assert Macro

    +

    The assert + Macro

    - C++ does have the basic assert macro, which tests its argument - and if it fails, aborts the program. assert can be turned - on and off with the NDEBUG macro. + C++ does have the basic assert + macro, which tests its argument + and if it fails, aborts the program. assert + can be turned + on and off with the NDEBUG + macro.

    - assert does not know anything about class invariants, + assert + does not know anything about class invariants, and does not throw an exception when it fails. It just aborts - the program after writing a message. assert relies on + the program after writing a message. assert + relies on a macro text preprocessor to work.

    - assert is where explicit support for DbC in Standard C++ + assert + is where explicit support for DbC in Standard C++ begins and ends.

    Class Invariants

    @@ -237,8 +244,10 @@ }
  • - There's an additional complication with A::foo(). Upon every - normal exit from the function, the invariant() should be + There's an additional complication with A::foo() +. Upon every + normal exit from the function, the invariant() + should be called. This means that code that looks like: @@ -317,14 +326,19 @@
    If the preconditions and postconditions consist of nothing - more than assert macros, the whole doesn't need to - be wrapped in a #ifdef pair, since a good C++ compiler will - optimize the whole thing away if the asserts are turned off. + more than assert + macros, the whole doesn't need to + be wrapped in a #ifdef + pair, since a good C++ compiler will + optimize the whole thing away if the assert +s are turned off.

    - But suppose foo() sorts an array, and the postcondition needs + But suppose foo() + sorts an array, and the postcondition needs to walk the array and verify that it really is sorted. Now - the shebang needs to be wrapped in #ifdef: + the shebang needs to be wrapped in #ifdef +:

    void foo()
     {
    @@ -339,12 +353,15 @@
     
    (One can make use of the C++ rule that templates are only - instantiated when used can be used to avoid the #ifdef, by + instantiated when used can be used to avoid the #ifdef +, by putting the conditions into a template function referenced - by the assert.) + by the assert +.)

    - Let's add a return value to foo() that needs to be checked in + Let's add a return value to foo() + that needs to be checked in the postconditions. In D:

    int foo()
    @@ -385,7 +402,8 @@
     }
     
    - Now add a couple parameters to foo(). In D: + Now add a couple parameters to foo() +. In D:
    int foo(int a, int b)
         in { ...preconditions... }
    @@ -458,7 +476,8 @@
     }
     
    - The semantics for a call to B.foo() are: + The semantics for a call to B.foo() + are:
    • Either Apreconditions or Bpreconditions must be satisfied. @@ -520,16 +539,20 @@ Something interesting has happened here. The preconditions can - no longer be done using assert, since the results need + no longer be done using assert +, since the results need to be OR'd together. I'll leave as a reader exercise adding - in a class invariant, function return values for foo(), + in a class invariant, function return values for foo() +, and parameters - for foo(). + for foo() +.

      Conclusion

      These C++ techniques can work up to a point. But, aside from - assert, they are not standardized and so will vary from + assert +, they are not standardized and so will vary from project to project. Furthermore, they require much tedious adhesion to a particular convention, and add significant clutter to the code. Perhaps that's why it's rarely seen in practice. diff -uNr dmd-0.176/dmd/html/d/cppstrings.html dmd-0.177/dmd/html/d/cppstrings.html --- dmd-0.176/dmd/html/d/cppstrings.html 2006-11-27 18:15:52.000000000 +0100 +++ dmd-0.177/dmd/html/d/cppstrings.html 2006-12-09 00:40:28.000000000 +0100 @@ -33,7 +33,7 @@
    -
    Last update Mon Nov 27 18:15:51 2006 +
    Last update Sat Dec 9 00:40:26 2006
    @@ -243,9 +243,12 @@ char[] s1; foo(s1); -

    although for this to work where foo expects a 0 terminated - string, s1 must have a terminating 0. Alternatively, the - function std.string.toStringz will ensure it:

    +

    although for this to work where foo + expects a 0 terminated + string, s1 + must have a terminating 0. Alternatively, the + function std.string.toStringz + will ensure it:

    void foo(char*);
     char[] s1;
    diff -uNr dmd-0.176/dmd/html/d/cpptod.html dmd-0.177/dmd/html/d/cpptod.html
    --- dmd-0.176/dmd/html/d/cpptod.html	2006-11-27 18:15:52.000000000 +0100
    +++ dmd-0.177/dmd/html/d/cpptod.html	2006-12-09 00:40:28.000000000 +0100
    @@ -32,7 +32,7 @@
     	
     	
     
    -	
    Last update Mon Nov 27 18:15:51 2006 +
    Last update Sat Dec 9 00:40:26 2006
    @@ -331,7 +331,8 @@ Sometimes two classes are tightly related but not by inheritance, but need to access each other's private members. This is done - using friend declarations: + using friend + declarations:
    class A
     {
    @@ -390,7 +391,8 @@
     int abc(A p) { return p.a; }
     
    - The private attribute prevents other modules from + The private + attribute prevents other modules from accessing the members.
    @@ -431,7 +433,8 @@ The compiler automatically interprets all the <, <=, > and >= - operators in terms of the cmp function, as well + operators in terms of the cmp + function, as well as handling the cases where the left operand is not an object reference.

    @@ -500,6 +503,7 @@ of and freeing memory. This is handled automatically in D by the garbage collector. The second common resources used are semaphores and locks, handled automatically with D's synchronized + declarations and statements.

    diff -uNr dmd-0.176/dmd/html/d/ctod.html dmd-0.177/dmd/html/d/ctod.html --- dmd-0.176/dmd/html/d/ctod.html 2006-11-27 18:15:52.000000000 +0100 +++ dmd-0.177/dmd/html/d/ctod.html 2006-12-09 00:40:28.000000000 +0100 @@ -33,7 +33,7 @@ -

    Last update Mon Nov 27 18:15:51 2006 +
    Last update Sat Dec 9 00:40:26 2006
    @@ -93,67 +93,62 @@ Et tu, D? Then fall, C! -- William Nerdspeare

    - ouch! -Every experienced C programmer accumulates a series of idioms and techniques +

    Every experienced C programmer accumulates a series of idioms and techniques which become second nature. Sometimes, when learning a new language, those idioms can be so comfortable it's hard to see how to do the equivalent in the new language. So here's a collection of common C techniques, and how to do the corresponding task in D. -

    +

    -Since C does not have object-oriented features, there's a separate section +

    Since C does not have object-oriented features, there's a separate section for object-oriented issues Programming in D for C++ Programmers. -

    +

    -The C preprocessor is covered in +

    The C preprocessor is covered in The C Preprocessor vs D. +

    - -
    Last update Mon Nov 27 18:15:54 2006 +
    Last update Sat Dec 9 00:40:27 2006
    @@ -267,65 +267,42 @@

    In, Out and Inheritance

    - If a function in a derived class overrides a function in its +

    If a function in a derived class overrides a function in its super class, then only one of - the in contracts of the function and its base functions + the in + contracts of the function and its base functions must be satisfied. Overriding functions then becomes a process of loosening the in + contracts. -

    +

    - A function without an in contract means that any values +

    A function without an in + contract means that any values of the function parameters are allowed. This implies that if any - function in an inheritance heirarchy has no in contract, - then in contracts on functions overriding it have no useful + function in an inheritance heirarchy has no in + contract, + then in + contracts on functions overriding it have no useful effect. -

    +

    - Conversely, all of the out contracts needs to be satisified, so - overriding functions becomes a processes of tightening the out - contracts. +

    Conversely, all of the out + contracts needs to be satisfied, + so overriding functions becomes a processes of tightening the + out - + contracts. +

    Class Invariants

    - Class invariants are used to specify characteristics of a class that always +

    Class invariants are used to specify characteristics of a class that + always must be true (except while executing a member function). They are described in Classes. - +

    References

    diff -uNr dmd-0.176/dmd/html/d/dcompiler.html dmd-0.177/dmd/html/d/dcompiler.html --- dmd-0.176/dmd/html/d/dcompiler.html 2006-11-27 18:15:56.000000000 +0100 +++ dmd-0.177/dmd/html/d/dcompiler.html 2006-12-09 00:40:30.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Mon Nov 27 18:15:55 2006 +
    Last update Sat Dec 9 00:40:28 2006
    @@ -203,15 +203,19 @@
    \dmd\src\phobos\ +
    D runtime library source
    \dmd\src\dmd\ +
    D compiler front end source under dual (GPL and Artistic) license
    \dmd\html\d\ +
    Documentation
    \dmd\samples\d\ +
    Sample D programs
    @@ -224,15 +228,19 @@
    \dmd\bin\dmd.exe +
    D compiler executable
    \dmd\bin\shell.exe +
    Simple command line shell
    \dmd\bin\sc.ini +
    Global compiler settings
    \dmd\lib\phobos.lib +
    D runtime library
    @@ -260,10 +268,14 @@ they are run from a console window. Switch to the root directory. Unzip the files in the root directory. - dmd.zip will create - a \dmd directory with all the files in it. - dmc.zip will create - a \dm directory with all the files in it. + dmd.zip + will create + a \dmd + directory with all the files in it. + dmc.zip + will create + a \dm + directory with all the files in it.

    A typical session might look like: @@ -280,7 +292,8 @@

    \dmd\bin\shell all.sh
     
    - in the \dmd\samples\d directory for several small examples. + in the \dmd\samples\d + directory for several small examples.

    Compiler Arguments and Switches

    @@ -366,6 +379,7 @@
    pass linkerflag to the linker, for example, /ma/li +
    -nofloat
    Prevents emission of __fltused reference in object files, even if floating point code is present. @@ -483,7 +497,8 @@ conflicting use of environment variables.

    - Environment variables follow the [Environment] section + Environment variables follow the [Environment] + section heading, in NAME=value pairs. The NAMEs are treated as upper case. Comments are lines that start with ;. @@ -520,19 +535,26 @@

    /dmd/bin/dmd +
    D compiler executable
    /dmd/bin/dumpobj +
    Elf file dumper
    /dmd/bin/obj2asm +
    Elf file disassembler
    /dmd/bin/dmd.conf -
    Global compiler settings (copy to /etc/dmd.conf) + +
    Global compiler settings (copy to /etc/dmd.conf +)
    /dmd/lib/libphobos.a -
    D runtime library (copy to /usr/lib/libphobos.a) + +
    D runtime library (copy to /usr/lib/libphobos.a +)
    @@ -555,14 +577,18 @@
  • Unzip the archive into your home directory. It will create - a ~/dmd directory with all the files in it. + a ~/dmd + directory with all the files in it. All the tools are command line tools, which means they are run from a console window. -
  • Edit the file ~/dmd/bin/dmd.conf to put the path in to +
  • Edit the file ~/dmd/bin/dmd.conf + to put the path in to where the phobos source files are. -
  • Copy dmd.conf to /etc: +
  • Copy dmd.conf + to /etc +:
    cp dmd/bin/dmd.conf /etc
     
    @@ -572,11 +598,14 @@
    chmod u+x dmd/bin/dmd dmd/bin/obj2asm dmd/bin/dumpobj
     
    -
  • Put dmd/bin on your PATH, +
  • Put dmd/bin + on your PATH, or copy the linux executables to /usr/local/bin -
  • Copy the library to /usr/lib: + +
  • Copy the library to /usr/lib +:
    cp dmd/lib/libphobos.a /usr/lib
     
    @@ -661,6 +690,7 @@
    -Llinkerflag
    pass linkerflag to the linker, for example, -M +
    -O
    optimize
    -o-
    @@ -747,7 +777,8 @@ conflicting use of environment variables.

    -

    Environment variables follow the [Environment] section +

    Environment variables follow the [Environment] + section heading, in NAME=value pairs. The NAMEs are treated as upper case. Comments are lines that start with ;. @@ -769,6 +800,7 @@ will cause a segment violation.

  • The configuration file is /etc/dmd.conf +
    diff -uNr dmd-0.176/dmd/html/d/ddoc.html dmd-0.177/dmd/html/d/ddoc.html --- dmd-0.176/dmd/html/d/ddoc.html 2006-11-27 18:15:58.000000000 +0100 +++ dmd-0.177/dmd/html/d/ddoc.html 2006-12-09 00:40:30.000000000 +0100 @@ -31,7 +31,7 @@ -
    Last update Mon Nov 27 18:15:56 2006 +
    Last update Sat Dec 9 00:40:28 2006
    @@ -270,6 +270,7 @@

    If a documentation comment for a declaration consists only of the identifier ditto + then the documentation comment for the previous declaration at the same declaration scope is applied to this declaration as well.

    diff -uNr dmd-0.176/dmd/html/d/declaration.html dmd-0.177/dmd/html/d/declaration.html --- dmd-0.176/dmd/html/d/declaration.html 2006-11-27 18:15:54.000000000 +0100 +++ dmd-0.177/dmd/html/d/declaration.html 2006-12-05 18:54:30.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Mon Nov 27 18:15:52 2006 +
    Last update Tue Dec 5 18:54:29 2006
    diff -uNr dmd-0.176/dmd/html/d/dlinks.html dmd-0.177/dmd/html/d/dlinks.html --- dmd-0.176/dmd/html/d/dlinks.html 2006-11-27 18:15:52.000000000 +0100 +++ dmd-0.177/dmd/html/d/dlinks.html 2006-12-05 18:54:30.000000000 +0100 @@ -31,7 +31,7 @@ -
    Last update Mon Nov 27 18:15:51 2006 +
    Last update Tue Dec 5 18:54:28 2006
    diff -uNr dmd-0.176/dmd/html/d/dll.html dmd-0.177/dmd/html/d/dll.html --- dmd-0.176/dmd/html/d/dll.html 2006-11-27 18:15:56.000000000 +0100 +++ dmd-0.177/dmd/html/d/dll.html 2006-12-09 00:40:28.000000000 +0100 @@ -31,7 +31,7 @@ -
    Last update Mon Nov 27 18:15:54 2006 +
    Last update Sat Dec 9 00:40:27 2006
    @@ -218,6 +218,7 @@ DLLs can be created in D in roughly the same way as in C. A DllMain() + is required, looking like:
    import std.c.windows.windows;
    @@ -261,7 +262,8 @@
     	Notes:
     	
    • The _moduleUnitTests() call is optional. -
    • The presence of DllMain() is recognized by the compiler +
    • The presence of DllMain() + is recognized by the compiler causing it to emit a reference to __acrtused_dll and the phobos.lib runtime library. @@ -544,7 +546,8 @@
      DllMain
      This is the main entry point for any D DLL. It gets called by the C startup code - (for DMC++, the source is \dm\src\win32\dllstart.c). + (for DMC++, the source is \dm\src\win32\dllstart.c +). The printf's are placed there so one can trace how it gets called. Notice that the initialization and termination code seen in @@ -613,20 +616,46 @@ - To build the mydll.dll DLL: + To build the mydll.dll + DLL:
        -
      1. dmd -c mydll -g -
        Compiles mydll.d into mydll.obj. +
      2. dmd -c mydll -g + +
        Compiles mydll.d + into mydll.obj +. -g turns on debug info generation.

        -

      3. dmd mydll.obj \dmd\lib\gcstub.obj mydll.def -g -L/map -
        Links mydll.obj into a DLL named mydll.dll. - gcstub.obj is not required, but it prevents the bulk +
      4. dmd mydll.obj \dmd\lib\gcstub.obj mydll.def -g -L/map + +
        Links mydll.obj + into a DLL named + +

        +

        + + + + + + +mydll.dll). + gcstub.obj + is not required, but it prevents the bulk of the gc code from being linked in, since it will not be used anyway. It saves about 12Kb. - mydll.def is the + mydll.def + is the Module Definition File, and has the contents: @@ -638,21 +667,27 @@
    -g turns on debug info generation, and - -L/map generates a map file mydll.map. + -L/map generates a map file mydll.map +.

    -

  • implib /noi /system mydll.lib mydll.dll +
  • implib /noi /system mydll.lib mydll.dll +
    Creates an import library - mydll.lib suitable + mydll.lib + suitable for linking in with an application that will be statically - loading mydll.dll. + loading mydll.dll +.

    - Here's test.d, a sample application that makes use of - mydll.dll. There are two versions, one statically binds to + Here's test.d +, a sample application that makes use of + mydll.dll +. There are two versions, one statically binds to the DLL, and the other dynamically loads it.

    import std.stdio;
    @@ -755,14 +790,21 @@
     
    C:>dmd test mydll.lib -g
     
    - Note how it is linked with mydll.lib, the import library - for mydll.dll. - The code is straightforward, it initializes mydll.lib with + Note how it is linked with mydll.lib +, the import library + for mydll.dll +. + The code is straightforward, it initializes mydll.lib + with a call to MyDLL_Initialize(), passing the handle - to test.exe's gc. + to test.exe +'s gc. Then, we can use the DLL and call its functions just as if - it were part of test.exe. In foo(), gc memory - is allocated and freed both by test.exe and mydll.dll. + it were part of test.exe +. In foo(), gc memory + is allocated and freed both by test.exe + and mydll.dll +. When we're done using the DLL, it is terminated with MyDLL_Terminate().

    @@ -786,17 +828,20 @@

    C:>dmd test -version=DYNAMIC_LOAD -g
     
    - The import library mydll.lib is not needed. + The import library mydll.lib + is not needed. The DLL is loaded with a call to LoadLibraryA(), and each exported function has to be retrieved via a call to GetProcAddress(). An easy way to get the decorated name to pass to GetProcAddress() - is to copy and paste it from the generated mydll.map file + is to copy and paste it from the generated mydll.map + file under the Export heading. Once this is done, we can use the member functions of the - DLL classes as if they were part of test.exe. + DLL classes as if they were part of test.exe +. When done, release the DLL with FreeLibrary().

    @@ -815,25 +860,7 @@ C:>

    - - -

    -

    - - - - - - - +) diff -uNr dmd-0.176/dmd/html/d/download.html dmd-0.177/dmd/html/d/download.html --- dmd-0.176/dmd/html/d/download.html 2006-11-27 18:15:58.000000000 +0100 +++ dmd-0.177/dmd/html/d/download.html 2006-12-05 18:54:34.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Mon Nov 27 18:15:57 2006 +
    Last update Tue Dec 5 18:54:32 2006
    diff -uNr dmd-0.176/dmd/html/d/dstyle.html dmd-0.177/dmd/html/d/dstyle.html --- dmd-0.176/dmd/html/d/dstyle.html 2006-11-27 18:15:56.000000000 +0100 +++ dmd-0.177/dmd/html/d/dstyle.html 2006-12-05 18:54:32.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Mon Nov 27 18:15:55 2006 +
    Last update Tue Dec 5 18:54:30 2006
    diff -uNr dmd-0.176/dmd/html/d/entity.html dmd-0.177/dmd/html/d/entity.html --- dmd-0.176/dmd/html/d/entity.html 2006-11-27 18:15:56.000000000 +0100 +++ dmd-0.177/dmd/html/d/entity.html 2006-12-05 18:54:32.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Mon Nov 27 18:15:54 2006 +
    Last update Tue Dec 5 18:54:30 2006
    diff -uNr dmd-0.176/dmd/html/d/enum.html dmd-0.177/dmd/html/d/enum.html --- dmd-0.176/dmd/html/d/enum.html 2006-11-27 18:15:54.000000000 +0100 +++ dmd-0.177/dmd/html/d/enum.html 2006-12-05 18:54:30.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Mon Nov 27 18:15:53 2006 +
    Last update Tue Dec 5 18:54:29 2006
    diff -uNr dmd-0.176/dmd/html/d/errors.html dmd-0.177/dmd/html/d/errors.html --- dmd-0.176/dmd/html/d/errors.html 2006-11-27 18:15:56.000000000 +0100 +++ dmd-0.177/dmd/html/d/errors.html 2006-12-05 18:54:32.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Mon Nov 27 18:15:54 2006 +
    Last update Tue Dec 5 18:54:30 2006
    @@ -134,7 +134,6 @@ I came, I coded, I crashed. -- Julius C'ster

    - All programs have to deal with errors. Errors are unexpected conditions that are not part of the normal operation of a program. Examples of common errors are: diff -uNr dmd-0.176/dmd/html/d/exception-safe.html dmd-0.177/dmd/html/d/exception-safe.html --- dmd-0.176/dmd/html/d/exception-safe.html 2006-11-27 18:15:58.000000000 +0100 +++ dmd-0.177/dmd/html/d/exception-safe.html 2006-12-09 00:40:30.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Mon Nov 27 18:15:57 2006 +
    Last update Sat Dec 9 00:40:28 2006
    @@ -432,9 +432,11 @@

    Example

    The next example involves temporarily changing the state of some object. -Suppose there's a class data member verbose, which controls the +Suppose there's a class data member verbose +, which controls the emission of messages logging the activity of the class. -Inside one of the methods, verbose needs to be turned off because +Inside one of the methods, verbose + needs to be turned off because there's a loop that would otherwise cause a blizzard of messages to be output:
    class Foo
    @@ -451,7 +453,8 @@
     }
     
    -There's a problem if Foo.bar() exits via an exception - the verbose +There's a problem if Foo.bar() + exits via an exception - the verbose flag state is not restored. That's easily fixed with scope(exit): @@ -470,7 +473,8 @@ }
  • -

    It also neatly solves the problem if ...lots of code... goes on at +

    It also neatly solves the problem if ...lots of code... + goes on at some length, and in the future a maintenance programmer inserts a return statement in it, not realizing that verbose must be reset upon exit. The reset code is where it belongs conceptually, rather than where diff -uNr dmd-0.176/dmd/html/d/expression.html dmd-0.177/dmd/html/d/expression.html --- dmd-0.176/dmd/html/d/expression.html 2006-12-02 02:29:14.000000000 +0100 +++ dmd-0.177/dmd/html/d/expression.html 2006-12-09 00:40:28.000000000 +0100 @@ -31,7 +31,7 @@ -

    Last update Sat Dec 2 02:29:13 2006 +
    Last update Sat Dec 9 00:40:27 2006
    @@ -137,11 +137,11 @@ These values can then be assigned, tested, or ignored. Expressions can also have side effects. -
    StringLiterals:
    +
    StringLiterals:
     	StringLiteral
     	StringLiterals StringLiteral
     
    -ArgumentList:
    +ArgumentList:
     	AssignExpression
     	AssignExpression , ArgumentList
     
    @@ -163,7 +163,7 @@

    Expressions

    -
    Expression:
    +
    Expression:
     	AssignExpression
     	AssignExpression , Expression
     
    @@ -175,7 +175,7 @@

    Assign Expressions

    -
    AssignExpression:
    +
    AssignExpression:
     	ConditionalExpression
     	ConditionalExpression = AssignExpression
     	ConditionalExpression += AssignExpression
    @@ -216,7 +216,7 @@
     
     

    Conditional Expressions

    -
    ConditionalExpression:
    +
    ConditionalExpression:
     	OrOrExpression
     	OrOrExpression ? Expression : ConditionalExpression
     
    @@ -233,7 +233,7 @@

    OrOr Expressions

    -
    OrOrExpression:
    +
    OrOrExpression:
     	AndAndExpression
     	OrOrExpression || AndAndExpression
     
    @@ -259,7 +259,7 @@

    AndAnd Expressions

    -
    AndAndExpression:
    +
    AndAndExpression:
     	OrExpression
     	AndAndExpression && OrExpression
     
    @@ -295,7 +295,7 @@
     
     

    Or Expressions

    -
    OrExpression:
    +
    OrExpression:
     	XorExpression
     	OrExpression | XorExpression
     
    @@ -304,7 +304,7 @@

    Xor Expressions

    -
    XorExpression:
    +
    XorExpression:
     	AndExpression
     	XorExpression ^ AndExpression
     
    @@ -313,7 +313,7 @@

    And Expressions

    -
    AndExpression:
    +
    AndExpression:
     	EqualExpression
     	AndExpression & EqualExpression
     
    @@ -323,7 +323,7 @@

    Equality Expressions

    -
    EqualExpression:
    +
    EqualExpression:
     	RelExpression
     	EqualExpression == RelExpression
     	EqualExpression != RelExpression
    @@ -363,9 +363,13 @@
     
    For class and struct objects, the expression (a == b) + is rewritten as - a.opEquals(b), and (a != b) is rewritten as - !a.opEquals(b). + a.opEquals(b) +, and (a != b) + is rewritten as + !a.opEquals(b) +.

    For static and dynamic arrays, equality is defined as the @@ -380,7 +384,8 @@

    The is compares for identity. - To compare for not identity, use e1 !is e2. + To compare for not identity, use e1 !is e2 +. The type of the result is bool. The operands go through the usual conversions to bring them to a common type before comparison. @@ -403,7 +408,7 @@

    Relational Expressions

    -
    RelExpression:
    +
    RelExpression:
     	ShiftExpression
     	InExpression
     	RelExpression < ShiftExpression
    @@ -448,8 +453,7 @@
     	types.
     	

    - - +
    Integer comparison operators
    @@ -466,11 +470,11 @@
    Integer comparison operators
    OperatorRelation
    != not equal
    -

    - It is an error to have one operand be signed and the other +

    It is an error to have one operand be signed and the other unsigned for a <, <=, > or >= expression. Use casts to make both operands signed or both operands unsigned. +

    Floating point comparisons

    @@ -487,8 +491,7 @@ conditions to test for:

    - - +
    Floating point comparison operators
    Floating point comparison operators
    Operator Greater Than @@ -543,18 +546,20 @@

    Notes:

    -
      -
    1. For floating point comparison operators, (a !op b) is not the same as !(a op b). -
    2. "Unordered" means one or both of the operands is a NAN. -
    3. "Exception" means the Invalid Exception is raised if one + +
      1. For floating point comparison operators, (a !op b) is not the same + as !(a op b).
      2. +
      3. "Unordered" means one or both of the operands is a NAN.
      4. +
      5. "Exception" means the Invalid Exception is raised if one of the operands is a NAN. It does not mean an exception is thrown. The Invalid Exception can be checked using the functions in std.c.fenv. +

      In Expressions

      -
      InExpression:
      +
      InExpression:
       	RelExpression in ShiftExpression
       
      @@ -575,7 +580,7 @@

      Shift Expressions

      -
      ShiftExpression:
      +
      ShiftExpression:
       	AddExpression
       	ShiftExpression << AddExpression
       	ShiftExpression >> AddExpression
      @@ -602,7 +607,7 @@
       
       

      Add Expressions

      -
      AddExpression:
      +
      AddExpression:
       	MulExpression
       	AddExpression + MulExpression
       	AddExpression - MulExpression
      @@ -637,7 +642,7 @@
       
       

      Cat Expressions

      -
      CatExpression:
      +
      CatExpression:
       	AddExpression ~ MulExpression
       
      @@ -651,7 +656,7 @@

      Mul Expressions

      -
      MulExpression:
      +
      MulExpression:
       	UnaryExpression
       	MulExpression * UnaryExpression
       	MulExpression / UnaryExpression
      @@ -706,18 +711,18 @@
       
       

      New Expressions

      -
      NewExpression:
      +
      NewExpression:
       	NewArguments Type [ AssignExpression ]
       	NewArguments Type ( ArgumentList )
       	NewArguments Type
       	NewArguments ClassArguments BaseClasslistopt { DeclDefs } 
       
      -NewArguments:
      +NewArguments:
       	new ( ArgumentList )
       	new ( )
       	new
       
      -ClassArguments:
      +ClassArguments:
       	class ( ArgumentList )
       	class ( )
       	class
      @@ -776,7 +781,7 @@
       
       

      Delete Expressions

      -
      DeleteExpression:
      +
      DeleteExpression:
       	delete UnaryExpression
       

      If the UnaryExpression is a class object reference, and @@ -815,22 +820,24 @@

      Cast Expressions

      -
      CastExpression:
      +
      CastExpression:
       	cast ( Type ) UnaryExpression
       
      - A CastExpression converts the UnaryExpression +

      A CastExpression converts the UnaryExpression to Type. +

      cast(foo) -p;	// cast (-p) to type foo
       (foo) - p;	// subtract p from foo
       
      - Any casting of a class reference to a +

      Any casting of a class reference to a derived class reference is done with a runtime check to make sure it really is a downcast. null is the result if it isn't. Note: This is equivalent to the behavior of the dynamic_cast operator in C++. +

      class A { ... }
       class B : A { ... }
      @@ -844,8 +851,11 @@
       }
       
      - In order to determine if an object o is an instance of - a class B use a cast: +

      In order to determine if an object o + is an instance of + a class B + use a cast: +

      if (cast(B) o)
       {
      @@ -857,9 +867,10 @@
       }
       
      - Casting a floating point literal from one type to another +

      Casting a floating point literal from one type to another changes its type, but internally it is retained at full precision for the purposes of constant folding. +

      void test()
       {
      @@ -877,9 +888,16 @@
       }
       
      +

      Casting a value v to a struct S, when value is not a struct + of the same type, is equivalent to: +

      + +
      S(v)
      +
      +

      Postfix Expressions

      -
      PostfixExpression:
      +
      PostfixExpression:
       	PrimaryExpression
       	PostfixExpression . Identifier
       	PostfixExpression . NewExpression
      @@ -893,7 +911,7 @@
       
       

      Index Expressions

      -
      IndexExpression:
      +
      IndexExpression:
       	PostfixExpression [ ArgumentList ]
       
      @@ -921,7 +939,7 @@

      Slice Expressions

      -
      SliceExpression:
      +
      SliceExpression:
       	PostfixExpression [ ]
       	PostfixExpression [ AssignExpression .. AssignExpression ]
       
      @@ -962,7 +980,7 @@

      Primary Expressions

      -
      PrimaryExpression:
      +
      PrimaryExpression:
       	Identifier
       	.Identifier
       	this
      @@ -1022,7 +1040,8 @@
       	Within a non-static member function, super resolves to
       	a reference to the object that called the function, cast to
       	its base class. It is an error if there is no base class.
      -	(Only class Object has no base class.)
      +	(Only class Object
      + has no base class.)
       	super is not allowed in struct member
       	functions.
       	If a member function is called with an explicit reference
      @@ -1059,7 +1078,7 @@
       
       

      Array Literals

      -
      ArrayLiteral:
      +
      ArrayLiteral:
       	[ ArgumentList ]
       
      @@ -1083,7 +1102,7 @@

      Function Literals

      -
      FunctionLiteral
      +
      FunctionLiteral
       	function Typeopt ( ArgumentList )opt FunctionBody
       	delegate Typeopt ( ArgumentList )opt FunctionBody
       	( ArgumentList ) FunctionBody
      @@ -1193,7 +1212,7 @@
       
       

      Assert Expressions

      -
      AssertExpression:
      +
      AssertExpression:
       	assert ( Expression )
       	assert ( Expression , Expression )
       
      @@ -1204,13 +1223,15 @@ It is an error if the expression contains any side effects that the program depends on. The compiler may optionally not evaluate assert expressions at all. - The result type of an assert expression is void. + The result type of an assert expression is void +. Asserts are a fundamental part of the Contract Programming support in D.

      -

      The expression assert(0) is a special case; it +

      The expression assert(0) + is a special case; it signifies that it is unreachable code. Either AssertError is thrown at runtime if it is reachable, or the execution is halted @@ -1221,7 +1242,8 @@

      The second Expression, if present, must be implicitly - convertible to type char[]. It is evaluated if the + convertible to type char[] +. It is evaluated if the result is false, and the string result is appended to the AssertError's message.

      @@ -1298,7 +1320,6 @@ The forms of the IsExpression are:
        -
      1. is ( Type )
        The condition is satisfied if Type is semantically correct (it must be syntactically correct regardless). @@ -1439,40 +1460,39 @@ Furthermore, Identifier is set to be an alias of the type:

        - - +
        - + - + - + - + - + - + - + - + - + - +
        keyword alias type for Identifier
        typedef - the type that Type is a typedef of + typedefthe type that Type is a typedef of
        struct - Type + structType
        union - Type + unionType
        class - Type + classType
        interface - Type + interfaceType
        super - TypeTuple of base classes and interfaces + superTypeTuple of base classes and interfaces
        enum - the base type of the enum + enumthe base type of the enum
        function - TypeTuple of the function parameter types + functionTypeTuple of the function parameter types
        delegate - the function type of the delegate + delegatethe function type of the delegate
        return - the return type of the function, delegate, or function pointer + returnthe return type of the function, delegate, or function pointer

        alias short bar;
        @@ -1484,7 +1504,7 @@
             alias T U;			   // error, T is not defined
         
             static if ( is(E V == enum) )  // satisified, E is an enum
        -	V v;			   // x is declared to be a byte
        +	V v;			   // v is declared to be a byte
         }
         
        diff -uNr dmd-0.176/dmd/html/d/faq.html dmd-0.177/dmd/html/d/faq.html --- dmd-0.176/dmd/html/d/faq.html 2006-11-27 18:15:56.000000000 +0100 +++ dmd-0.177/dmd/html/d/faq.html 2006-12-09 00:40:28.000000000 +0100 @@ -31,7 +31,7 @@ -
        Last update Mon Nov 27 18:15:55 2006 +
        Last update Sat Dec 9 00:40:27 2006
        @@ -502,9 +502,9 @@
        double d;	// d is set to double.nan
         
        - NaN's have the interesting property in that whenever a NaN is + NaNs have the interesting property in that whenever a NaN is used as an operand in a computation, the result is a NaN. Therefore, - NaN's will propagate and appear in the output whenever a computation + NaNs will propagate and appear in the output whenever a computation made use of one. This implies that a NaN appearing in the output is an unambiguous indication of the use of an uninitialized variable. @@ -612,13 +612,15 @@ tool.

        Why not support regular expression literals - with the /foo/g syntax?

        + with the /foo/g + syntax?

        There are two reasons:

          -
        1. The /foo/g syntax would make it impossible to separate +
        2. The /foo/g + syntax would make it impossible to separate the lexer from the parser, as / is the divide token.
        3. There are already 3 string types; adding the regex literals diff -uNr dmd-0.176/dmd/html/d/float.html dmd-0.177/dmd/html/d/float.html --- dmd-0.176/dmd/html/d/float.html 2006-11-27 18:15:56.000000000 +0100 +++ dmd-0.177/dmd/html/d/float.html 2006-12-05 18:54:32.000000000 +0100 @@ -32,7 +32,7 @@ -
          Last update Mon Nov 27 18:15:54 2006 +
          Last update Tue Dec 5 18:54:30 2006
          @@ -132,16 +132,16 @@

          Floating Point Intermediate Values

          - On many computers, greater +

          On many computers, greater precision operations do not take any longer than lesser precision operations, so it makes numerical sense to use the greatest precision available for internal temporaries. The philosophy is not to dumb down the language to the lowest common hardware denominator, but to enable the exploitation of the best capabilities of target hardware. -

          +

          - For floating point operations and expression intermediate values, +

          For floating point operations and expression intermediate values, a greater precision can be used than the type of the expression. Only the minimum precision is set by the types of the @@ -150,17 +150,18 @@ it is expected (but not required) that the intermediate calculations be done to the full 80 bits of precision implemented by the hardware. -

          +

          - It's possible that, due to greater use of temporaries and +

          It's possible that, due to greater use of temporaries and common subexpressions, optimized code may produce a more accurate answer than unoptimized code. -

          +

          - Algorithms should be written to work based on the minimum +

          Algorithms should be written to work based on the minimum precision of the calculation. They should not degrade or fail if the actual precision is greater. Float or double types, as opposed to the real (extended) type, should only be used for: +

          • reducing memory consumption for large arrays
          • when speed is more important than accuracy
          • @@ -215,42 +216,47 @@

            Complex and Imaginary types

            - In existing languages, there is an astonishing amount of effort expended in trying to jam a +

            In existing languages, there is an astonishing amount of effort expended in trying to jam a complex type onto existing type definition facilities: templates, structs, operator overloading, etc., and it all usually ultimately fails. It fails because the semantics of complex operations can be subtle, and it fails because the compiler doesn't know what the programmer is trying to do, and so cannot optimize the semantic implementation. -

            +

            - This is all done to avoid adding a new type. Adding a new type means that the compiler +

            This is all done to avoid adding a new type. Adding a new type means that the compiler can make all the semantics of complex work "right". The programmer then can rely on a correct (or at least fixable ) implementation of complex. -

            +

            - Coming with the baggage of a complex type is the need for an imaginary type. An +

            Coming with the baggage of a complex type is the need for an imaginary type. An imaginary type eliminates some subtle semantic issues, and improves performance by not having to perform extra operations on the implied 0 real part. -

            +

            - Imaginary literals have an i suffix: +

            Imaginary literals have an i suffix: +

            ireal j = 1.3i;
             
            - There is no particular complex literal syntax, just add a real and imaginary type: +

            There is no particular complex literal syntax, just add a real and + imaginary type: +

            cdouble cd = 3.6 + 4i;
             creal c = 4.5 + 2i;
             
            - Complex, real and imaginary numbers have two properties: +

            Complex, real and imaginary numbers have two properties: +

             .re	get real part (0 for imaginary numbers)
             .im	get imaginary part as a real (0 for real numbers)
             
            - For example: +

            For example: +

             cd.re		is 4.5 double
            @@ -263,8 +269,10 @@
             
             

            Rounding Control

            - IEEE 754 floating point arithmetic includes the ability to set 4 different rounding modes. +

            IEEE 754 floating point arithmetic includes the ability to set 4 + different rounding modes. These are accessible via the functions in std.c.fenv. +

            Exception Flags

            @@ -284,7 +292,7 @@

            Floating Point Comparisons

            - In addition to the usual < <= > >= == != comparison +

            In addition to the usual < <= > >= == != comparison operators, D adds more that are specific to floating point. These are !<>= @@ -298,7 +306,7 @@ and match the semantics for the NCEG extensions to C. See Floating point comparisons. - +



            diff -uNr dmd-0.176/dmd/html/d/function.html dmd-0.177/dmd/html/d/function.html --- dmd-0.176/dmd/html/d/function.html 2006-12-02 20:08:52.000000000 +0100 +++ dmd-0.177/dmd/html/d/function.html 2006-12-09 00:40:28.000000000 +0100 @@ -32,7 +32,7 @@
          -
          Last update Sat Dec 2 20:08:51 2006 +
          Last update Sat Dec 9 00:40:27 2006
          @@ -177,8 +177,10 @@ overridden.

          - Functions marked as final may not be overridden in a - derived class, unless they are also private. + Functions marked as final + may not be overridden in a + derived class, unless they are also private +. For example:

          class A
          @@ -459,7 +461,8 @@
           2
           
          -

          A lazy parameter of type void can accept an argument +

          A lazy parameter of type void + can accept an argument of any type.

          Variadic Functions

          @@ -479,7 +482,8 @@ A C-style variadic function is declared as taking a parameter of ... after the required function parameters. - It has non-D linkage, such as extern (C): + It has non-D linkage, such as extern (C) +:
          extern (C) int foo(int x, int y, ...);
           
          @@ -495,10 +499,12 @@
           
           	C-style variadic functions match the C calling convention for
           	variadic functions, and is most useful for calling C library
          -	functions like printf.
          +	functions like printf
          +.
           	The implementiations of these variadic functions have a special
           	local variable declared for them,
          -	_argptr, which is a void* pointer to the first of the
          +	_argptr, which is a void*
          + pointer to the first of the
           	variadic
           	arguments. To access the arguments, _argptr must be cast
           	to a pointer to the expected argument type:
          @@ -532,7 +538,8 @@
           
           	These variadic functions have a special local variable declared for
           	them,
          -	_argptr, which is a void* pointer to the first of the
          +	_argptr, which is a void*
          + pointer to the first of the
           	variadic
           	arguments. To access the arguments, _argptr must be cast
           	to a pointer to the expected argument type:
          @@ -547,7 +554,26 @@
           
          An additional hidden argument - with the name _arguments and type TypeInfo[] + with the name _arguments + +

          +

          + + + + + + + and type TypeInfo[] + is passed to the function. _arguments gives the number of arguments and the type of each, enabling the creation of typesafe variadic functions. @@ -1110,7 +1136,8 @@

          The .ptr property of a delegate will return the - frame pointer value as a void*. + frame pointer value as a void* +.

          The .funcptr property of a delegate will return the @@ -1128,11 +1155,13 @@

          main() Function

          - For console programs, main() serves as the entry point. + For console programs, main() + serves as the entry point. It gets called after all the module initializers are run, and after any unittests are run. After it returns, all the module destructors are run. - main() must be declared using one of the following forms: + main() + must be declared using one of the following forms:
          void main() { ... }
           void main(char[][] args) { ... }
          @@ -1140,25 +1169,7 @@
           int main(char[][] args) { ... }
           
          - - -

          -

          - - - - - - - +) diff -uNr dmd-0.176/dmd/html/d/future.html dmd-0.177/dmd/html/d/future.html --- dmd-0.176/dmd/html/d/future.html 2006-11-27 18:15:56.000000000 +0100 +++ dmd-0.177/dmd/html/d/future.html 2006-12-05 18:54:32.000000000 +0100 @@ -32,7 +32,7 @@ -
          Last update Mon Nov 27 18:15:55 2006 +
          Last update Tue Dec 5 18:54:30 2006
          diff -uNr dmd-0.176/dmd/html/d/garbage.html dmd-0.177/dmd/html/d/garbage.html --- dmd-0.176/dmd/html/d/garbage.html 2006-11-30 02:37:58.000000000 +0100 +++ dmd-0.177/dmd/html/d/garbage.html 2006-12-09 00:40:28.000000000 +0100 @@ -32,7 +32,7 @@ -
          Last update Thu Nov 30 02:37:57 2006 +
          Last update Sat Dec 9 00:40:27 2006
          @@ -332,7 +332,8 @@ A copying garbage collector may change this value.

          -

        4. Do not store magic values into pointers, other than null. +
        5. Do not store magic values into pointers, other than null +.

        6. Do not write pointer values out to disk and read them back in @@ -382,11 +383,13 @@ This may result in intermediate conditions where there is not a valid pointer, and if the gc pauses the thread in such a condition, it can corrupt memory. - Most implementations of memcpy() will work since the + Most implementations of memcpy() + will work since the internal implementation of it does the copy in aligned chunks greater than or equal to a pointer size, but since this kind of implementation is not guaranteed by the C standard, use - memcpy() only with extreme caution. + memcpy() + only with extreme caution. diff -uNr dmd-0.176/dmd/html/d/glossary.html dmd-0.177/dmd/html/d/glossary.html --- dmd-0.176/dmd/html/d/glossary.html 2006-11-27 18:15:56.000000000 +0100 +++ dmd-0.177/dmd/html/d/glossary.html 2006-12-05 18:54:32.000000000 +0100 @@ -32,7 +32,7 @@ -
          Last update Mon Nov 27 18:15:55 2006 +
          Last update Tue Dec 5 18:54:30 2006
          diff -uNr dmd-0.176/dmd/html/d/html.html dmd-0.177/dmd/html/d/html.html --- dmd-0.176/dmd/html/d/html.html 2006-11-27 18:15:56.000000000 +0100 +++ dmd-0.177/dmd/html/d/html.html 2006-12-05 18:54:32.000000000 +0100 @@ -32,7 +32,7 @@ -
          Last update Mon Nov 27 18:15:54 2006 +
          Last update Tue Dec 5 18:54:30 2006
          diff -uNr dmd-0.176/dmd/html/d/htod.html dmd-0.177/dmd/html/d/htod.html --- dmd-0.176/dmd/html/d/htod.html 2006-11-27 18:15:58.000000000 +0100 +++ dmd-0.177/dmd/html/d/htod.html 2006-12-09 00:40:30.000000000 +0100 @@ -31,7 +31,7 @@ -
          Last update Mon Nov 27 18:15:57 2006 +
          Last update Sat Dec 9 00:40:28 2006
          @@ -238,7 +238,8 @@
          -hc
          By default, htod will insert the C and C++ declarations -in a file into the output file prefixed by //C . +in a file into the output file prefixed by //C +. -hc will suppress this. Use only if you're confident that htod is generating the correct output file (such as if the header file was modified with @@ -247,13 +248,15 @@
          -hi -
          By default, htod will represent a #include "file" with +
          By default, htod will represent a #include "file" + with a corresponding import statement. The -hi will cause the declarations in the included file to be converted to D declarations as well. The declarations in all included files are parsed regardless. -hi is handy when replacing an entire hierarchy of include files with a single D import. -System includes like #include <file> are not affected +System includes like #include <file> + are not affected by -hi. See also -hs.
          @@ -308,7 +311,8 @@ void bar(int x, int y, long z);
      -

      The C declarations are prefixed by the string "//C ".

      +

      The C declarations are prefixed by the string "//C " +.

      Type Mappings

      diff -uNr dmd-0.176/dmd/html/d/htomodule.html dmd-0.177/dmd/html/d/htomodule.html --- dmd-0.176/dmd/html/d/htomodule.html 2006-11-30 02:37:58.000000000 +0100 +++ dmd-0.177/dmd/html/d/htomodule.html 2006-12-09 00:40:28.000000000 +0100 @@ -31,7 +31,7 @@ -
      Last update Thu Nov 30 02:37:57 2006 +
      Last update Sat Dec 9 00:40:27 2006
      @@ -189,22 +189,28 @@
      -

      Converting C .h Files to D Modules

      +

      Converting C .h + Files to D Modules

      While D cannot directly compile C source code, it can easily interface to C code, be linked with C object files, and call C functions in DLLs. - The interface to C code is normally found in C .h files. + The interface to C code is normally found in C .h + files. So, the trick to connecting with C code is in converting C - .h files to D modules. + .h + files to D modules. This turns out to be difficult to do mechanically since inevitably some human judgement must be applied. This is a guide to doing such conversions.

      Preprocessor

      - .h files can sometimes be a bewildering morass of layers of - macros, #include files, #ifdef's, etc. D doesn't + .h + files can sometimes be a bewildering morass of layers of + macros, #include + files, #ifdef +'s, etc. D doesn't include a text preprocessor like the C preprocessor, so the first step is to remove the need for it by taking the preprocessed output. For DMC (the Digital @@ -213,11 +219,15 @@
      dmc -c program.h -e -l
       
      - will create a file program.lst which is the source file after + will create a file program.lst + which is the source file after all text preprocessing.

      - Remove all the #if, #ifdef, #include, + Remove all the #if +, #ifdef +, #include +, etc. statements.

      Linkage

      @@ -286,13 +296,18 @@

      NULL

      - NULL and ((void*)0) should be replaced - with null. + NULL + and ((void*)0) + should be replaced + with null +.

      Numeric Literals

      Any 'L' or 'l' numeric literal suffixes should be removed, - as a C long is (usually) the same size as a D int. + as a C long + is (usually) the same size as a D int +. Similarly, 'LL' suffixes should be replaced with a single 'L'. Any 'u' suffix will work the same in D. @@ -419,8 +434,10 @@

      Const Type Modifiers

      - D has const as a storage class, not a type modifier. Hence, just - drop any const used as a type modifier: + D has const + as a storage class, not a type modifier. Hence, just + drop any const + used as a type modifier:
      void foo(const int *p, char *const q);
       
      @@ -437,31 +454,38 @@ there will be a multiple definition error. To fix this problem, the idea is to declare the variable in a D module, but not link in that module. For example, given a C header file named - foo.h: + foo.h +:
      struct Foo { };
       struct Foo bar;
       
      - It can be replaced with two D modules, foo.d: + It can be replaced with two D modules, foo.d +:
      struct Foo { }
       import fooextern;
       
      - and fooextern.d: + and fooextern.d +:
      Foo bar;
       
      - The foo.obj file is linked in, and fooextern.obj + The foo.obj + file is linked in, and fooextern.obj + is not. While this is not the most elegant looking method, it does work, and since it is pretty rare in C libraries to use global variables in its interface, it isn't an issue in practice.

      Typedef

      - alias is the D equivalent to the C typedef: + alias + is the D equivalent to the C typedef +:
      typedef int foo;
       
      @@ -494,8 +518,11 @@ A good D implementation by default will align struct members the same way as the C compiler it was designed to work with. But - if the .h file has some #pragma's to control alignment, they - can be duplicated with the D align attribute: + if the .h + file has some #pragma +'s to control alignment, they + can be duplicated with the D align + attribute:
      #pragma pack(1)
       struct Foo
      @@ -559,7 +586,10 @@
       }
       
      -

      __cdecl, __pascal, __stdcall

      +

      __cdecl +, __pascal +, __stdcall +

      int __cdecl x;
       int __cdecl foo(int a);
      @@ -575,7 +605,8 @@
       extern (Windows) int abc(int c);
       
      -

      __declspec(dllimport)

      +

      __declspec(dllimport) +

      __declspec(dllimport) int __stdcall foo(int a);
       
      @@ -585,9 +616,11 @@
      export extern (Windows) int foo(int a);
       
      -

      __fastcall

      +

      __fastcall +

      - Unfortunately, D doesn't support the __fastcall convention. + Unfortunately, D doesn't support the __fastcall + convention. Therefore, a shim will be needed, either written in C:
      int __fastcall foo(int a);
      @@ -598,10 +631,12 @@
       }
       
      - and compiled with a C compiler that supports __fastcall and + and compiled with a C compiler that supports __fastcall + and linked in, or compile the above, disassemble it with obj2asm - and insert it in a D myfoo shim with + and insert it in a D myfoo + shim with inline assembler. diff -uNr dmd-0.176/dmd/html/d/iasm.html dmd-0.177/dmd/html/d/iasm.html --- dmd-0.176/dmd/html/d/iasm.html 2006-11-27 18:15:56.000000000 +0100 +++ dmd-0.177/dmd/html/d/iasm.html 2006-12-05 18:54:32.000000000 +0100 @@ -32,7 +32,7 @@
      -
      Last update Mon Nov 27 18:15:54 2006 +
      Last update Tue Dec 5 18:54:30 2006
      diff -uNr dmd-0.176/dmd/html/d/index.html dmd-0.177/dmd/html/d/index.html --- dmd-0.176/dmd/html/d/index.html 2006-11-27 18:15:54.000000000 +0100 +++ dmd-0.177/dmd/html/d/index.html 2006-12-05 18:54:30.000000000 +0100 @@ -32,7 +32,7 @@ -
      Last update Mon Nov 27 18:15:52 2006 +
      Last update Tue Dec 5 18:54:28 2006
      @@ -199,11 +199,9 @@ practical experience implementing compilers." -- Michael

      -

      "Great, just what I need.. another D in programming." -- Segfault

      -

      D is a systems programming language. Its focus is on combining the power and high performance of C and C++ with the programmer productivity of modern languages like Ruby and Python. diff -uNr dmd-0.176/dmd/html/d/interface.html dmd-0.177/dmd/html/d/interface.html --- dmd-0.176/dmd/html/d/interface.html 2006-11-27 18:15:56.000000000 +0100 +++ dmd-0.177/dmd/html/d/interface.html 2006-12-09 00:41:36.000000000 +0100 @@ -32,7 +32,7 @@ -

      Last update Mon Nov 27 18:15:54 2006 +
      Last update Sat Dec 9 00:41:34 2006
      @@ -227,7 +227,7 @@ d.foo(); // returns 2;
      - Interfaces can be reimplemented in derived classes: +

      Interfaces can be reimplemented in derived classes:

      interface D
       {
      @@ -255,8 +255,9 @@
       d2.foo();		// returns 2, even though it is A's D, not B's D
       
      - A reimplemented interface must implement all the interface +

      A reimplemented interface must implement all the interface functions, it does not inherit them from a super class: +

      interface D
       {
      @@ -282,16 +283,18 @@
       	

      A COM interface is defined as one that derives from the interface - std.c.windows.com.IUnknown. A COM interface differs from + std.c.windows.com.IUnknown +. A COM interface differs from a regular D interface in that: -

        -
      • It derives from the interface std.c.windows.com.IUnknown. -
      • It cannot be the argument of a DeleteExpression. -
      • References cannot be upcast to the enclosing class object, nor +
        • It derives from the interface std.c.windows.com.IUnknown +.
        • +
        • It cannot be the argument of a DeleteExpression.
        • +
        • References cannot be upcast to the enclosing class object, nor can they be downcast to a derived interface. To accomplish this, - an appropriate QueryInterface() would have to be implemented - for that interface in standard COM fashion. + an appropriate QueryInterface() + would have to be implemented + for that interface in standard COM fashion.
        diff -uNr dmd-0.176/dmd/html/d/interfaceToC.html dmd-0.177/dmd/html/d/interfaceToC.html --- dmd-0.176/dmd/html/d/interfaceToC.html 2006-11-30 02:38:00.000000000 +0100 +++ dmd-0.177/dmd/html/d/interfaceToC.html 2006-12-09 00:40:30.000000000 +0100 @@ -32,7 +32,7 @@
      -
      Last update Thu Nov 30 02:37:58 2006 +
      Last update Sat Dec 9 00:40:28 2006
      @@ -173,7 +173,8 @@
    4. There are no __cdecl, __far, __stdcall, __declspec, or other such C type modifiers in D. These are handled by attributes, such - as extern (C). + as extern (C) +.
    5. There are no const or volatile type modifiers in D. To declare a C function that uses those type modifiers, just drop those @@ -406,12 +407,12 @@
    type function(parameters)type(*)(parameters)type function(parameters)type(*)(parameters)
    type delegate(parameters)type delegate(parameters) no equivalent
    - -
    Overloadable Unary Operators
    op - opfunc + + + - + - + - + - + - + - +
    Overloadable Unary Operators
    op opfunc
    -e - opNeg + -eopNeg
    +e - opPos + +eopPos
    ~e - opCom + ~eopCom
    e++ - opPostInc + e++opPostInc
    e-- - opPostDec + e--opPostDec
    cast(type)e - opCast + cast(type)eopCast
    -

    - Given a unary +

    Given a unary overloadable operator op and its corresponding class or struct member function name opfunc, the syntax: +

     op a
    @@ -239,198 +238,77 @@
     

    Binary Operator Overloading

    - - -
    Overloadable Binary Operators
    op + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - + + + + +
    Overloadable Binary Operators
    op commutative? opfunc opfunc_r +
    + - yes - opAdd - opAdd_r +
    + yes opAdd opAdd_r
    - - no - opSub - opSub_r +
    - no opSub opSub_r
    * - yes - opMul - opMul_r +
    * yes opMul opMul_r
    / - no - opDiv - opDiv_r +
    / no opDiv opDiv_r
    % - no - opMod - opMod_r +
    % no opMod opMod_r
    & - yes - opAnd - opAnd_r +
    & yes opAnd opAnd_r
    | - yes - opOr - opOr_r +
    | yes opOr opOr_r
    ^ - yes - opXor - opXor_r +
    ^ yes opXor opXor_r
    << - no - opShl - opShl_r +
    << no opShl opShl_r
    >> - no - opShr - opShr_r +
    >> no opShr opShr_r
    >>> - no - opUShr - opUShr_r +
    >>> no opUShr opUShr_r
    ~ - no - opCat - opCat_r +
    ~ no opCat opCat_r
    == - yes - opEquals - - +
    == yes opEquals -
    != - yes - opEquals - - +
    != yes opEquals -
    < - yes - opCmp - - +
    < yes opCmp -
    <= - yes - opCmp - - +
    <= yes opCmp -
    > - yes - opCmp - - +
    > yes opCmp -
    >= - yes - opCmp - - +
    >= yes opCmp -
    += - no - opAddAssign - - +
    = no opAssign -
    -= - no - opSubAssign - - +
    += no opAddAssign -
    *= - no - opMulAssign - - +
    -= no opSubAssign -
    /= - no - opDivAssign - - +
    *= no opMulAssign -
    %= - no - opModAssign - - +
    /= no opDivAssign -
    &= - no - opAndAssign - - +
    %= no opModAssign -
    |= - no - opOrAssign - - +
    &= no opAndAssign -
    ^= - no - opXorAssign - - +
    |= no opOrAssign -
    <<= - no - opShlAssign - - +
    ^= no opXorAssign -
    >>= - no - opShrAssign - - +
    <<= no opShlAssign -
    >>>= - no - opUShrAssign - - - -
    ~= - no - opCatAssign - - -
    >>= no opShrAssign -
    in no opIn opIn_r
    >>>= no opUShrAssign -
    ~= no opCatAssign -
    in no opIn opIn_r
    @@ -616,8 +494,9 @@

    Function Call Operator Overloading f()

    - The function call operator, (), can be overloaded by +

    The function call operator, (), can be overloaded by declaring a function named opCall: +

    struct F
     {
    @@ -634,20 +513,21 @@
     }
     
    - In this way a struct or class object can behave as if it +

    In this way a struct or class object can behave as if it were a function. - +

    Array Operator Overloading

    Overloading Indexing a[i]

    - The array index operator, [], can be overloaded by +

    The array index operator, [], can be overloaded by declaring a function named opIndex with one or more parameters. Assignment to an array can be overloaded with a function named opIndexAssign with two or more parameters. The first parameter is the rvalue of the assignment expression. +

    struct A
     {
    @@ -664,20 +544,22 @@
     }
     
    - In this way a struct or class object can behave as if it +

    In this way a struct or class object can behave as if it were an array. -

    +

    - Note: Array index overloading currently does not +

    Note: Array index overloading currently does not work for the lvalue of an op=, ++, or -- operator. +

    Overloading Slicing a[] and a[i .. j]

    - Overloading the slicing operator means overloading expressions +

    Overloading the slicing operator means overloading expressions like a[] and a[i .. j]. This can be done by declaring a function named opSlice. Assignment to a slice can be done by declaring opSliceAssign. +

    class A
     {
    @@ -701,6 +583,31 @@
     }
     
    +

    Assignment Operator Overloading

    + +

    The assignment operator = can be overloaded if the + lvalue is a struct or class aggregate, and opAssign + is a member function of that aggregate.

    + +

    The assignment operator cannot be overloaded for rvalues + that can be implicitly cast to the lvalue type. + Furthermore, the following parameter signatures for opAssign + are not allowed:

    + +
    opAssign(...)
    +opAssign(T)
    +opAssign(T, ...)
    +opAssign(T ...)
    +opAssign(T, U = defaultValue, etc.)
    +
    + +

    where T is the same type as the aggregate type A, + is implicitly + convertible to A, or if A is a struct and T + is a pointer to a type that is + implicitly convertible to A. +

    +

    Future Directions

    The operators =, !, ., &&, ||, ?:, and a few others will likely never diff -uNr dmd-0.176/dmd/html/d/overview.html dmd-0.177/dmd/html/d/overview.html --- dmd-0.176/dmd/html/d/overview.html 2006-11-27 18:15:54.000000000 +0100 +++ dmd-0.177/dmd/html/d/overview.html 2006-12-09 00:40:28.000000000 +0100 @@ -31,7 +31,7 @@ -
    Last update Mon Nov 27 18:15:52 2006 +
    Last update Sat Dec 9 00:40:27 2006
    @@ -641,7 +641,9 @@ Instead of #include'ing the text of a file of declarations, just import the module. There is no need to worry about multiple imports of the same module, no need to wrapper header - files with #ifndef/#endif or #pragma once kludges, + files with #ifndef/#endif + or #pragma once + kludges, etc.

    @@ -678,6 +680,7 @@

    Note: Of course, in C++, trivial functions like { return 7; } + are written inline too, but complex ones are not. In addition, if there are any forward references, the functions need to be prototyped. The following will not work in C++: @@ -856,9 +859,11 @@ The classic example of this are the argc and argv parameters to main(int argc , char *argv -[]). +[]) +. (In D, main is declared as main(char[][] args -).) +) +.)

  • Arrays are not first class objects. When an array is passed to a function, it is diff -uNr dmd-0.176/dmd/html/d/phobos/object.html dmd-0.177/dmd/html/d/phobos/object.html --- dmd-0.176/dmd/html/d/phobos/object.html 2006-12-02 02:46:24.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/object.html 2006-12-09 01:16:36.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:23 2006 +
    Last update Sat Dec 9 01:16:34 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/phobos.html dmd-0.177/dmd/html/d/phobos/phobos.html --- dmd-0.176/dmd/html/d/phobos/phobos.html 2006-12-02 02:46:28.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/phobos.html 2006-12-09 01:16:38.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Sat Dec 2 02:46:26 2006 +
    Last update Sat Dec 9 01:16:37 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_base64.html dmd-0.177/dmd/html/d/phobos/std_base64.html --- dmd-0.176/dmd/html/d/phobos/std_base64.html 2006-12-02 02:46:24.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_base64.html 2006-12-09 01:16:36.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:23 2006 +
    Last update Sat Dec 9 01:16:34 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_bind.html dmd-0.177/dmd/html/d/phobos/std_bind.html --- dmd-0.176/dmd/html/d/phobos/std_bind.html 2006-12-02 02:46:24.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_bind.html 2006-12-09 01:16:36.000000000 +0100 @@ -11,7 +11,7 @@ -Digital Mars - The D Programming Language - Bind +Digital Mars - The D Programming Language - std.bind @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:23 2006 +
    Last update Sat Dec 9 01:16:35 2006
    @@ -123,12 +123,12 @@
    -

    Bind

    +

    std.bind

    -Bind function arguments to functions. +Bind function arguments to functions.

    References:
    -boost::bind +boost::bind

    Authors:
    Tomasz Stachowiak diff -uNr dmd-0.176/dmd/html/d/phobos/std_bitarray.html dmd-0.177/dmd/html/d/phobos/std_bitarray.html --- dmd-0.176/dmd/html/d/phobos/std_bitarray.html 2006-12-02 02:46:24.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_bitarray.html 2006-12-09 01:16:36.000000000 +0100 @@ -28,7 +28,7 @@
    -
    Last update Sat Dec 2 02:46:23 2006 +
    Last update Sat Dec 9 01:16:35 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_boxer.html dmd-0.177/dmd/html/d/phobos/std_boxer.html --- dmd-0.176/dmd/html/d/phobos/std_boxer.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_boxer.html 2006-12-09 01:16:36.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:24 2006 +
    Last update Sat Dec 9 01:16:35 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_c_fenv.html dmd-0.177/dmd/html/d/phobos/std_c_fenv.html --- dmd-0.176/dmd/html/d/phobos/std_c_fenv.html 2006-12-02 02:46:28.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_c_fenv.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:26 2006 +
    Last update Sat Dec 9 01:16:37 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_c_math.html dmd-0.177/dmd/html/d/phobos/std_c_math.html --- dmd-0.176/dmd/html/d/phobos/std_c_math.html 2006-12-02 02:46:28.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_c_math.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:26 2006 +
    Last update Sat Dec 9 01:16:37 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_compiler.html dmd-0.177/dmd/html/d/phobos/std_compiler.html --- dmd-0.176/dmd/html/d/phobos/std_compiler.html 2006-12-02 02:46:24.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_compiler.html 2006-12-09 01:16:36.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Sat Dec 2 02:46:23 2006 +
    Last update Sat Dec 9 01:16:34 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_conv.html dmd-0.177/dmd/html/d/phobos/std_conv.html --- dmd-0.176/dmd/html/d/phobos/std_conv.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_conv.html 2006-12-09 01:16:36.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:24 2006 +
    Last update Sat Dec 9 01:16:35 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_cover.html dmd-0.177/dmd/html/d/phobos/std_cover.html --- dmd-0.176/dmd/html/d/phobos/std_cover.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_cover.html 2006-12-09 01:16:36.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:24 2006 +
    Last update Sat Dec 9 01:16:35 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_c_process.html dmd-0.177/dmd/html/d/phobos/std_c_process.html --- dmd-0.176/dmd/html/d/phobos/std_c_process.html 2006-12-02 02:46:28.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_c_process.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:26 2006 +
    Last update Sat Dec 9 01:16:37 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_cpuid.html dmd-0.177/dmd/html/d/phobos/std_cpuid.html --- dmd-0.176/dmd/html/d/phobos/std_cpuid.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_cpuid.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:24 2006 +
    Last update Sat Dec 9 01:16:35 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_c_stdarg.html dmd-0.177/dmd/html/d/phobos/std_c_stdarg.html --- dmd-0.176/dmd/html/d/phobos/std_c_stdarg.html 2006-12-02 02:46:28.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_c_stdarg.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:26 2006 +
    Last update Sat Dec 9 01:16:37 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_c_stddef.html dmd-0.177/dmd/html/d/phobos/std_c_stddef.html --- dmd-0.176/dmd/html/d/phobos/std_c_stddef.html 2006-12-02 02:46:28.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_c_stddef.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:26 2006 +
    Last update Sat Dec 9 01:16:37 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_c_stdio.html dmd-0.177/dmd/html/d/phobos/std_c_stdio.html --- dmd-0.176/dmd/html/d/phobos/std_c_stdio.html 2006-12-02 02:46:28.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_c_stdio.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:26 2006 +
    Last update Sat Dec 9 01:16:37 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_c_stdlib.html dmd-0.177/dmd/html/d/phobos/std_c_stdlib.html --- dmd-0.176/dmd/html/d/phobos/std_c_stdlib.html 2006-12-02 02:46:28.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_c_stdlib.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:26 2006 +
    Last update Sat Dec 9 01:16:37 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_cstream.html dmd-0.177/dmd/html/d/phobos/std_cstream.html --- dmd-0.176/dmd/html/d/phobos/std_cstream.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_cstream.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:24 2006 +
    Last update Sat Dec 9 01:16:36 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_c_string.html dmd-0.177/dmd/html/d/phobos/std_c_string.html --- dmd-0.176/dmd/html/d/phobos/std_c_string.html 2006-12-02 02:46:28.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_c_string.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:26 2006 +
    Last update Sat Dec 9 01:16:37 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_c_time.html dmd-0.177/dmd/html/d/phobos/std_c_time.html --- dmd-0.176/dmd/html/d/phobos/std_c_time.html 2006-12-02 02:46:28.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_c_time.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:26 2006 +
    Last update Sat Dec 9 01:16:37 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_ctype.html dmd-0.177/dmd/html/d/phobos/std_ctype.html --- dmd-0.176/dmd/html/d/phobos/std_ctype.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_ctype.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:24 2006 +
    Last update Sat Dec 9 01:16:36 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_c_wcharh.html dmd-0.177/dmd/html/d/phobos/std_c_wcharh.html --- dmd-0.176/dmd/html/d/phobos/std_c_wcharh.html 2006-12-02 02:46:28.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_c_wcharh.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:26 2006 +
    Last update Sat Dec 9 01:16:37 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_date.html dmd-0.177/dmd/html/d/phobos/std_date.html --- dmd-0.176/dmd/html/d/phobos/std_date.html 2006-12-02 02:46:24.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_date.html 2006-12-09 01:16:36.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:23 2006 +
    Last update Sat Dec 9 01:16:35 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_demangle.html dmd-0.177/dmd/html/d/phobos/std_demangle.html --- dmd-0.176/dmd/html/d/phobos/std_demangle.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_demangle.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:24 2006 +
    Last update Sat Dec 9 01:16:36 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_file.html dmd-0.177/dmd/html/d/phobos/std_file.html --- dmd-0.176/dmd/html/d/phobos/std_file.html 2006-12-02 02:46:24.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_file.html 2006-12-09 01:16:36.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:23 2006 +
    Last update Sat Dec 9 01:16:35 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_format.html dmd-0.177/dmd/html/d/phobos/std_format.html --- dmd-0.176/dmd/html/d/phobos/std_format.html 2006-12-02 02:46:24.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_format.html 2006-12-09 01:16:36.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:23 2006 +
    Last update Sat Dec 9 01:16:34 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_gc.html dmd-0.177/dmd/html/d/phobos/std_gc.html --- dmd-0.176/dmd/html/d/phobos/std_gc.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_gc.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:24 2006 +
    Last update Sat Dec 9 01:16:36 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_intrinsic.html dmd-0.177/dmd/html/d/phobos/std_intrinsic.html --- dmd-0.176/dmd/html/d/phobos/std_intrinsic.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_intrinsic.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:24 2006 +
    Last update Sat Dec 9 01:16:36 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_math.html dmd-0.177/dmd/html/d/phobos/std_math.html --- dmd-0.176/dmd/html/d/phobos/std_math.html 2006-12-02 02:46:24.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_math.html 2006-12-09 01:16:34.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:22 2006 +
    Last update Sat Dec 9 01:16:33 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_md5.html dmd-0.177/dmd/html/d/phobos/std_md5.html --- dmd-0.176/dmd/html/d/phobos/std_md5.html 2006-12-02 02:46:24.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_md5.html 2006-12-09 01:16:36.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:23 2006 +
    Last update Sat Dec 9 01:16:35 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_mmfile.html dmd-0.177/dmd/html/d/phobos/std_mmfile.html --- dmd-0.176/dmd/html/d/phobos/std_mmfile.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_mmfile.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:24 2006 +
    Last update Sat Dec 9 01:16:36 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_openrj.html dmd-0.177/dmd/html/d/phobos/std_openrj.html --- dmd-0.176/dmd/html/d/phobos/std_openrj.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_openrj.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:24 2006 +
    Last update Sat Dec 9 01:16:36 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_outbuffer.html dmd-0.177/dmd/html/d/phobos/std_outbuffer.html --- dmd-0.176/dmd/html/d/phobos/std_outbuffer.html 2006-12-02 02:46:24.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_outbuffer.html 2006-12-09 01:16:36.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:22 2006 +
    Last update Sat Dec 9 01:16:34 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_outofmemory.html dmd-0.177/dmd/html/d/phobos/std_outofmemory.html --- dmd-0.176/dmd/html/d/phobos/std_outofmemory.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_outofmemory.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:24 2006 +
    Last update Sat Dec 9 01:16:36 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_path.html dmd-0.177/dmd/html/d/phobos/std_path.html --- dmd-0.176/dmd/html/d/phobos/std_path.html 2006-12-02 02:46:24.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_path.html 2006-12-09 01:16:34.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:22 2006 +
    Last update Sat Dec 9 01:16:33 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_process.html dmd-0.177/dmd/html/d/phobos/std_process.html --- dmd-0.176/dmd/html/d/phobos/std_process.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_process.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:24 2006 +
    Last update Sat Dec 9 01:16:36 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_random.html dmd-0.177/dmd/html/d/phobos/std_random.html --- dmd-0.176/dmd/html/d/phobos/std_random.html 2006-12-02 02:46:24.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_random.html 2006-12-09 01:16:36.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:23 2006 +
    Last update Sat Dec 9 01:16:34 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_regexp.html dmd-0.177/dmd/html/d/phobos/std_regexp.html --- dmd-0.176/dmd/html/d/phobos/std_regexp.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_regexp.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:25 2006 +
    Last update Sat Dec 9 01:16:36 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_signals.html dmd-0.177/dmd/html/d/phobos/std_signals.html --- dmd-0.176/dmd/html/d/phobos/std_signals.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_signals.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:25 2006 +
    Last update Sat Dec 9 01:16:36 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_socket.html dmd-0.177/dmd/html/d/phobos/std_socket.html --- dmd-0.176/dmd/html/d/phobos/std_socket.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_socket.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:25 2006 +
    Last update Sat Dec 9 01:16:36 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_socketstream.html dmd-0.177/dmd/html/d/phobos/std_socketstream.html --- dmd-0.176/dmd/html/d/phobos/std_socketstream.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_socketstream.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:25 2006 +
    Last update Sat Dec 9 01:16:37 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_stdint.html dmd-0.177/dmd/html/d/phobos/std_stdint.html --- dmd-0.176/dmd/html/d/phobos/std_stdint.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_stdint.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:25 2006 +
    Last update Sat Dec 9 01:16:37 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_stdio.html dmd-0.177/dmd/html/d/phobos/std_stdio.html --- dmd-0.176/dmd/html/d/phobos/std_stdio.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_stdio.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:25 2006 +
    Last update Sat Dec 9 01:16:37 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_stream.html dmd-0.177/dmd/html/d/phobos/std_stream.html --- dmd-0.176/dmd/html/d/phobos/std_stream.html 2006-12-02 02:46:24.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_stream.html 2006-12-09 01:16:36.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:22 2006 +
    Last update Sat Dec 9 01:16:34 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_string.html dmd-0.177/dmd/html/d/phobos/std_string.html --- dmd-0.176/dmd/html/d/phobos/std_string.html 2006-12-02 02:46:24.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_string.html 2006-12-09 01:16:36.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:22 2006 +
    Last update Sat Dec 9 01:16:34 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_system.html dmd-0.177/dmd/html/d/phobos/std_system.html --- dmd-0.176/dmd/html/d/phobos/std_system.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_system.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:25 2006 +
    Last update Sat Dec 9 01:16:37 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_thread.html dmd-0.177/dmd/html/d/phobos/std_thread.html --- dmd-0.176/dmd/html/d/phobos/std_thread.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_thread.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:25 2006 +
    Last update Sat Dec 9 01:16:37 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_traits.html dmd-0.177/dmd/html/d/phobos/std_traits.html --- dmd-0.176/dmd/html/d/phobos/std_traits.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_traits.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:25 2006 +
    Last update Sat Dec 9 01:16:37 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_typetuple.html dmd-0.177/dmd/html/d/phobos/std_typetuple.html --- dmd-0.176/dmd/html/d/phobos/std_typetuple.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_typetuple.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:25 2006 +
    Last update Sat Dec 9 01:16:37 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_uni.html dmd-0.177/dmd/html/d/phobos/std_uni.html --- dmd-0.176/dmd/html/d/phobos/std_uni.html 2006-12-02 02:46:26.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_uni.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:25 2006 +
    Last update Sat Dec 9 01:16:37 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_uri.html dmd-0.177/dmd/html/d/phobos/std_uri.html --- dmd-0.176/dmd/html/d/phobos/std_uri.html 2006-12-02 02:46:28.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_uri.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:26 2006 +
    Last update Sat Dec 9 01:16:37 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_utf.html dmd-0.177/dmd/html/d/phobos/std_utf.html --- dmd-0.176/dmd/html/d/phobos/std_utf.html 2006-12-02 02:46:28.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_utf.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:26 2006 +
    Last update Sat Dec 9 01:16:37 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_windows_charset.html dmd-0.177/dmd/html/d/phobos/std_windows_charset.html --- dmd-0.176/dmd/html/d/phobos/std_windows_charset.html 2006-12-02 02:46:28.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_windows_charset.html 2006-12-09 01:16:38.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:26 2006 +
    Last update Sat Dec 9 01:16:37 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_zip.html dmd-0.177/dmd/html/d/phobos/std_zip.html --- dmd-0.176/dmd/html/d/phobos/std_zip.html 2006-12-02 02:46:24.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_zip.html 2006-12-09 01:16:36.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:23 2006 +
    Last update Sat Dec 9 01:16:35 2006
    diff -uNr dmd-0.176/dmd/html/d/phobos/std_zlib.html dmd-0.177/dmd/html/d/phobos/std_zlib.html --- dmd-0.176/dmd/html/d/phobos/std_zlib.html 2006-12-02 02:46:24.000000000 +0100 +++ dmd-0.177/dmd/html/d/phobos/std_zlib.html 2006-12-09 01:16:36.000000000 +0100 @@ -28,7 +28,7 @@ -
    Last update Sat Dec 2 02:46:23 2006 +
    Last update Sat Dec 9 01:16:35 2006
    diff -uNr dmd-0.176/dmd/html/d/portability.html dmd-0.177/dmd/html/d/portability.html --- dmd-0.176/dmd/html/d/portability.html 2006-11-27 18:15:56.000000000 +0100 +++ dmd-0.177/dmd/html/d/portability.html 2006-12-09 00:40:28.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Mon Nov 27 18:15:54 2006 +
    Last update Sat Dec 9 00:40:27 2006
    @@ -171,7 +171,8 @@
  • Avoid dependence on the size of a pointer or reference being the same size as a particular integral type. -
  • If size dependencies are inevitable, put an assert in +
  • If size dependencies are inevitable, put an assert + in the code to verify it:
    assert(int.sizeof == (int*).sizeof);
    diff -uNr dmd-0.176/dmd/html/d/pragma.html dmd-0.177/dmd/html/d/pragma.html
    --- dmd-0.176/dmd/html/d/pragma.html	2006-11-27 18:15:54.000000000 +0100
    +++ dmd-0.177/dmd/html/d/pragma.html	2006-12-05 18:54:30.000000000 +0100
    @@ -32,7 +32,7 @@
     	
     	
     
    -	
    Last update Mon Nov 27 18:15:52 2006 +
    Last update Tue Dec 5 18:54:29 2006
    @@ -131,8 +131,8 @@

    Pragmas

    Pragma:
    -    pragma ( Identifier )
    -    pragma ( Identifier , ExpressionList )
    +    pragma ( Identifier )
    +    pragma ( Identifier , ExpressionList )
     
    diff -uNr dmd-0.176/dmd/html/d/pretod.html dmd-0.177/dmd/html/d/pretod.html --- dmd-0.176/dmd/html/d/pretod.html 2006-11-27 18:15:52.000000000 +0100 +++ dmd-0.177/dmd/html/d/pretod.html 2006-12-09 00:40:28.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Mon Nov 27 18:15:51 2006 +
    Last update Sat Dec 9 00:40:26 2006
    @@ -572,7 +572,8 @@

    The C Preprocessor Way

    - The first way is to use the #error preprocessing directive: + The first way is to use the #error + preprocessing directive:
    #if FOO || BAR
         ... code to compile ...
    @@ -582,12 +583,14 @@
     
    This has the limitations inherent in preprocessor expressions - (i.e. integer constant expressions only, no casts, no sizeof, + (i.e. integer constant expressions only, no casts, no sizeof +, no symbolic constants, etc.).

    These problems can be circumvented to some extent by defining a - static_assert macro (thanks to M. Wilson): + static_assert + macro (thanks to M. Wilson):

    #define static_assert(_x) do { typedef int ai[(_x) ? 1 : 0]; } while(0)
     
    @@ -605,7 +608,8 @@ evaluates to false. The limitations of this technique are a sometimes very confusing error message from the compiler, along with an inability - to use a static_assert outside of a function body. + to use a static_assert + outside of a function body.

    The D Way

    diff -uNr dmd-0.176/dmd/html/d/property.html dmd-0.177/dmd/html/d/property.html --- dmd-0.176/dmd/html/d/property.html 2006-11-27 18:15:54.000000000 +0100 +++ dmd-0.177/dmd/html/d/property.html 2006-12-09 00:40:28.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Mon Nov 27 18:15:52 2006 +
    Last update Sat Dec 9 00:40:27 2006
    @@ -181,11 +181,12 @@

    .init Property

    - .init produces a constant expression that is the default +

    .init produces a constant expression that is the default initializer. If applied to a type, it is the default initializer for that type. If applied to a variable or field, it is the default initializer for that variable or field. For example: +

    int a;
     int b = 1;
    @@ -212,14 +213,14 @@
     
     

    Class and Struct Properties

    - Properties are member functions that can be syntactically treated +

    Properties are member functions that can be syntactically treated as if they were fields. Properties can be read from or written to. A property is read by calling a method with no arguments; a property is written by calling a method with its argument being the value it is set to. -

    +

    - A simple property would be: +

    A simple property would be:

    struct Foo
     {
    @@ -232,7 +233,7 @@
     }
     
    - To use it: +

    To use it:

    int test()
     {
    @@ -243,20 +244,20 @@
     }
     
    - The absence of a read method means that the property is write-only. +

    The absence of a read method means that the property is write-only. The absence of a write method means that the property is read-only. Multiple write methods can exist; the correct one is selected using the usual function overloading rules. -

    +

    - In all the other respects, these methods are like any other methods. +

    In all the other respects, these methods are like any other methods. They can be static, have different linkages, be overloaded with methods with multiple parameters, have their address taken, etc. -

    +

    - Note: Properties currently cannot be the lvalue of an +

    Note: Properties currently cannot be the lvalue of an op=, ++, or -- operator. - +



    diff -uNr dmd-0.176/dmd/html/d/rationale.html dmd-0.177/dmd/html/d/rationale.html --- dmd-0.176/dmd/html/d/rationale.html 2006-11-27 18:15:58.000000000 +0100 +++ dmd-0.177/dmd/html/d/rationale.html 2006-12-09 00:40:30.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Mon Nov 27 18:15:56 2006 +
    Last update Sat Dec 9 00:40:28 2006
    @@ -340,7 +340,9 @@
    if the NaNs are done correctly. -

    Why use static if(0) rather than if (0)?

    +

    Why use static if(0) + rather than if (0)? +

    Some limitations are: diff -uNr dmd-0.176/dmd/html/d/regular-expression.html dmd-0.177/dmd/html/d/regular-expression.html --- dmd-0.176/dmd/html/d/regular-expression.html 2006-11-27 18:15:58.000000000 +0100 +++ dmd-0.177/dmd/html/d/regular-expression.html 2006-12-09 00:40:30.000000000 +0100 @@ -31,7 +31,7 @@ -
    Last update Mon Nov 27 18:15:57 2006 +
    Last update Sat Dec 9 00:40:28 2006
    @@ -312,7 +312,8 @@ "g"); // result: StRAp A Rocket engine on A chicken.
    -(toupper() comes from std.string.) +(toupper() + comes from std.string.)

    Looping

    diff -uNr dmd-0.176/dmd/html/d/statement.html dmd-0.177/dmd/html/d/statement.html --- dmd-0.176/dmd/html/d/statement.html 2006-11-27 18:15:54.000000000 +0100 +++ dmd-0.177/dmd/html/d/statement.html 2006-12-09 00:40:28.000000000 +0100 @@ -31,7 +31,7 @@ -
    Last update Mon Nov 27 18:15:53 2006 +
    Last update Sat Dec 9 00:40:27 2006
    @@ -280,7 +280,8 @@ The expression is evaluated.

    - Expressions that have no effect, like (x + x), + Expressions that have no effect, like (x + x) +, are illegal in expression statements. If such an expression is needed, casting it to void will @@ -1048,16 +1049,19 @@ x++; - The second form, goto default;, transfers to the + The second form, goto default; +, transfers to the innermost DefaultStatement of an enclosing SwitchStatement.

    - The third form, goto case;, transfers to the + The third form, goto case; +, transfers to the next CaseStatement of the innermost enclosing SwitchStatement.

    - The fourth form, goto case Expression;, transfers to the + The fourth form, goto case Expression; +, transfers to the CaseStatement of the innermost enclosing SwitchStatement with a matching Expression. @@ -1114,7 +1118,8 @@ } - Note that expression only gets evaluated once. + Note that expression + only gets evaluated once. The with statement does not change what this or super refer to.

    diff -uNr dmd-0.176/dmd/html/d/struct.html dmd-0.177/dmd/html/d/struct.html --- dmd-0.176/dmd/html/d/struct.html 2006-11-27 18:15:54.000000000 +0100 +++ dmd-0.177/dmd/html/d/struct.html 2006-12-06 13:29:00.000000000 +0100 @@ -23,8 +23,7 @@ www.digitalmars.com

    -
    -
    Last update Mon Nov 27 18:15:53 2006 +
    Last update Wed Dec 6 13:28:58 2006
    @@ -130,6 +129,216 @@

    Structs & Unions

    +

    Whereas classes are reference types, structs are value types. + Any C struct can be exactly represented as a D struct. + In C++ parlance, a D struct is a POD (Plain Old Data) type, + with a trivial constructors and destructors. + Structs and unions are meant as simple aggregations of data, or as a way + to paint a data structure over hardware or an external type. External + types can be defined by the operating system API, or by a file format. + Object oriented features are provided with the class data type. +

    + +

    A struct is defined to not have an identity; that is, + the implementation is free to make bit copies of the struct + as convenient.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Struct, Class Comparison Table
    FeaturestructclassC structC++ structC++ class
    value typeX XXX
    reference type X   
    data membersXXXXX
    hidden members X XX
    static membersXX XX
    default member initializersXX   
    bit fields  XXX
    non-virtual member functionsXX XX
    virtual member functions X XX
    constructors X XX
    destructors X XX
    RAII X XX
    operator overloadingXX XX
    inheritance X XX
    invariantsXX   
    unit testsXX   
    synchronizable X   
    parameterizableXX XX
    alignment controlXX   
    member protectionXX XX
    default publicXXXX 
    tag name space  XXX
    anonymousX XXX
    +
    AggregateDeclaration:
     	Tag { DeclDefs }
     	Tag Identifier StructBody
    @@ -149,6 +358,8 @@
     
     StructBodyDeclaration:
     	Declaration
    +	StaticConstructor
    +	StaticDestructor
     	Invariant
     	UnitTest
     	StructAllocator
    @@ -161,13 +372,12 @@
     	ClassDeallocator
     
    -They work like they do in C, with the following exceptions: +

    They work like they do in C, with the following exceptions:

    -
      -
    • no bit fields -
    • alignment can be explicitly specified -
    • no separate tag name space - tag names go into the current scope -
    • declarations like: +
      • no bit fields
      • +
      • alignment can be explicitly specified
      • +
      • no separate tag name space - tag names go into the current scope
      • +
      • declarations like:
        struct ABC x;
         
        @@ -175,15 +385,12 @@
        ABC x;
         
        -
      • anonymous structs/unions are allowed as members of other structs/unions -
      • Default initializers for members can be supplied. -
      • Member functions and static members are allowed. +
      • +
      • anonymous structs/unions are allowed as members of other structs/unions
      • +
      • Default initializers for members can be supplied.
      • +
      • Member functions and static members are allowed.
      -Structs and unions are meant as simple aggregations of data, or as a way to paint a -data structure over hardware or an external type. External types can be defined by -the operating system API, or by a file format. Object oriented features are -provided with the class data type.

      Static Initialization of Structs

      @@ -220,6 +427,43 @@ but occupy more storage, have the extra storage initialized to zero. +

      Dynamic Initialization of Structs

      + +

      Structs can be dynamically initialized from another + value of the same type:

      + +
      struct S { int a; }
      +S t;      // default initialized
      +t.a = 3;
      +S s = t;  // s.a is set to 3
      +
      + +

      If opCall + is overridden for the struct, and the struct + is initialized with a value that is of a different type, + then the opCall + operator is called:

      + +
      struct S
      +{   int a;
      +
      +    static S opCall(int v)
      +    {	S s;
      +	s.a = v;
      +	return s;
      +    }
      +
      +    static S opCall(S v)
      +    {	S s;
      +	s.a = v.a + 1;
      +	return s;
      +    }
      +}
      +
      +S s = 3;	// sets s.a to 3
      +S t = s;	// sets t.a to 3, S.opCall(s) is not called
      +
      +

      Struct Properties

      @@ -262,8 +506,7 @@
       Copyright © 1999-2006 by Digital Mars, All Rights Reserved
        |
       Page generated by Ddoc. |
      -Comments
      +Comments
       
    diff -uNr dmd-0.176/dmd/html/d/template.html dmd-0.177/dmd/html/d/template.html --- dmd-0.176/dmd/html/d/template.html 2006-11-27 18:15:56.000000000 +0100 +++ dmd-0.177/dmd/html/d/template.html 2006-12-05 18:54:32.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Mon Nov 27 18:15:54 2006 +
    Last update Tue Dec 5 18:54:29 2006
    @@ -134,7 +134,6 @@ I think that I can safely say that nobody understands template mechanics. -- Richard Deyman

    -

    Templates are D's approach to generic programming. Templates are defined with a TemplateDeclaration:

    diff -uNr dmd-0.176/dmd/html/d/templates-revisited.html dmd-0.177/dmd/html/d/templates-revisited.html --- dmd-0.176/dmd/html/d/templates-revisited.html 2006-11-27 18:15:58.000000000 +0100 +++ dmd-0.177/dmd/html/d/templates-revisited.html 2006-12-09 00:40:30.000000000 +0100 @@ -33,7 +33,7 @@ -
    Last update Mon Nov 27 18:15:57 2006 +
    Last update Sat Dec 9 00:40:28 2006
    @@ -206,7 +206,6 @@ don't understand it... That is because I don't understand it. Nobody does."
    -- Richard Deeman

    -

    Abstract

    @@ -255,8 +254,10 @@

    are syntactically ambiguous, both to the compiler and the programmer. -If you run across a<b,c>d; in unfamiliar code, you've got to slog through -an arbitrarily large amount of declarations and .h files to figure out +If you run across a<b,c>d; + in unfamiliar code, you've got to slog through +an arbitrarily large amount of declarations and .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? @@ -277,7 +278,8 @@

    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, a must be a template. +code to determine that yes, a + must be a template.

    @@ -314,7 +316,8 @@ } -

    The Foo forms a name space for the templates, which are accessed by, +

    The Foo + forms a name space for the templates, which are accessed by, for example:

    @@ -362,7 +365,8 @@ 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 A: +module A +:

    module A;
    @@ -373,7 +377,8 @@
     }
     
    -

    it can be accessed from module B like: +

    it can be accessed from module B + like:

    module B;
    @@ -459,7 +464,7 @@
     
     
    template Foo(T) ...
     template Foo(T:T*) ...
    -template Foo(T, T) ...
    +template Foo(T, U:T) ...
     template Foo(T, U) ...
     template Foo(T, U:int) ...
     
    @@ -469,7 +474,7 @@
     Foo!(long,long)  // picks Foo(T, T)
     Foo!(long,short) // picks Foo(T, U)
     Foo!(long,int)   // picks Foo(T, U:int)
    -Foo!(int,int)    // ambiguous - Foo(T, T)
    +Foo!(int,int)    // ambiguous - Foo(T, U:T)
                      // or Foo(T, U:int)
     
    @@ -594,11 +599,15 @@

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

    @@ -631,13 +640,22 @@ } -

    Template IsFunctionT relies on two side effects to achieve its result. +

    Template IsFunctionT + relies on two side effects to achieve its result. First, it relies on arrays of functions being an invalid C++ type. -Thus, if U is a function type, the second test will not be selected -since to do so would cause an error (SFINAE). The first test will be selected. -If U is not a function type, the second test is a better fit than ... . -Next, it is determined which test was selected by examining the size -of the return value, i.e. sizeof(One) or sizeof(Two). +Thus, if U + is a function type, the second test + will not be selected +since to do so would cause an error (SFINAE). The first test + will be selected. +If U + is not a function type, the second test + is a better fit than ... . +Next, it is determined which test + was selected by examining the size +of the return value, i.e. sizeof(One) + or 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.

    @@ -655,16 +673,21 @@ void test() { - typedef int fp(int); + alias int fp(int); assert(IsFunctionT!(fp) == 1); } -

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

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

    Although SFINAE can be used, the is expressions can test a type directly, @@ -673,7 +696,7 @@

    void test()
     {
    -  typedef int fp(int);
    +  alias int fp(int);
     
       assert( is(fp == function) );
     }
    @@ -683,7 +706,8 @@
     
     

    Let's move on to things that are impractical with templates in C++. For example, this template returns the square root of -real number x using the Babylonian method: +real number x + using the Babylonian method:

    import std.stdio;
    diff -uNr dmd-0.176/dmd/html/d/tuple.html dmd-0.177/dmd/html/d/tuple.html
    --- dmd-0.176/dmd/html/d/tuple.html	2006-11-27 18:16:00.000000000 +0100
    +++ dmd-0.177/dmd/html/d/tuple.html	2006-12-05 18:54:34.000000000 +0100
    @@ -34,7 +34,7 @@
     	
     	
     
    -	
    Last update Mon Nov 27 18:15:58 2006 +
    Last update Tue Dec 5 18:54:32 2006
    diff -uNr dmd-0.176/dmd/html/d/type.html dmd-0.177/dmd/html/d/type.html --- dmd-0.176/dmd/html/d/type.html 2006-11-27 18:15:54.000000000 +0100 +++ dmd-0.177/dmd/html/d/type.html 2006-12-09 00:40:28.000000000 +0100 @@ -32,151 +32,85 @@ -
    Last update Mon Nov 27 18:15:52 2006 +
    Last update Sat Dec 9 00:40:27 2006
    +$(SPEC_S Types, - -
    -

    Types

    -

    Basic Data Types

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

    Derived Data Types

    @@ -395,24 +329,7 @@ dg(3); // call o.member(3)
    - - -

    -

    - - - - - - + diff -uNr dmd-0.176/dmd/html/d/variadic-function-templates.html dmd-0.177/dmd/html/d/variadic-function-templates.html --- dmd-0.176/dmd/html/d/variadic-function-templates.html 2006-11-27 18:16:00.000000000 +0100 +++ dmd-0.177/dmd/html/d/variadic-function-templates.html 2006-12-05 18:54:34.000000000 +0100 @@ -33,7 +33,7 @@ -
    Last update Mon Nov 27 18:15:58 2006 +
    Last update Tue Dec 5 18:54:32 2006
    diff -uNr dmd-0.176/dmd/html/d/version.html dmd-0.177/dmd/html/d/version.html --- dmd-0.176/dmd/html/d/version.html 2006-11-27 18:15:56.000000000 +0100 +++ dmd-0.177/dmd/html/d/version.html 2006-12-09 00:40:28.000000000 +0100 @@ -32,7 +32,7 @@ -
    Last update Mon Nov 27 18:15:54 2006 +
    Last update Sat Dec 9 00:40:27 2006
    @@ -316,7 +316,9 @@
    These are presumably set by the command line as - -version=n and -version=identifier. + -version=n + and -version=identifier +. @@ -446,7 +448,9 @@ These are presumably set by the command line as - -debug=n and -debug=identifier. + -debug=n + and -debug=identifier +.

    Static If Condition

    diff -uNr dmd-0.176/dmd/html/d/warnings.html dmd-0.177/dmd/html/d/warnings.html --- dmd-0.176/dmd/html/d/warnings.html 2006-11-27 18:15:58.000000000 +0100 +++ dmd-0.177/dmd/html/d/warnings.html 2006-12-09 00:40:30.000000000 +0100 @@ -31,7 +31,7 @@ -
    Last update Mon Nov 27 18:15:57 2006 +
    Last update Sat Dec 9 00:40:28 2006
    @@ -247,8 +247,10 @@ that bypasses type checking, this can mask another bug that could be introduced if the types of a, b or c change in the future, or if their types are set by a template - instantiation. (In generic code, the cast(byte) would - probably be cast(typeof(a))). + instantiation. (In generic code, the cast(byte) + would + probably be cast(typeof(a)) +).
  • Changing the type of a to int. This is generally a better solution, but of course may not work @@ -273,6 +275,7 @@
  • Add a new construct, implicit_cast(type)expression + that is a restricted form of the general cast, and will only work where implicit casts would normally be allowed. @@ -462,7 +465,8 @@ 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 std.switcherr.SwitchError, some prefer at least + an instance of std.switcherr.SwitchError +, some prefer at least a warning so such errors can be caught at compile time.

    @@ -513,7 +517,8 @@ } -

  • Putting the dead code inside a version(none) conditional: +
  • Putting the dead code inside a version(none) + conditional:
    int foo(int i)
     {
         return i;
    diff -uNr dmd-0.176/dmd/html/d/wc.html dmd-0.177/dmd/html/d/wc.html
    --- dmd-0.176/dmd/html/d/wc.html	2006-11-27 18:15:56.000000000 +0100
    +++ dmd-0.177/dmd/html/d/wc.html	2006-12-05 18:54:32.000000000 +0100
    @@ -32,7 +32,7 @@
     	
     	
     
    -	
    Last update Mon Nov 27 18:15:55 2006 +
    Last update Tue Dec 5 18:54:30 2006
    diff -uNr dmd-0.176/dmd/html/d/windbg.html dmd-0.177/dmd/html/d/windbg.html --- dmd-0.176/dmd/html/d/windbg.html 2006-11-27 18:15:58.000000000 +0100 +++ dmd-0.177/dmd/html/d/windbg.html 2006-12-09 00:40:30.000000000 +0100 @@ -31,7 +31,7 @@ -
    Last update Mon Nov 27 18:15:57 2006 +
    Last update Sat Dec 9 00:40:28 2006
    @@ -191,36 +191,801 @@

    Debugging D on Windows

    -

    The Microsoft Windows debugger \dmd\bin\windbg.exe +

    The Microsoft Windows debugger + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + can be used to symbolically debug D programs, even though it is a C++ debugger. -Versions of windbg.exe - other than the one supplied may not work with D. -

    +Versions of + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + other than the one supplied may not work with D. +

    + +

    To prepare a program for symbolic debugging, compile +with the -g switch: +

    + +
    dmd myprogram -g
    +
    + +

    To invoke the debugger on it: +

    + +
    windbg myprogram args...
    +
    + +

    where + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + are the command line arguments to myprogram.exe. +

    + +

    When the debugger comes up, entering the command in the command window:

    + +
    g _Dmain
    +
    + +

    will execute the program up until the entry into + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -

    To prepare a program for symbolic debugging, compile -with the -g switch: -

    -
    dmd myprogram -g
    -
    -

    To invoke the debugger on it: -

    -
    windbg myprogram args...
    -
    -

    where args... - are the command line arguments to myprogram.exe. -

    -

    When the debugger comes up, entering the command in the command window:

    -
    g _Dmain
    -
    -

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

    @@ -241,7 +1006,198 @@

    For more comprehensive information on windbg, consult the -file \dmd\bin\windbg.hlp +file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + .

    diff -uNr dmd-0.176/dmd/html/d/windows.html dmd-0.177/dmd/html/d/windows.html --- dmd-0.176/dmd/html/d/windows.html 2006-11-27 18:15:56.000000000 +0100 +++ dmd-0.177/dmd/html/d/windows.html 2006-12-09 00:40:28.000000000 +0100 @@ -31,7 +31,7 @@
    -
    Last update Mon Nov 27 18:15:54 2006 +
    Last update Sat Dec 9 00:40:27 2006
    @@ -232,15 +232,19 @@ Windows GUI applications can be written with D. A sample such can be found in \dmd\samples\d\winsamp.d +

    These are required:

      -
    1. Instead of a main function serving as the entry point, - a WinMain function is needed. +
    2. Instead of a main + function serving as the entry point, + a WinMain + function is needed. -
    3. WinMain must follow this form: +
    4. WinMain + must follow this form:
      import std.c.windows.windows;
       
       extern (C) void gc_init();
      @@ -291,8 +295,10 @@
       }
       
      - The myWinMain() function is where the user code goes, the - rest of WinMain is boilerplate to initialize and shut down + The myWinMain() + function is where the user code goes, the + rest of WinMain + is boilerplate to initialize and shut down the D runtime system.
    5. A .def @@ -308,7 +314,8 @@ Without those, Win32 will open a text console window whenever the application is run. -
    6. The presence of WinMain() is recognized by the compiler +
    7. The presence of WinMain() + is recognized by the compiler causing it to emit a reference to __acrtused_dll and the phobos.lib runtime library.