Forum Navigation
Learn to Tango with D - Errata update
Posted: 09/20/08 17:35:49 Modified: 09/20/08 18:07:06Would go here:
http://www.dsource.org/projects/tango/wiki/LearnToTangoWithD/Errata
On page 33, Array Operations, Slicing, examples:
int x[] = [0,1,2,3,4]; int y[] = x[1..x.length]; int z[]; z = x[1..x.length-1]; int all = x[]; // all is a view of all of x, from the first //L13 // element to the last, i.e., 0, 1, 2, 3, 4.The last line should read:
int all[] = x[];and a dmd v1.030 compile agrees. The code from the book yields a compile error:
Error: test.d(13): Error: cannot implicitly convert expression (x[]) of type int[] to int