public void ForEach(DFunction func) { for (int i = 0; i < items.Count; i++) { func.Call(new DObject[] { i.ToDNumber(), items[i].Value }); } }
public DSet Map(DFunction func) { DSet newSet = new DSet(new DObject[0]); foreach (var item in items) { newSet.Add(func.Call(new DObject[] { item.Value })); } return(newSet); }