Part 1 of the Language Reference Docs Review
Andrej Mitrovic
andrej.mitrovich at gmail.com
Fri Jun 25 19:45:22 PDT 2010
UPDATE:
I've tested my findings with the newer DMD v2.047, the results are almost the
same except these 3 differences (marked with **)
http://www.digitalmars.com/d/2.0/property.html
".stringof Property"
Example contains two lines refering to "test.Foo",
but "test" isn't declared anywhere.
The compiler output is different too.
The lines should be replaced with:
writefln((1+2).stringof); // "1 + 2"
writefln(Foo.stringof); // "Foo"
writefln(int.stringof); // "int"
writefln((int*[5][]).stringof); // "int*[5u][]"
** writefln(Enum.RED.stringof); // "cast(Enum)0
writefln((5).stringof); // "5"
http://www.digitalmars.com/d/2.0/statement.html
"Foreach over Associative Arrays"
The first example code gives these compiler errors:
** Error: function object.AssociativeArray!(const(char)[],double).AssociativeArray.opApply
(scope int delegate(ref const(char)[], ref double) dg) is not
callable using argument types (int delegate(ref char[]
__applyArg0, ref double __applyArg1))
** Error: cannot implicitly convert expression
(__foreachbody606) of type int delegate(ref char[] __applyArg0,
ref double __applyArg1) to int delegate(ref double)
More information about the Digitalmars-d
mailing list