Interview at Lang.NEXT

Craig Dillabaugh via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Wed Jun 4 11:37:23 PDT 2014


On Wednesday, 4 June 2014 at 18:14:22 UTC, Adam D. Ruppe wrote:
> On Wednesday, 4 June 2014 at 18:03:48 UTC, Ary Borenszweig 
> wrote:
clip
>
> void main() {
>         var a = 10;
>         var b = "20";
>         b += a;
>         b -= 4;
>         import std.stdio;
>         writeln(b);
>
>         b = [1,2,3];
>         b[0] *= "5";
>         writeln(b);
>
>         b = var.emptyObject;
>         b.foo = (var a) {
>                 foreach(i; 0 .. a.get!int)
>                         writeln("Hello");
>         };
>
>         b.foo()(5); // would be nice if @property worked!
> }
>
> 26
> [5, 2, 3]
> Hello
> Hello
> Hello
> Hello
> Hello
>
>
> Of course, sometimes the type still matters, like the a.get!int 
> in there, but oh well.

But shouldn't the '26' be '1016'?


More information about the Digitalmars-d-announce mailing list