Beispiel #1
0
        object IAdditive.Add(object right)
        {
            List <IValue> ls = new List <IValue>(this);
            var           r  = (Values.IEnumerableValue)OperationHelper.GetValue((IExpr)right);

            foreach (var v in r)
            {
                ls.Add(v);
            }
            return(new SetValue(ls));
        }
Beispiel #2
0
        object IMultiplicable.Multiply(object right)
        {
            List <IValue> ls1 = new List <IValue>(this), ls2 = new List <IValue>();
            var           r = (Values.IEnumerableValue)OperationHelper.GetValue((IExpr)right);

            foreach (var v in r)
            {
                ls2.Add(v);
            }

            List <IValue> ls = new List <IValue>();

            foreach (var v in ls1)
            {
                foreach (var v2 in ls2)
                {
                    ls.Add(new TupleValue(new IValue[] { v, v2 }));
                }
            }
            return(new SetValue(ls));
        }