Module:Variables

-- External import local binser = require('binser')

local Variables = {}

local VariablesLua = mw.ext.VariablesLua

function Variables.vardefine(name, value) return VariablesLua.vardefine(name, binser.serialize(value)) end

function Variables.vardefineecho(name, value) return VariablesLua.vardefineecho(name, binser.serialize(value)) end

function Variables.var(name, default) if Variables.varexists(name) == "1" then local results, _ = binser.deserialize(VariablesLua.var(name)) return results[1] else return default end end

function Variables.varexists(name) return VariablesLua.varexists(name) end

-- Does not actually work function Variables.var_final(name, default) if Variables.varexists(name) == "1" then local results, _ = binser.deserialize(mw.getCurrentFrame:callParserFunction{			name = '#var_final',			args = { name },		}) return results[1] else return default end end

return Variables