digitalmars.D - TDPL Errata site is down
- Andrej Mitrovic (4/4) Jul 23 2010 Or, it has some database problems.
- Andrei Alexandrescu (5/11) Jul 23 2010 Yes, I noticed only this morning. Thanks! The database is gone, but I
- Andrej Mitrovic (9/23) Jul 23 2010 No problem :)
- Andrej Mitrovic (6/35) Jul 23 2010 Ouch! That wasn't the error, it was the line before it, specifically the...
- Andrej Mitrovic (2/16) Jul 25 2010
- Andrej Mitrovic (11/30) Jul 26 2010 Here's some more for the Errata (I've checked against the cached one):
- Andrej Mitrovic (18/58) Jul 26 2010 Another one:
- bearophile (5/7) Jul 26 2010 It is code that can't compile, so what it does is undefined behaviour :-...
- Andrej Mitrovic (5/18) Jul 26 2010 Ok. It's in the bugzilla:
- Joel C. Salomon (7/11) Oct 24 2010 Actually, this is not talking about D’s (array) slicing but C++’s
- Andrei Alexandrescu (3/14) Oct 24 2010 Thanks! Will fix.
- Jonathan M Davis (9/24) Oct 24 2010 =E2=80=9D in quotes to
- retard (4/25) Oct 24 2010 Walter has many times mentioned how segfaults are actually better than
- Ellery Newcomer (2/5) Oct 24 2010 null dereference exploits notwithstanding?
Or, it has some database problems. http://erdani.com/tdpl/errata/index.php?title=Errata_for_%22The_D_Programming_Language%22_book Luckily the cached version works fine: http://webcache.googleusercontent.com/search?q=cache:nIyQeOaM1hAJ:erdani.com/tdpl/errata/index.php%3Ftitle%3DErrata_for_%2522The_D_Programming_Language%2522_book+the+d+programming+language+errata&cd=3&hl=en&ct=clnk
Jul 23 2010
Andrej Mitrovic wrote:Or, it has some database problems. http://erdani.com/tdpl/errata/index.php?title=Errata_for_%22The_D_Programming_Language%22_book Luckily the cached version works fine: http://webcache.googleusercontent.com/search?q=cache:nIyQeOaM1hAJ:erdani.com/tdpl/errata/index.php%3Ftitle%3DErrata_for_%2522The_D_Programming_Language%2522_book+the+d+programming+language+errata&cd=3&hl=en&ct=clnkYes, I noticed only this morning. Thanks! The database is gone, but I saved the google cache of the errata and will reenter the data tonite. Thanks again, Andrei
Jul 23 2010
Andrei Alexandrescu Wrote:Andrej Mitrovic wrote:No problem :) Btw, where can we ask questions regarding the examples in the book? There's this line on page 11: assert(binarySearch!(int)([1, 3, 6, 7, 9, 15], 6)); But I'm getting a compiler error: binarysearch1.d(21): Error: template binarysearch1.binarySearch(T) does not match any function template declaration binarysearch1.d(21): Error: template binarysearch1.binarySearch(T) cannot deduce template function from argument types !()(bool,int) That should work with the example code, right?Or, it has some database problems. http://erdani.com/tdpl/errata/index.php?title=Errata_for_%22The_D_Programming_Language%22_book Luckily the cached version works fine: http://webcache.googleusercontent.com/search?q=cache:nIyQeOaM1hAJ:erdani.com/tdpl/errata/index.php%3Ftitle%3DErrata_for_%2522The_D_Programming_Language%2522_book+the+d+programming+language+errata&cd=3&hl=en&ct=clnkYes, I noticed only this morning. Thanks! The database is gone, but I saved the google cache of the errata and will reenter the data tonite. Thanks again, Andrei
Jul 23 2010
Andrej Mitrovic Wrote:Andrei Alexandrescu Wrote:Ouch! That wasn't the error, it was the line before it, specifically the second line here: assert(binarySearch([1, 3, 6, 7, 9, 15], 6)); assert(binarySearch(![1, 3, 6, 7, 9, 15], 5)); assert(binarySearch!(int)([1, 3, 6, 7, 9, 15], 6)); I put the exclamation mark in the wrong position. Doh!(!). :pAndrej Mitrovic wrote:No problem :) Btw, where can we ask questions regarding the examples in the book? There's this line on page 11: assert(binarySearch!(int)([1, 3, 6, 7, 9, 15], 6)); But I'm getting a compiler error: binarysearch1.d(21): Error: template binarysearch1.binarySearch(T) does not match any function template declaration binarysearch1.d(21): Error: template binarysearch1.binarySearch(T) cannot deduce template function from argument types !()(bool,int) That should work with the example code, right?Or, it has some database problems. http://erdani.com/tdpl/errata/index.php?title=Errata_for_%22The_D_Programming_Language%22_book Luckily the cached version works fine: http://webcache.googleusercontent.com/search?q=cache:nIyQeOaM1hAJ:erdani.com/tdpl/errata/index.php%3Ftitle%3DErrata_for_%2522The_D_Programming_Language%2522_book+the+d+programming+language+errata&cd=3&hl=en&ct=clnkYes, I noticed only this morning. Thanks! The database is gone, but I saved the google cache of the errata and will reenter the data tonite. Thanks again, Andrei
Jul 23 2010
I can't compile the stats example, it uses readf() (on page 22), but the compiler complains that it's undefined. I found readf() in the library under std.stream, but importing that won't work. I'm using DMD 2.047. Andrei Alexandrescu Wrote:Andrej Mitrovic wrote:Or, it has some database problems. http://erdani.com/tdpl/errata/index.php?title=Errata_for_%22The_D_Programming_Language%22_book Luckily the cached version works fine: http://webcache.googleusercontent.com/search?q=cache:nIyQeOaM1hAJ:erdani.com/tdpl/errata/index.php%3Ftitle%3DErrata_for_%2522The_D_Programming_Language%2522_book+the+d+programming+language+errata&cd=3&hl=en&ct=clnkYes, I noticed only this morning. Thanks! The database is gone, but I saved the google cache of the errata and will reenter the data tonite. Thanks again, Andrei
Jul 25 2010
Here's some more for the Errata (I've checked against the cached one): Page 26: "In D, slicing could never occur." This should probably be "In D slicing, this could never occur." Page 50: "If the indexing expression is on the left-hand side of an assignment operation (e.g., arr[i] = e) and a is an associative array.." 'arr' is an associative array, not 'a' Page 57: "a is c || writefln("Indeed... not the same");" Replace writefln with writeln Page 59: "line.length > 0 || line = "\n"; Compiler error: cannot implicitly convert expression ("\x0a") of type string to bool Andrej Mitrovic Wrote:I can't compile the stats example, it uses readf() (on page 22), but the compiler complains that it's undefined. I found readf() in the library under std.stream, but importing that won't work. I'm using DMD 2.047. Andrei Alexandrescu Wrote:Andrej Mitrovic wrote:Or, it has some database problems. http://erdani.com/tdpl/errata/index.php?title=Errata_for_%22The_D_Programming_Language%22_book Luckily the cached version works fine: http://webcache.googleusercontent.com/search?q=cache:nIyQeOaM1hAJ:erdani.com/tdpl/errata/index.php%3Ftitle%3DErrata_for_%2522The_D_Programming_Language%2522_book+the+d+programming+language+errata&cd=3&hl=en&ct=clnkYes, I noticed only this morning. Thanks! The database is gone, but I saved the google cache of the errata and will reenter the data tonite. Thanks again, Andrei
Jul 26 2010
Another one: Page 76: The second foreach example with the ref symbol which has the wrong type compiles without an error (it should not). What is also weird is that the values are left unchanged: float[] arr = [1.0, 2.5, 4.0]; foreach (ref double elem; arr) { elem /= 2; writeln(elem); } writeln(arr); Prints out: 0.5 1.25 2 1 2.5 4 I think this should go into the bug tracker for DMD? Andrej Mitrovic Wrote:Here's some more for the Errata (I've checked against the cached one): Page 26: "In D, slicing could never occur." This should probably be "In D slicing, this could never occur." Page 50: "If the indexing expression is on the left-hand side of an assignment operation (e.g., arr[i] = e) and a is an associative array.." 'arr' is an associative array, not 'a' Page 57: "a is c || writefln("Indeed... not the same");" Replace writefln with writeln Page 59: "line.length > 0 || line = "\n"; Compiler error: cannot implicitly convert expression ("\x0a") of type string to bool Andrej Mitrovic Wrote:I can't compile the stats example, it uses readf() (on page 22), but the compiler complains that it's undefined. I found readf() in the library under std.stream, but importing that won't work. I'm using DMD 2.047. Andrei Alexandrescu Wrote:Andrej Mitrovic wrote:Or, it has some database problems. http://erdani.com/tdpl/errata/index.php?title=Errata_for_%22The_D_Programming_Language%22_book Luckily the cached version works fine: http://webcache.googleusercontent.com/search?q=cache:nIyQeOaM1hAJ:erdani.com/tdpl/errata/index.php%3Ftitle%3DErrata_for_%2522The_D_Programming_Language%2522_book+the+d+programming+language+errata&cd=3&hl=en&ct=clnkYes, I noticed only this morning. Thanks! The database is gone, but I saved the google cache of the errata and will reenter the data tonite. Thanks again, Andrei
Jul 26 2010
Andrej Mitrovic:The second foreach example with the ref symbol which has the wrong type compiles without an error (it should not).It's a bug (keyword: accepts-invalid), put it in Bugzilla if not already present.What is also weird is that the values are left unchanged:It is code that can't compile, so what it does is undefined behaviour :-) Bye, bearophile
Jul 26 2010
Ok. It's in the bugzilla: http://d.puremagic.com/issues/show_bug.cgi?id=4510 There's a similar bug here as well: http://d.puremagic.com/issues/show_bug.cgi?id=3290 bearophile Wrote:Andrej Mitrovic:The second foreach example with the ref symbol which has the wrong type compiles without an error (it should not).It's a bug (keyword: accepts-invalid), put it in Bugzilla if not already present.What is also weird is that the values are left unchanged:It is code that can't compile, so what it does is undefined behaviour :-) Bye, bearophile
Jul 26 2010
Looking through the TDPL errata I came across this: On 07/26/2010 11:15 AM, Andrej Mitrovic wrote:Here's some more for the Errata (I've checked against the cached one): Page 26: "In D, slicing could never occur." This should probably be "In D slicing, this could never occur."Actually, this is not talking about D’s (array) slicing but C++’s (object) slicing. The line should read as is, or as, “In D, such slicing could …”; perhaps with the word “slicing” in quotes to distinguish it from other uses of the word elsewhere. —Joel
Oct 24 2010
On 10/24/10 7:17 CDT, Joel C. Salomon wrote:Looking through the TDPL errata I came across this: On 07/26/2010 11:15 AM, Andrej Mitrovic wrote:Thanks! Will fix. AndreiHere's some more for the Errata (I've checked against the cached one): Page 26: "In D, slicing could never occur." This should probably be "In D slicing, this could never occur."Actually, this is not talking about Ds (array) slicing but C++s (object) slicing. The line should read as is, or as, In D, such slicing could ; perhaps with the word slicing in quotes to distinguish it from other uses of the word elsewhere. Joel
Oct 24 2010
On Sunday 24 October 2010 05:17:30 Joel C. Salomon wrote:Looking through the TDPL errata I came across this: =20 On 07/26/2010 11:15 AM, Andrej Mitrovic wrote:=E2=80=99sHere's some more for the Errata (I've checked against the cached one): =20 Page 26: "In D, slicing could never occur." =20 This should probably be "In D slicing, this could never occur."=20 Actually, this is not talking about D=E2=80=99s (array) slicing but C++=(object) slicing. The line should read as is, or as, =E2=80=9CIn D, such slicing could =E2=80=A6=E2=80=9D; perhaps with the word =E2=80=9Cslicing==E2=80=9D in quotes todistinguish it from other uses of the word elsewhere. =20 =E2=80=94JoelLOL. Yes, in D, slicing is a _good_ thing, whereas in C++, it's a problem t= o=20 watch out for. Now if only we'd found some cool feature that could have bee= n=20 called segmentation fault... ;) =2D Jonathan M Davis
Oct 24 2010
Sun, 24 Oct 2010 14:17:53 -0700, Jonathan M Davis wrote:On Sunday 24 October 2010 05:17:30 Joel C. Salomon wrote:Walter has many times mentioned how segfaults are actually better than exceptions. They force you to fix your code and the debugger is halfway built in the CPU and operating system.Looking through the TDPL errata I came across this: On 07/26/2010 11:15 AM, Andrej Mitrovic wrote:LOL. Yes, in D, slicing is a _good_ thing, whereas in C++, it's a problem to watch out for. Now if only we'd found some cool feature that could have been called segmentation fault... ;)Here's some more for the Errata (I've checked against the cached one): Page 26: "In D, slicing could never occur." This should probably be "In D slicing, this could never occur."Actually, this is not talking about D’s (array) slicing but C++’s (object) slicing. The line should read as is, or as, “In D, such slicing could …”; perhaps with the word “slicing” in quotes to distinguish it from other uses of the word elsewhere. —Joel
Oct 24 2010
On 10/24/2010 04:36 PM, retard wrote:Walter has many times mentioned how segfaults are actually better than exceptions. They force you to fix your code and the debugger is halfway built in the CPU and operating system.null dereference exploits notwithstanding?
Oct 24 2010