Example #1
0
 public override LazyNumber Eval(LazyNumber v1, LazyNumber v2)
 {
     if (v2 != null)
     {
         throw new ExpressionException("Did not expect a second parameter for unary operator");
     }
     return(EvalUnary(v1));
 }
Example #2
0
 public LazyIf(LazyNumber check, LazyNumber numif, LazyNumber numelse)
 {
     this.check   = check;
     this.numif   = numif;
     this.numelse = numelse;
 }
Example #3
0
 public LazyIfBreak(LazyNumber check, LazyNumber numif)
 {
     this.check = check;
     this.numif = numif;
 }
Example #4
0
 public override LazyNumber Eval(LazyNumber v1, LazyNumber v2)
 {
     return(new FunLazyNumberS(() => op.Invoke(v1.Eval(), v2.Eval())));
 }
Example #5
0
 /**
  * Implementation for this operator.
  *
  * @param v1
  *            Operand 1.
  * @param v2
  *            Operand 2.
  * @return The result of the operation.
  */
 public abstract LazyNumber Eval(LazyNumber v1, LazyNumber v2);
Example #6
0
 public override LazyNumber EvalUnary(LazyNumber v)
 {
     return(new FunLazyNumberS(() => this.op.Invoke(v.Eval())));
 }
Example #7
0
 abstract public LazyNumber EvalUnary(LazyNumber v1);