1 module orelang.operator.LambdaOperator; 2 import orelang.operator.DynamicOperator, 3 orelang.operator.IOperator, 4 orelang.Engine, 5 orelang.Value; 6 import std.algorithm, 7 std.array; 8 9 class LambdaOperator : IOperator { 10 /** 11 * call 12 */ 13 public Value call(Engine engine, Value[] args) { 14 string[] funcArgs = args[0].getArray.map!(value => value.getString).array; 15 Value funcBody = args[1]; 16 17 return new Value(new DynamicOperator(funcArgs, funcBody)); 18 } 19 }