From 0d31077404dd87f4874c2db2acc9732f2412d91f Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Fri, 28 Mar 2014 03:20:57 +1000 Subject: Rewrite skang.thing() to allow positional and named arguments, allow changing Things, plus some more tweaks. --- ClientHamr/GuiLua/test.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ClientHamr/GuiLua/test.lua') diff --git a/ClientHamr/GuiLua/test.lua b/ClientHamr/GuiLua/test.lua index b1ab691..2115098 100644 --- a/ClientHamr/GuiLua/test.lua +++ b/ClientHamr/GuiLua/test.lua @@ -87,7 +87,10 @@ print(skang.isBoolean('Nope')) print(skang.isBoolean(function (a) return false end)) print('') +-- Make it required, even though it was anyway. +skang.thing{'f', required = true} -- First, disable the default value, so we see "is required" errors. +-- Coz using the above syntax means that default is never passed to skang.thing, since it's nil. skang.things.f.default = nil test.fooble = 42 test.fooble = 'Should fail.' -- cgit v1.1