diff options
author | cloudygoose <[email protected]> | 2015-05-31 11:36:32 +0800 |
---|---|---|
committer | cloudygoose <[email protected]> | 2015-05-31 11:36:32 +0800 |
commit | d195028baca29cb5ca1f90df413b3d0a8df79857 (patch) | |
tree | cc123d873692adfc79a50a163a69b48a2de45a5b | |
parent | 29535cd402af7eaf8be7b48620826fc82591a010 (diff) |
...
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | doc/nerv.md | 6 |
2 files changed, 4 insertions, 4 deletions
@@ -24,7 +24,7 @@ The pull&merge request can be found on your dashboard in github. See this [sync- ##Nerv Packages## * __luaT__ Nerv uses [luaT]\(a [Torch] library\) to define lua class in C. -* __[The Nerv OOP](doc/nerv_class.md)__ +* __[The Nerv OOP](doc/nerv_class.md)__ Enables object-oriented programming in Nerv. * __[The Nerv utility functions](doc/nerv.md)__ Inlcudes some utility functions from luaT to implement __Nerv.Class__. diff --git a/doc/nerv.md b/doc/nerv.md index 91bc8c9..22b4072 100644 --- a/doc/nerv.md +++ b/doc/nerv.md @@ -1,15 +1,15 @@ #The Nerv utility functions# Part of the [Nerv](../README.md) toolkit. ##Methods## -* __string = nerv.typename(obj a)__ +* __string = nerv.typename(obj a)__ A registered function, the original function is `luaT_lua_typename`. In some cases if you call `type(a)` for object of some class in __Nerv__(like __Nerv.CuMatrix__) it will only return "userdata"(because it is created in C), in this case you can use this method to get its type. --- -* __metatable = nerv.getmetatable(string tname)__ +* __metatable = nerv.getmetatable(string tname)__ A registered function, the original function is `luaT_lua_getmetatable`. `tname` should be a class name that has been registered in __luaT__. -* __metatable = nerv.newmetatable(string tname, string parenttname, function constructor, function destructor, function factory)__ +* __metatable = nerv.newmetatable(string tname, string parenttname, function constructor, function destructor, function factory)__ A registered function, the original function is `luaT_newmetatable`, it returns the metatable of the created class by the name `tname`. * __string = nerv.setmetatable(table self, string tname)__ A registered function, the original function is `luaT_lua_setmetatable`. It assigns the metatable registered in __luaT__ by the name *tname* to the table *self*. And return *tname* to user. |