Changeset 2154

Show
Ignore:
Timestamp:
11/10/10 15:10:30 (2 years ago)
Author:
walter
Message:

bugzilla 2572 2nd try

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/docsrc/doc.ddoc

    r2140 r2154  
    158158    $(TOCENTRY interface.html, Interfaces) 
    159159    $(TOCENTRY enum.html, Enums) 
    160     $(TOCENTRY const3.html, Const and Invariant
     160    $(TOCENTRY const3.html, Const and Immutable
    161161    $(TOCENTRY function.html, Functions) 
    162162    $(TOCENTRY operatoroverloading.html, Operator Overloading) 
  • trunk/docsrc/safed.dd

    r2040 r2154  
    190190     
    191191    $(P 
    192     The function $(CODE writeln) is the equivalent of the C $(CODE printf) (more precisely, it's the representative of a family of output functions including $(CODE write) and its formatting versions, $(CODE writef) and $(CODE writefln)). Just like $(CODE printf),  $(CODE writeln) accepts a variable number of arguments of arbitrary types. But here the similarity ends. As long as you pass SafeD-arguments to $(CODE writeln), you are guaranteed not to encounter any undefined behavior. Here, $(CODE writeln) is called with a single argument of the type $(CODE string). In contrast to C, D $(CODE string) is not a pointer. It is an array of $(CODE invariant char), and arrays are a built into the safe subset of D.  
     192    The function $(CODE writeln) is the equivalent of the C $(CODE printf) (more precisely, it's the representative of a family of output functions including $(CODE write) and its formatting versions, $(CODE writef) and $(CODE writefln)). Just like $(CODE printf),  $(CODE writeln) accepts a variable number of arguments of arbitrary types. But here the similarity ends. As long as you pass SafeD-arguments to $(CODE writeln), you are guaranteed not to encounter any undefined behavior. Here, $(CODE writeln) is called with a single argument of the type $(CODE string). In contrast to C, D $(CODE string) is not a pointer. It is an array of $(CODE immutable char), and arrays are a built into the safe subset of D.  
    193193    ) 
    194194