Example #1
0
        public LithpList ResolveParameters(LithpFunctionCall call, LithpOpChain chain)
        {
            LithpList result = new LithpList();

            foreach (var x in call.Parameters)
            {
                result.Add((LithpPrimitive)resolve((LithpPrimitive)x, chain));
            }
            return(result);
        }
Example #2
0
        public LithpList Map(Func <LithpPrimitive, LithpPrimitive> Callback)
        {
            LithpList result = new LithpList();

            foreach (var x in this)
            {
                result.Add(Callback(x as LithpPrimitive));
            }
            return(result);
        }
Example #3
0
        protected override LithpPrimitive operatorPlus(LithpPrimitive other)
        {
            LithpList newList = new LithpList(value.ToArray());

            foreach (var x in (LithpList)other)
            {
                newList.Add(x);
            }
            return(newList);
        }
Example #4
0
        public static LithpPrimitive DictKeys(LithpList parameters, LithpOpChain state,
                                              LithpInterpreter interp)
        {
            LithpDict dict = (LithpDict)parameters[0];
            LithpList keys = new LithpList();

            foreach (var x in dict.Keys)
            {
                keys.Add(x);
            }
            return(keys);
        }