Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Lua Development Tools » How to document the return type of a module's __call metamethod ?
icon5.gif  How to document the return type of a module's __call metamethod ? [message #898653] Fri, 27 July 2012 05:42 Go to next message
Cheyi Lin is currently offline Cheyi LinFriend
Messages: 16
Registered: June 2012
Junior Member
Hi,

How do I document the return type of a module's __call metamethod ?

----
-- @module mymodule
local m = {}

----
-- @type mytype

----
-- mytype.number_field
-- @field [parent=#mytype] #number number_field

----
-- mytype.string_field
-- @field [parent=#mytype] #string string_field


local function mytype(t)
    return {number_field=1, string_field="hello"}
end

setmetatable(m, {__call=mytype})

return m
Re: How to document the return type of a module's __call metamethod ? [message #898769 is a reply to message #898653] Fri, 27 July 2012 13:50 Go to previous message
Simon Bernard is currently offline Simon BernardFriend
Messages: 290
Registered: July 2009
Senior Member
Hi,
Currently there are no way to express the __call metamethod.
This is something, we should probably add.
Previous Topic:Code Assistance for external lib
Next Topic:Debug Variable Window, Tables wrong order
Goto Forum:
  


Current Time: Mon Dec 22 17:58:47 GMT 2014

Powered by FUDForum. Page generated in 0.01708 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software