JanetObject

A generic wrapper for a janet pointer. Can be assigned to and initialized like a standard struct. . For easier assurances, one can also use the various wrappers around stricter types available (TODO).

Constructors

this
this(T x)
Undocumented in source.

Alias This

janet

Members

Functions

as
T as()
Undocumented in source. Be warned that the author may not have intended to support it.
compatible
bool compatible()
Undocumented in source. Be warned that the author may not have intended to support it.
opAssign
void opAssign(T x)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

janet
Janet janet;

The actual janet object this refers to. Aliased to, so all functions that operate on Janet operate on JanetObject.

Examples

initJanet();
scope(exit) janet_deinit();
import std.stdio : writeln;
writeln("Performing JanetObject test.");
scope(success) writeln("Success.");
JanetObject testObj = JanetObject(3);
assert(testObj.as!int == 3);
testObj = "foo";
assert(testObj.as!string == "foo");
testObj = true;
assert(testObj.compatible!bool,"Object is not converted to bool correctly!");
assert(testObj.as!bool,"Object converted to bool is not truthy!");

Meta