Another update from ingydotnet^djgoku
This commit is contained in:
parent
91df62d461
commit
948b86eafa
7604 changed files with 108452 additions and 22726 deletions
|
|
@ -0,0 +1,19 @@
|
|||
defmodule RC do
|
||||
def dict_create(dict_impl \\ Map) do
|
||||
d = dict_impl.new #=> creates an empty Dict
|
||||
d1 = Dict.put(d,:foo,1)
|
||||
d2 = Dict.put(d1,:bar,2)
|
||||
print_vals(d2)
|
||||
print_vals(Dict.put(d2,:foo,3))
|
||||
end
|
||||
|
||||
defp print_vals(d) do
|
||||
IO.inspect d
|
||||
Enum.each(d, fn {k,v} -> IO.puts "#{k}: #{v}" end)
|
||||
end
|
||||
end
|
||||
|
||||
IO.puts "< create Map.new >"
|
||||
RC.dict_create
|
||||
IO.puts "\n< create HashDict.new >"
|
||||
RC.dict_create(HashDict)
|
||||
Loading…
Add table
Add a link
Reference in a new issue