看起来可以使用new关键字创建一个数组: let x = new Double[2] x[0] = 3.1 x[1] = 4.2 println(x) // Output: [3.1, 4.2] 但这仅仅是理论上的兴趣,没有文档支持,因此不应该使用。
似乎已被移除。 我尝试过let x = new Double[2],但在Xcode 7中它会抛出错误 Playground 执行失败:OSX.playground:1:9: 错误:使用未解决的标识符“new” let a = new [Double]