The Thermopylae excerpt of TDPL available online

duser4ever no at spam.com
Sat Oct 31 20:17:19 PDT 2009


Andrei Alexandrescu Wrote:

> It's a rough rough draft, but one for the full chapter on arrays, 
> associative arrays, and strings.
> 
> http://erdani.com/d/thermopylae.pdf
> 
> Any feedback is welcome. Thanks!
> 
> 
> Andrei

Sure I haven't come across anything that someone else hasn't already pointed out, but here it is any:

P133 "Table 9.1 on page 301 summarizes dynamic array operations"
     should read
     "Table 3.4 on page 134 summarizes dynamic array operations"

P118 something sounds wrong here also:
     "However, if a function returns T[n], that not automatically
     converted to T[]--it must be T[n]."
     
     maybe "it is not automatically" vice "that not automatically"?

P117 this sentence does not sound natural to me;
     "This means that copying arrays, passing arrays into functions, 
     and returning arrays from functions -- these all
     copy entire arrays."
	
P111 change "in it" on line 8 to read "into it" 

P111 change "bailout" on line 21 to read "bail out" 

P110 change "responsible in making" to "responsible for making"

     Not clear what you are saying here:
	
     "The compiler is free to assume that when optimizing the operations into primitive vector operations offered by the host processor."
	
     What is it assuming? That I'm responsible? That the arrays do not overlap?

P109
     auto a = [1.0, 2.5, 3.6];
     auto b = [4.5, 5.5, 1.4];
     auto c = new double[3]; // changing to "auto c = (new double[3])[] = 0.0;" or adding the line "c[] = 0.0;" should do the trick
     c[] += 4 * a[] + b[];
	
     will not work. Since c is of type double[3] it's initial value is set to [nan, nan, nan];
     As a result any transaction performed on this array will result in the same if it is not first initialized.
	
P102 eenlists should read enlists

P101 change "comes just handy" to "comes in handy"





More information about the Digitalmars-d mailing list