title: how to define functions in redis \ lua?
body: <p>I'm using Node.js, and the 'redis-scripto' module, and I'm trying to define a function in Lua:</p>
  
  <pre><code> var redis = require("redis");  
   var redisClient = redis.createClient("6379","127.0.0.1");   
  
   var Scripto = require('redis-scripto');
   var scriptManager = new Scripto(redisClient);
   var scripts = {'add_script':'function add(i,j) return (i+j) end add(i,j)'};
  
   scriptManager.load(scripts);
   scriptManager.run('add_script', [], [1,1], function(err, result){
                      console.log(err || result);
   });
  </code></pre>
  
  <p>so I'm getting this error:</p>
  
  <blockquote>
    <p>[Error: ERR Error running script (call to .... @enable_strict_lua:7: user_script:1: Script attempted to create global variable 'add']</p>
  </blockquote>
  
  <p>so I've found that it's a protection, <a href="https://stackoverflow.com/questions/19997647/script-attempted-to-create-global-variable">as explained in this thread</a>:</p>
  
  <p>"The doc-string of <strong>scriptingEnableGlobalsProtection</strong> indicates that intent is to notify script authors of common mistake (not using local)." </p>
  
  <p>but I still didn't understand - where is this scripting.c ? and the solution of changing global tables seems risky to me. </p>
  
  <p>Is there no simple way of setting functions to redis - using lua ?</p>