diff options
author | Clement Farabet <clement.farabet@gmail.com> | 2011-07-06 19:42:30 +0400 |
---|---|---|
committer | Clement Farabet <clement.farabet@gmail.com> | 2011-07-06 19:42:30 +0400 |
commit | 9f1d5c9194fd4d58cbb49091e19a7cc61150df77 (patch) | |
tree | 001322cef5e4a39c49e6a755196a6ada00302352 | |
parent | caf17c54abb104bf10ad3e15392445489e9f972f (diff) |
Better named/ordered args auto-detect
-rw-r--r-- | xlua.lua | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 |