Conventions used
There are a number of text conventions used throughout this book.
Code in text
: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “In the preceding code snippet, we added a start/1
function, which listens using the default listener_options
variable and creates a listening socket to accept incoming connections.”
A block of code is set as follows:
defmodule ExperimentServer do # .. defp recv(connection_sock, messages \\ []) do case :gen_tcp.recv(connection_sock, 0) do {:ok, message} -> IO.puts """ Got message: #{inspect(message)} """ recv(connection_sock, [message | messages]) {:error, :closed} -> IO.puts "Socket closed" {:ok, messages} end end end ExperimentServer.start(4040)
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold.
Any command-line input or output is written as follows:
$ elixir experiment_server.exs Listening on port 4040
Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold.
Tips or important notes
Appear like this.