The OpenD Programming Language

var

Members

Functions

get
T get()

Gets the var converted to type T as best it can. T may be constructed from T.fromJsVar, or through type conversions (coercing as needed). If T happens to be a struct, it will automatically introspect to convert the var object member-by-member.

opApply
int opApply(int delegate(ref var) dg)
int opApply(int delegate(var, ref var) dg)

You can foreach over a var.

opAssign
var opAssign(T t)

Assigns a value to the var. It will do necessary implicit conversions and wrapping.

opCast
bool opCast()

if(some_var) will call this and give behavior based on the dynamic type. Shouldn't be too surprising.

opCast
T opCast()

Alias for get. e.g. string s = cast(string) v;

opIndex
var opIndex(var name, string file, size_t line)

Looks up a sub-property of the object

opIndexAssign
var opIndexAssign(T t, var name, string file, size_t line)

Sets a sub-property of the object

putInto
auto ref putInto(T t)

Calls get for a type automatically. int a; var b; b.putInto(a); will auto-convert to int.

toJson
string toJson()
toJsonValue
JSONValue toJsonValue()

Properties

emptyArray
var emptyArray [@property getter]
emptyObject
var emptyObject [@property setter]
opDispatch
var opDispatch [@property getter]

Forwards to opIndex

opDispatch
T opDispatch [@property setter]

Forwards to opIndexAssign

Static functions

fromJson
var fromJson(const(char)[] json)
fromJsonFile
var fromJsonFile(const(char)[] filename)
fromJsonValue
var fromJsonValue(JSONValue v)

Meta