From 5720c56026567ebf3d756ae0e8971565e66ab06d Mon Sep 17 00:00:00 2001 From: james sangho nah Date: Sun, 1 Feb 2015 01:32:21 +1300 Subject: [PATCH] Add ranges under 'Basic types' --- elixir.html.markdown | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/elixir.html.markdown b/elixir.html.markdown index 0a20e3df..fb5f183a 100644 --- a/elixir.html.markdown +++ b/elixir.html.markdown @@ -91,6 +91,11 @@ string. <<1,2,3>> <> <<4,5>> #=> <<1,2,3,4,5>> "hello " <> "world" #=> "hello world" +# Ranges are represented as `start..end` (both inclusive) +1..10 #=> 1..10 +lower..upper = 1..10 # Can use pattern matching on ranges as well +[lower, upper] #=> [1, 10] + ## --------------------------- ## -- Operators ## ---------------------------