3 ms·
The syntax proposed has problems. Many languages allow you to declare nested data structures and a natural way to express an array of arrays in swift would be t
by clscott 12y ago
The syntax proposed has problems. Many languages allow you to declare nested data structures and a natural way to express an array of arrays in swift would be the following:
let a = [[1,2,3],[6,7,8]]
- nemetroid 12y agoCan you give an example for which the proposed syntax would be problematic? Your example would be written as: let a = [: [: 1, 2, 3 :], [: 6, 7, 8 :] :] or let a = [ [: 1, 2, 3 :], [: 6, 7, 8 :] ] etc., depending on what mutability you want.