Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/xlua.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Farabet <clement.farabet@gmail.com>2011-07-06 19:42:30 +0400
committerClement Farabet <clement.farabet@gmail.com>2011-07-06 19:42:30 +0400
commit9f1d5c9194fd4d58cbb49091e19a7cc61150df77 (patch)
tree001322cef5e4a39c49e6a755196a6ada00302352
parentcaf17c54abb104bf10ad3e15392445489e9f972f (diff)
Better named/ordered args auto-detect
-rw-r--r--xlua.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/xlua.lua b/xlua.lua
index 0fdd650..881e2bf 100644
--- a/xlua.lua
+++ b/xlua.lua
@@ -409,7 +409,8 @@ function unpack(args, funcname, description, ...)
-- get args
local iargs = {}
if #args == 0 then error(usage)
- elseif #args == 1 and glob.type(args[1]) == 'table' and #args[1] == 0 then
+ elseif #args == 1 and glob.type(args[1]) == 'table' and #args[1] == 0
+ and not (glob.torch and glob.torch.typename(args[1]) ~= nil) then
-- named args
iargs = args[1]
else