23 lines
470 B
Java
23 lines
470 B
Java
package serene.simple.builtin;
|
|
|
|
import serene.simple.BaseScope;
|
|
import serene.simple.SNumber;
|
|
import serene.simple.SereneException;
|
|
|
|
|
|
public class PlusFn extends AFn {
|
|
public String fnName() {
|
|
return "+";
|
|
};
|
|
|
|
public Object eval(BaseScope scope) throws SereneException{
|
|
SNumber.IOps result = (SNumber.IOps) new SNumber.LongNumber();
|
|
|
|
for(Object x: this.arguments()) {
|
|
result = (SNumber.IOps) result.add(x);
|
|
}
|
|
|
|
return result.value();
|
|
}
|
|
}
|