-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsample.txt
More file actions
22 lines (19 loc) · 835 Bytes
/
sample.txt
File metadata and controls
22 lines (19 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var dict = ["a": "Apple", // set up the Dictionary
"b": "Banana",
"c": "Cherry"]
let bananaIndex = dict.indexForKey("b")! // retrieve an index
println(dict[bananaIndex]) // subscript via DictionaryIndex<String, String>
> (b, Banana)
println(dict["c"]) // subscript via String key
> Optional("Cherry")
let set: Set = ["Apple", "Banana", "Cherry"] // set up the Set
let start: Int = set.startIndex
println(set[start])
> Cherry
println(set["Apple"])
error: type 'Index' does not conform to protocol 'StringLiteralConvertible'
/*
Checked equality (true) on equal big sets in 0.923960983753204
Checked equality (false) on different-size big sets in 2.98023223876953e-06
Checked equality (false) on same-size unequal big sets in 0.908538997173309
*/