Files
elixir-koans/lib/koans/04_atoms.ex
2025-09-03 21:06:46 +08:00

24 lines
501 B
Elixir

defmodule Atoms do
@moduledoc false
use Koans
@intro "Atoms"
koan "Atoms are constants where their name is their own value" do
adam = :human
assert adam == :human
end
koan "It is surprising to find out that booleans are atoms" do
assert is_atom(true) == true
assert is_boolean(false) == true
assert true == true
assert false == false
end
koan "Like booleans, the nil value is also an atom" do
assert is_atom(nil) == true
assert nil == nil
end
end