   Module responsible for doing IO. All the contents
   are expected to be in unicode.
   """
+
+  # Map the Elixir names for standard io and error to Erlang names
+  defmacrop map_dev(dev) do
+    quote do
+      case unquote(dev) do
+        :stdio  -> :standard_io;
+        :stderr -> :standard_error;
+        other   -> other;
+      end
+    end
+  end
 
   @doc """
   Reads `count` bytes from the IO device. It returns:

    for instance {:error, :estale} if reading from an
    NFS file system.
  """
  def getb(device // :standard_io, prompt, count // 1) do
    Erlang.io.get_chars(device, prompt, count)
  end

  @doc """

      #=> "error"

  """
  def write(device // :stdio, item) do
    Erlang.io.put_chars map_dev(device), item
  end

  def print(device // :stdio, item) do
    IO.puts "IO.print is deprecated in favor of IO.write"
    Erlang.io.put_chars map_dev(device), item
  end

  @doc """
