1 module orelang.expression.CallOperator; 2 import orelang.expression.IExpression, 3 orelang.operator.IOperator, 4 orelang.Closure, 5 orelang.Engine, 6 orelang.Value; 7 8 class CallOperator : IExpression { 9 private { 10 IOperator operator; 11 Value[] args; 12 } 13 14 this(IOperator operator, Value[] args) { 15 this.operator = operator; 16 this.args = args; 17 } 18 19 /** 20 * eval 21 */ 22 public Value eval(Engine engine) { 23 Closure closure = engine.eval(new Value(this.operator)).getClosure; 24 25 return closure.eval(this.args); 26 } 27 }