Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Koneki » 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 01:42 Go to next message
Cheyi Lin is currently offline Cheyi Lin
Messages: 6
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 09:50 Go to previous message
Simon Bernard is currently offline Simon Bernard
Messages: 154
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 Apr 21 11:51:11 EDT 2014

Powered by FUDForum. Page generated in 0.02729 seconds