Description

An anonymous function. Takes an array of numbers representing variables (see [VAR] above), and a [Term] to execute with those in scope. Returns a function that may be passed an array of arguments, then executes the Term with those bound to the variable names. The user will never construct this directly. We use it internally for things like `map` which take a function. The "arity" of a [Function] is the number of arguments it takes. For example, here's what `_X_.map{|x| x+2}` turns into: Term {

type = MAP;
args = [_X_,
        Term {
          type = Function;
          args = [Term {
                    type = DATUM;
                    datum = Datum {
                      type = R_ARRAY;
                      r_array = [Datum { type = R_NUM; r_num = 1; }];
                    };
                  },
                  Term {
                    type = ADD;
                    args = [Term {
                              type = VAR;
                              args = [Term {
                                        type = DATUM;
                                        datum = Datum { type = R_NUM;
                                                        r_num = 1};
                                      }];
                            },
                            Term {
                              type = DATUM;
                              datum = Datum { type = R_NUM; r_num = 2; };
                            }];
                  }];
        }];