func Array.Select(pred) { let ys = [] for x in this when pred(x) { ys.Add(x) } return ys } var arr = [1, 2, 3, 4, 5] var squares = arr.Select(x => x * x) print(squares)