1 module orelang.operator.RandomOperators; 2 import orelang.operator.IOperator, 3 orelang.Engine, 4 orelang.Value; 5 import std.random, 6 std.conv; 7 8 class RandomUniformOperator : IOperator { 9 /** 10 * call 11 */ 12 public Value call(Engine engine, Value[] args) { 13 long fst = engine.eval(args[0]).getNumeric.to!long, 14 snd = engine.eval(args[1]).getNumeric.to!long; 15 16 long ret = uniform(fst, snd); 17 18 return new Value(ret); 19 } 20 }