Demonstrate how to get the size of a variable.

See also: Host introspection

list = [1,2,3]
IO.puts length(list)                    #=> 3
 
tuple = {1,2,3,4}
IO.puts tuple_size(tuple)               #=> 4
 
string = "Elixir"
IO.puts String.length(string)           #=> 6
IO.puts byte_size(string)               #=> 6
IO.puts bit_size(string)                #=> 48
 
utf8 = "○×△"
IO.puts String.length(utf8)             #=> 3
IO.puts byte_size(utf8)                 #=> 8
IO.puts bit_size(utf8)                  #=> 64
 
bitstring = <<3 :: 2>>
IO.puts byte_size(bitstring)            #=> 1
IO.puts bit_size(bitstring)             #=> 2
 
map = Map.new([{:b, 1}, {:a, 2}])
IO.puts map_size(map)                   #=> 2