Interview at Lang.NEXT
Adam D. Ruppe via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Wed Jun 4 11:14:21 PDT 2014
On Wednesday, 4 June 2014 at 18:03:48 UTC, Ary Borenszweig wrote:
> Cool! It also looks nice too.
you should check out my jsvar too
https://github.com/adamdruppe/arsd/blob/master/jsvar.d
weak typing and dynamic like javascript:
import arsd.jsvar;
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.
More information about the Digitalmars-d-announce
mailing list