From e0b59872321155726745bc534aeaaa3bd2bac188 Mon Sep 17 00:00:00 2001 From: Alan Fachini Date: Mon, 18 Apr 2016 20:08:07 -0300 Subject: [PATCH] Syntax style nits. --- crash-course.markdown | 4 ++-- getting-started/basic-types.markdown | 2 +- getting-started/pattern-matching.markdown | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crash-course.markdown b/crash-course.markdown index 3872184c6..1051bfb57 100644 --- a/crash-course.markdown +++ b/crash-course.markdown @@ -347,9 +347,9 @@ Elixir supports a literal syntax for regular expressions. Such syntax allows reg **Erlang** ```erlang -{ ok, Pattern } = re:compile("abc\\s"). +{ok, Pattern} = re:compile("abc\\s"). re:run("abc ", Pattern). -%=> { match, ["abc "] } +%=> {match,[{0,4}]} ``` **Elixir** diff --git a/getting-started/basic-types.markdown b/getting-started/basic-types.markdown index 2e825d324..b680efa59 100644 --- a/getting-started/basic-types.markdown +++ b/getting-started/basic-types.markdown @@ -355,7 +355,7 @@ iex> list = [1|[2|[3|[]]]] This means accessing the length of a list is a linear operation: we need to traverse the whole list in order to figure out its size. Updating a list is fast as long as we are prepending elements: ```iex -iex> [0 | list] +iex> [0|list] [0, 1, 2, 3] ``` diff --git a/getting-started/pattern-matching.markdown b/getting-started/pattern-matching.markdown index bf7969525..fe7a4dced 100644 --- a/getting-started/pattern-matching.markdown +++ b/getting-started/pattern-matching.markdown @@ -91,7 +91,7 @@ iex> a A list also supports matching on its own head and tail: ```iex -iex> [head | tail] = [1, 2, 3] +iex> [head|tail] = [1, 2, 3] [1, 2, 3] iex> head 1 @@ -106,7 +106,7 @@ iex> [h|t] = [] ** (MatchError) no match of right hand side value: [] ``` -The `[head | tail]` format is not only used on pattern matching but also for prepending items to a list: +The `[head|tail]` format is not only used on pattern matching but also for prepending items to a list: ```iex iex> list = [1, 2, 3]