Does dynamic dispatch to overloads in a jsvar function set.
Wraps a struct by reference. The pointer is stored - be sure the struct doesn't get freed or go out of scope!
Wraps a class. If you are manually managing the memory, remember the jsvar may keep a reference to the object; don't free it!
Wraps an opaque struct pointer in a module with ufcs functions
Variable to decide if jsvar throws on certain invalid operations or continues on propagating null vars.
You can also use var.fromJson, a static method, to quickly and easily read json or var.toJson to write it.
Also, if you combine this with my arsd.script module, you get pretty easy interop with a little scripting language that resembles a cross between D and Javascript - just like you can write in D itself using this type.
Please note that function default arguments are NOT likely to work in the script. You'd have to use a helper thing that I haven't written yet. opAssign can never do it because that information is lost when it becomes a pointer. ParamDefault is thus commented out for now.
Properties:
D structs can be turned to vars, but it is a copy.
Wrapping D native objects is coming later, the current ways suck. I really needed properties to do them sanely at all, and now I have it. A native wrapped object will also need to be set with _object prolly.
Started in July 2013.
jsvar provides a D type called var that works similarly to the same in Javascript.
It is weakly (even weaker than JS, frequently returning null rather than throwing on an invalid operation) and dynamically typed, but interops pretty easily with D itself: