Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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]]


Can 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: