Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[Doc] Added description for the boost context factory
[simgrid.git] / examples / lua / masterslave / slave.lua
index d6f2141..e1ade87 100644 (file)
@@ -6,11 +6,11 @@
 
 function Slave(...)
 
-  if #arg ~= 1 then
+  if select("#", ...) ~= 1 then
     error("Wrong number of arguments (got " .. #arg .. ", expected 1: slave_id)")
   end
 
-  local my_mailbox = "slave " .. arg[1]
+  local my_mailbox = "slave " .. select(1, ...)
   simgrid.info("Hello from lua, I'm a poor slave with mailbox: " .. my_mailbox)
 
   while true do