[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Argument checking in Lua?
- From: Chris Marrin <chris@...>
- Date: Wed, 01 Feb 2006 11:48:34 -0800
Lua 5.1 has some nice argument checking functions, accessible from C,
like luaL_checknumber() and luaL_optstring(). But these are not
accessible from Lua, and I have not found anything roughly equivalent.
It would be easy to write such things, of course, by doing type(),
checking against nil and throwing errors. But is there any "standard"
way to do this? I have not been able to find anything...
--
chris marrin ,""$,
chris@marrin.com b` $ ,,.
mP b' , 1$'
,.` ,b` ,` :$$'
,|` mP ,` ,mm
,b" b" ,` ,mm m$$ ,m ,`P$$
m$` ,b` .` ,mm ,'|$P ,|"1$` ,b$P ,` :$1
b$` ,$: :,`` |$$ ,` $$` ,|` ,$$,,`"$$ .` :$|
b$| _m$`,:` :$1 ,` ,$Pm|` ` :$$,..;"' |$:
P$b, _;b$$b$1" |$$ ,` ,$$" ``' $$
```"```'" `"` `""` ""` ,P`
"As a general rule,don't solve puzzles that open portals to Hell"'