附属脚本是访问对象,集合或序列的快捷方式
struct STest{ let constValue:Int subscript(count:Int)->Int{ return count*constValue } } let obj = STest(constValue:3) let res:Int = obj[2] println("\(res)")