www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Changes for newer version...

reply Era Scarecrow <rtcvb32 yahoo.com> writes:
 Been a bit out of it for a while, but finding enough tools at my disposal I
feel I can work on/convert a project now.

 I happen to have one of the first printing books (without the name on the
cover), and although it may be worth millions in a few years, apparently
there's been enough changes that certain features are not familiar in the
discussions.

 So I need to ask since I don't see any obvious pages that describe it. What
are the changes to D2, since the book's release? What has externally changed?
(Internal implementation of features need not be mentioned if it's transparent
to the programmer and user).
Jan 19 2012
next sibling parent "Jesse Phillips" <jessekphillips+D gmail.com> writes:
On Thursday, 19 January 2012 at 20:44:04 UTC, Era Scarecrow wrote:
 Been a bit out of it for a while, but finding enough tools at 
 my disposal I feel I can work on/convert a project now.

 I happen to have one of the first printing books (without the 
 name on the cover), and although it may be worth millions in a 
 few years, apparently there's been enough changes that certain 
 features are not familiar in the discussions.

 So I need to ask since I don't see any obvious pages that 
 describe it. What are the changes to D2, since the book's 
 release? What has externally changed? (Internal implementation 
 of features need not be mentioned if it's transparent to the 
 programmer and user).

For the most part the language has been changing to match the book. There are still bugs in that regard. http://d.puremagic.com/issues/buglist.cgi?quicksearch=[tdpl] The book itself has its own bugs, which can be found on the errata page. http://erdani.com/index.php?cID=109
Jan 20 2012
prev sibling parent Timon Gehr <timon.gehr gmx.ch> writes:
On 01/19/2012 09:30 PM, Era Scarecrow wrote:
   Been a bit out of it for a while, but finding enough tools at my disposal I
feel I can work on/convert a project now.

   I happen to have one of the first printing books (without the name on the
cover), and although it may be worth millions in a few years, apparently
there's been enough changes that certain features are not familiar in the
discussions.

   So I need to ask since I don't see any obvious pages that describe it. What
are the changes to D2, since the book's release? What has externally changed?
(Internal implementation of features need not be mentioned if it's transparent
to the programmer and user).

The most important changes are probably: - inout type qualifier The type qualifier inout can be used as a wildcard to stand for any of mutable, const, immutable. Its meaning is automatically deduced and is the same throughout a certain function definition or function call. For example: inout(int)[] identity(inout(int)[] x){return x;} int[] x; immutable(int)[] y; const(int)[] z; static assert(is(typeof(identity(x)) == int[])); static assert(is(typeof(identity(y)) == immutable(int)[])); static assert(is(typeof(identity(z)) == const(int)[])); - function local imports void main(){ import std.stdio; writeln("hello world!"); } - new function/delegate literal syntax (coming DMD 2.058) identifier => expression or (id1, id2) => expression or (type id1, type id2) => expression import std.stdio, std.range, std.algorithm; void main(){ writeln("some odd squares:"); writeln(map!(x=>x^^2)(filter!(x=>x&1)(iota(1,1000)))); }
Jan 20 2012