lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

The haskell syntax above is just a type declaration, it seems like 'meta data' because type declarations are often
omitted in haskell, but it is a strongly typed language and would be inferred by the haskell compiler/interpreter.

I'm not sure it really makes sense to have type information for lua functions/variables other than what is returned from the type() function. It just doesn't really suit the type system of lua.

Sorry for explaining this terribly, I'm sure someone else can do a better job.

On 6/13/06, King, Mike <> wrote:
>> Having the ability to add metadata to variables would be a nice
>> addition.  This would make it easier to do static analysis of lua
>> scripts.
>     Haskell syntax? :-)
>sin :: Real -> Real
>sin = function(a) return math.sin(a) end

I don't know Haskell but I was thinking about a simpler approach maybe a
static table that would follow the variable.  This would be totally
optional.  I just want a way to perform some "unit testing" on some of
my Lua scripts.  Most of my scripts follow certain patterns, and I would
like a way to test if the scripts don't follow that pattern.  Maybe
Haskell offers that.  I just don't know.