Use bare double underscores instead of atoms

This commit is contained in:
Uku Taht
2016-04-19 13:35:20 +01:00
parent 45619f6bdb
commit ea2bb8f9bf
14 changed files with 141 additions and 139 deletions

View File

@@ -2,63 +2,63 @@ defmodule Lists do
use Koans
koan "We can see what is ahead" do
assert List.first([1, 2, 3]) == :__
assert List.first([1, 2, 3]) == __
end
koan "Checking what's trailing is also simple" do
assert List.last([1, 2, 3]) == :__
assert List.last([1, 2, 3]) == __
end
koan "Lists can store anything you throw at them" do
assert [1, 2] ++ [:a, "b"] == :__
assert [1, 2] ++ [:a, "b"] == __
end
koan "Things can evolve" do
assert [1, 2, 3] -- [3] == :__
assert [1, 2, 3] -- [3] == __
end
koan "Evolution can have different forms" do
assert List.delete([1, 2, 2, 3], 2) == :__
assert List.delete([1, 2, 2, 3], 2) == __
end
koan "Precision is also valued" do
assert List.delete_at([1, 2, 3], 1) == :__
assert List.delete_at([1, 2, 3], 1) == __
end
koan "Replication is also possible" do
assert List.duplicate("life", 3) == :__
assert List.duplicate("life", 3) == __
end
koan "Sometimes levelling the playing field is desired" do
assert List.flatten([1, [2, 3], 4, [5]]) == :__
assert List.flatten([1, [2, 3], 4, [5]]) == __
end
koan "Same rules apply to new members that arrive late" do
assert List.flatten([1, [2, 3]], [4]) == :__
assert List.flatten([1, [2, 3]], [4]) == __
end
koan "Order can also be specified for new members" do
assert List.insert_at([1, 2, 3], 1, 4) == :__
assert List.insert_at([1, 2, 3], 1, 4) == __
end
koan "We can replace things at specified positions" do
assert List.replace_at([1, 2, 3], 0, 10) == :__
assert List.replace_at([1, 2, 3], 0, 10) == __
end
koan "Replacing something which is not" do
assert List.replace_at([1, 2, 3], 10, 0) == :__
assert List.replace_at([1, 2, 3], 10, 0) == __
end
koan "Order is bound by nature's laws" do
assert List.insert_at([1, 2, 3], 10, 4) == :__
assert List.insert_at([1, 2, 3], 10, 4) == __
end
koan "Sometimes its faster to loop around back" do
assert List.insert_at([1, 2, 3], -1, 4) == :__
assert List.insert_at([1, 2, 3], -1, 4) == __
end
koan "We can also transform ourselves completely" do
assert List.to_tuple([1, 2, 3]) == :__
assert List.to_tuple([1, 2, 3]) == __
end
koan "Wrapping other values is a handy option" do