[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Experience with Large Applications in Lua?
- From: Daniel Silverstone <dsilvers@...>
- Date: Wed, 07 Jul 2004 12:03:18 +0100
Daniel Silverstone wrote:
Jamie Webb wrote:
In this vein though, it would still be nice if one could write in Lua
function foobar(String x, MyClass y) ... end
Where String and MyClass are predicates aginst which the arguments can
be checked, if enabled by an interpreter flag.
return assert(type(x)=="string", "String expected, got " .. type(x))
return assert(classtype(x)=="MyClass", "MyClass expected, got " ..
Oops, I forgot to add:
function foobar(String(x), MyClass(y)) ... end
then does what you want.