lua-users home
lua-l archive

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


On Wed, Aug 14, 2013 at 1:27 AM, Kevin Clancy <kclanc@gmail.com> wrote:
types of returns. As far as I know, unless a language has been designed from the ground up to have inferrable formal parameter types, inferring these types can be extremely tricky.

In theory, impossible. Fortunately, users of an IDE do not require perfection ;)

All of the Lua IDE people are working towards a good-enough resolution of this need. The experimental work by David Manura and Paul K with ZB Studio is noteworthy here.

We all know now that the strength of a type system has little to do with its static/dynamic aspect. From this point of view, Lua is often rather weakly-typed, since we have a habit of returning tables with semi-random structure and no identities.

Andrew alluded to this when he talks about his type library; it's so useful when all of your tables have an identity that can be tested at run-time.  However, LuaDoc has always allowed a strategy where you document a table which is intended to be the return type of a function, e.g. Foo returns FooReturn and @see references it.

So dilligent documentation can remove a lot of the guess work, and can be transformed into a suitable form for an IDE to use directly.

BTW, why use XML when Lua tables are such a fast and clean alternative?  (Or should I use the 'proper' name - LTON - Lua Table Object Notation, known as 'Elton' to its friends)

steve d.