Func constructor

Func(
  1. Function fun,
  2. int argsCount
)

Implementation

Func(this.fun, this.argsCount) : super(null, null) {
  List vrs = [];
  List vrids = [];

  for (int i = 0; i < argsCount; i++) {
    vrs.add(Var(Func.nextId));
    vrids.add(Func.nextId);
    Func.nextId++;
  }

  this.args = [MakeArray(vrids), _expr(Function.apply(fun, vrs))];
}