(function() {
var reArgs = /function.*?\((.*?)\).*/;

function matchArgs(fn) {
  var match = reArgs.exec(fn.prototype.constructor.toString()),
      args = {};

  if (match[1].length >0) {
    match[1].split(",").forEach(function(d,i) {
      args[d] = i;
    })
  } 
  return args;
}

instinct = function(logic,facts) {
  logic = logic || {};
  facts = facts || {};
  
  var process = {},
      instinct = {logic:logic,facts:facts,process:process};

  function generateArgs(args,cb) {
    var d = []
    for (key in args) {
      d[args[key]] = (key=="cb") ? cb : facts[key];
    }
    return d;
  }

  instinct.exec = function(fn,cb) {
    var args = matchArgs(fn)
    var req = 0;

    function done() {
      if(!req--) {
        fn.apply(this,generateArgs(args,cb));
      }
    };
    
    Object.keys(args).forEach(function(key) {
      if (facts[key] || key=="cb") return;
      req+=1;
      var isRunning = process[key];
      if (isRunning) {
        process[key] = function(d) {
          isRunning(d);
          done();
        }
      } else {
        process[key] = function _process(err,d) {
          facts[key] = (arguments.length == 2) ? d : err;
          delete process[key]
          done();
        }
        instinct.exec(logic[key],process[key])
      }
    })
    done();
    return instinct;
  }

  instinct.as = function(key) {
    process[key] = noop;
    return function(err,d) {
      facts[key] = (arguments.length == 2) ? d : err;
      console.log(facts[key])
      process[key]();
      delete process[key];
    }
  }

  return instinct
}

function noop() {};

})();
@@ -47,16 +47,76 @@
 %5C).*/;%0A%0A
+function notFn(fn) %7B %0A  return (typeof fn !=%22function%22);%0A%7D%0A%0A
 function
@@ -132,16 +132,16 @@
 s(fn) %7B%0A
-
   var ma
@@ -687,24 +687,124 @@
 on(fn,cb) %7B%0A
+    if (notFn(fn)) %7B%0A      fn = logic%5Bfn%5D;%0A      if (notFn(fn)) return (cb && cb(fn));%0A    %7D%0A      %0A
     var args
@@ -1403,18 +1403,11 @@
 xec(
-logic%5B
 key
-%5D
 ,pro

Add ability to pass function-name to exec. Also if logic element is not a function, we return the value.