const std = @import("std"); pub const Object = @import("Object.zig"); pub const Interpreter = @import("Interpreter.zig"); pub const Dict = @import("Dict.zig"); pub const Str = @import("Str.zig"); pub const Tuple = @import("Tuple.zig"); pub const Fn = @import("function.zig").Fn; pub const Error = error { Exception, IndexError, }; pub const conversion = struct { fn PtrFromCPtr(T: type) type { const info = @typeInfo(T); return *info.pointer.child; } pub fn Ptr(value: anytype) Error!PtrFromCPtr(@TypeOf(value)) { if (value) |ptr| { return ptr; } return error.Exception; } pub fn success(value: c_int) Error!void { if (value == -1) return error.Exception; } };