Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
|||
%{}
|
||||
|
|
@ -0,0 +1 @@
|
|||
%{"one" => :two, 3 => "four"}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
%{a: 1, b: 2}
|
||||
# equivalent to
|
||||
%{:a => 1, :b => 2}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
defmodule RC do
|
||||
def test_create do
|
||||
IO.puts "< create Map.new >"
|
||||
m = Map.new #=> creates an empty Map
|
||||
m1 = Map.put(m,:foo,1)
|
||||
m2 = Map.put(m1,:bar,2)
|
||||
print_vals(m2)
|
||||
print_vals(%{m2 | foo: 3})
|
||||
end
|
||||
|
||||
defp print_vals(m) do
|
||||
IO.inspect m
|
||||
Enum.each(m, fn {k,v} -> IO.puts "#{inspect k} => #{v}" end)
|
||||
end
|
||||
end
|
||||
|
||||
RC.test_create
|
||||
Loading…
Add table
Add a link
Reference in a new issue