code: function Func(r, func) {
    // We can retrieve the names of the arguments with
    // func.toString().match(/\(([^\)]*)\)/)[1].split(/\s*,\s*/)
  
    var term = new Term(r);
    term._query.push(termTypes.FUNC);
    var args = [];
    var argVars = [];
    var argNums = [];
  
    for(var i=0; i<func.length; i++) {
      argVars.push(new Var(r, r.nextVarId));
      argNums.push(r.nextVarId);
  
      if (r.nextVarId === 9007199254740992) { // That seems like overdoing it... but well maybe...
        r.nextVarId = 0;
      }
      else {
        r.nextVarId++;
      }
    }
  
    var body = func.apply(func, argVars)
    if (body === undefined) throw new Error.ReqlDriverError('Anonymous function returned `undefined`. Did you forget a `return`? In:\n'+func.toString(), this._query);
    body = new Term(r).expr(body);
    args.push(new Term(r).expr(argNums));
    args.push(body);
  
    term._fillArgs(args);
  
    return term;
  }
docs: Datums