2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1,3 +1,10 @@
|
|||
map = %{:a => 1, :b => 2} #=> %{a: 1, b: 2}
|
||||
map.a #=> 1
|
||||
%{map | :a => 2} #=> %{a: 2, b: 2}
|
||||
empty_set = MapSet.new #=> #MapSet<[]>
|
||||
set1 = MapSet.new(1..4) #=> #MapSet<[1, 2, 3, 4]>
|
||||
MapSet.size(set1) #=> 4
|
||||
MapSet.member?(set1,3) #=> true
|
||||
MapSet.put(set1,9) #=> #MapSet<[1, 2, 3, 4, 9]>
|
||||
set2 = MapSet.new([6,4,2,0]) #=> #MapSet<[0, 2, 4, 6]>
|
||||
MapSet.union(set1,set2) #=> #MapSet<[0, 1, 2, 3, 4, 6]>
|
||||
MapSet.intersection(set1,set2) #=> #MapSet<[2, 4]>
|
||||
MapSet.difference(set1,set2) #=> #MapSet<[1, 3]>
|
||||
MapSet.subset?(set1,set2) #=> false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue