public object VisitFunctionStatement(FunctionStatement statement) { // Use interpreter's current environment to allow for functions inside functions (closure) MinFunction function = new MinFunction(statement, environment); environment.Define(statement.name, function); return(null); }
public MinFunction(FunctionStatement declaration, Environment closure) { this.declaration = declaration; this.closure = closure; }