Exemple #1
0
        public Value SetItem()
        {
            var popped = Arguments.Values.Pop();

            if (popped.IsNone)
            {
                return(this);
            }

            var value  = popped.Value.Element.AssignmentValue();
            var values = popped.Value.Array;

            using (var popper = new RegionPopper(new Region(), "set-item"))
            {
                popper.Push();
                Regions.Current.SetParameter("$", builder.Length);
                var arguments = new Array(values);
                var iterator  = new NSIteratorByLength(arguments.GetGenerator(), builder.Length);
                var list      = iterator.ToList();
                var text      = value.Text;
                foreach (var index in list)
                {
                    setItem(index, text);
                }
            }

            return(this);
        }
Exemple #2
0
 public Value GetItem()
 {
     using (var popper = new RegionPopper(new Region(), "get-item"))
     {
         popper.Push();
         Regions.Current.SetParameter("$", builder.Length);
         var arguments = new Array(Arguments.GetValues(builder.Length));
         var iterator  = new NSIteratorByLength(arguments.GetGenerator(), builder.Length);
         var list      = iterator.ToList();
         if (list.Count == 0)
         {
             return("");
         }
         return(list.Select(getItem).Listify());
     }
 }