1 module orelang.operator.AddOperator;
2 import orelang.operator.IOperator,
3        orelang.Engine,
4        orelang.Value;
5 
6 class AddOperator : IOperator {
7   /**
8    * call
9    */
10   public Value call(Engine engine, Value[] args) {
11     Value ret = new Value(0.0);
12 
13     foreach (arg; args) {
14       Value v = engine.eval(arg);
15       ret.addTo(v);
16     }
17 
18     return ret;
19   }
20 }