Example #1
0
            public static HassiumList split(VirtualMachine vm, HassiumObject self, SourceLocation location, params HassiumObject[] args)
            {
                var String = (self as HassiumString).String;
                var list   = new HassiumList(new HassiumObject[0]);

                foreach (var part in String.Split(args[0].ToChar(vm, args[0], location).Char))
                {
                    HassiumList.ListTypeDef.add(vm, list, location, new HassiumString(part));
                }
                return(list);
            }
Example #2
0
            public static HassiumObject iter(VirtualMachine vm, HassiumObject self, SourceLocation location, params HassiumObject[] args)
            {
                var         Dictionary = (self as HassiumDictionary).Dictionary;
                HassiumList list       = new HassiumList(new HassiumObject[0]);

                foreach (var pair in Dictionary)
                {
                    HassiumList.add(vm, list, location, new HassiumTuple(pair.Key, pair.Value));
                }
                return(list);
            }
Example #3
0
            public static HassiumObject iter(VirtualMachine vm, HassiumObject self, SourceLocation location, params HassiumObject[] args)
            {
                var         String = (self as HassiumString).String;
                HassiumList list   = new HassiumList(new HassiumObject[0]);

                foreach (var c in String)
                {
                    HassiumList.add(vm, list, location, new HassiumChar(c));
                }
                return(list);
            }
Example #4
0
            public static HassiumList fill(VirtualMachine vm, HassiumObject self, SourceLocation location, params HassiumObject[] args)
            {
                HassiumList list = new HassiumList(new HassiumObject[0]);

                int count = (int)args[0].ToInt(vm, args[0], location).Int;

                for (int i = 0; i < count; i++)
                {
                    add(vm, list, location, args[1]);
                }

                return(list);
            }