From 2b4fe43f7187fcc3df0772a36f4264269f98c5c1 Mon Sep 17 00:00:00 2001 From: Jonah Hirsch Date: Wed, 15 Mar 2017 02:06:31 -0700 Subject: Fix some missing double quotes in Agent section (#2682) --- elixir.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'elixir.html.markdown') diff --git a/elixir.html.markdown b/elixir.html.markdown index 63b7aef2..9dfffc41 100644 --- a/elixir.html.markdown +++ b/elixir.html.markdown @@ -433,11 +433,11 @@ self() #=> #PID<0.27.0> # Create an agent with `Agent.start_link`, passing in a function # The initial state of the agent will be whatever that function returns -{ok, my_agent} = Agent.start_link(fn -> ["red, green"] end) +{ok, my_agent} = Agent.start_link(fn -> ["red", "green"] end) # `Agent.get` takes an agent name and a `fn` that gets passed the current state # Whatever that `fn` returns is what you'll get back -Agent.get(my_agent, fn colors -> colors end) #=> ["red, "green"] +Agent.get(my_agent, fn colors -> colors end) #=> ["red", "green"] # Update the agent's state the same way Agent.update(my_agent, fn colors -> ["blue" | colors] end) -- cgit v1.2.3 From f1a5fb83d4e1d1c4afdb860f1e332607a0b32e9d Mon Sep 17 00:00:00 2001 From: Ev Bogdanov Date: Tue, 15 Aug 2017 21:58:51 +0300 Subject: [elixir/en] Fix exception name --- elixir.html.markdown | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'elixir.html.markdown') diff --git a/elixir.html.markdown b/elixir.html.markdown index 9dfffc41..a74baa38 100644 --- a/elixir.html.markdown +++ b/elixir.html.markdown @@ -4,6 +4,7 @@ contributors: - ["Joao Marques", "http://github.com/mrshankly"] - ["Dzianis Dashkevich", "https://github.com/dskecse"] - ["Ryan Plant", "https://github.com/ryanplant-au"] + - ["Ev Bogdanov", "https://github.com/evbogdanov"] filename: learnelixir.ex --- @@ -127,7 +128,8 @@ rem(10, 3) #=> 1 # These operators expect a boolean as their first argument. true and true #=> true false or true #=> true -# 1 and true #=> ** (ArgumentError) argument error +# 1 and true +#=> ** (BadBooleanError) expected a boolean on left-side of "and", got: 1 # Elixir also provides `||`, `&&` and `!` which accept arguments of any type. # All values except `false` and `nil` will evaluate to true. -- cgit v1.2.3 From b230fbd52f2f1e657fd5ca384f88b0f1959d5809 Mon Sep 17 00:00:00 2001 From: Chris Zimmerman Date: Mon, 8 Oct 2018 12:17:24 -0400 Subject: Adds clarification for functions with multiple clauses. --- elixir.html.markdown | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'elixir.html.markdown') diff --git a/elixir.html.markdown b/elixir.html.markdown index a74baa38..e82509e7 100644 --- a/elixir.html.markdown +++ b/elixir.html.markdown @@ -287,7 +287,11 @@ end PrivateMath.sum(1, 2) #=> 3 # PrivateMath.do_sum(1, 2) #=> ** (UndefinedFunctionError) -# Function declarations also support guards and multiple clauses: +# Function declarations also support guards and multiple clauses. +# When a function with multiple clauses is called, the first function +# that satisfies the clause will be invoked. +# Example: invoking area({:circle, 3}) will call the second area +# function defined below, not the first: defmodule Geometry do def area({:rectangle, w, h}) do w * h -- cgit v1.2.3 From 8ba2b7b32998125f29ee253715a82d353b9798d6 Mon Sep 17 00:00:00 2001 From: Harry Moreno Date: Thu, 27 Dec 2018 19:40:21 -0500 Subject: Fix broken link --- elixir.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'elixir.html.markdown') diff --git a/elixir.html.markdown b/elixir.html.markdown index e82509e7..7af29202 100644 --- a/elixir.html.markdown +++ b/elixir.html.markdown @@ -452,7 +452,7 @@ Agent.update(my_agent, fn colors -> ["blue" | colors] end) ## References * [Getting started guide](http://elixir-lang.org/getting-started/introduction.html) from the [Elixir website](http://elixir-lang.org) -* [Elixir Documentation](http://elixir-lang.org/docs/master/) +* [Elixir Documentation](https://elixir-lang.org/docs.html) * ["Programming Elixir"](https://pragprog.com/book/elixir/programming-elixir) by Dave Thomas * [Elixir Cheat Sheet](http://media.pragprog.com/titles/elixir/ElixirCheat.pdf) * ["Learn You Some Erlang for Great Good!"](http://learnyousomeerlang.com/) by Fred Hebert -- cgit v1.2.3 From 2321097fadd30ae0c09cc224a3e0260cd3c9a842 Mon Sep 17 00:00:00 2001 From: Maxime Guerreiro Date: Sat, 25 Jan 2020 22:44:18 +0000 Subject: [elixir/en] Use https links --- elixir.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'elixir.html.markdown') diff --git a/elixir.html.markdown b/elixir.html.markdown index 7af29202..0b717ca6 100644 --- a/elixir.html.markdown +++ b/elixir.html.markdown @@ -1,7 +1,7 @@ --- language: elixir contributors: - - ["Joao Marques", "http://github.com/mrshankly"] + - ["Joao Marques", "https://github.com/mrshankly"] - ["Dzianis Dashkevich", "https://github.com/dskecse"] - ["Ryan Plant", "https://github.com/ryanplant-au"] - ["Ev Bogdanov", "https://github.com/evbogdanov"] @@ -451,9 +451,9 @@ Agent.update(my_agent, fn colors -> ["blue" | colors] end) ## References -* [Getting started guide](http://elixir-lang.org/getting-started/introduction.html) from the [Elixir website](http://elixir-lang.org) +* [Getting started guide](https://elixir-lang.org/getting-started/introduction.html) from the [Elixir website](https://elixir-lang.org) * [Elixir Documentation](https://elixir-lang.org/docs.html) * ["Programming Elixir"](https://pragprog.com/book/elixir/programming-elixir) by Dave Thomas -* [Elixir Cheat Sheet](http://media.pragprog.com/titles/elixir/ElixirCheat.pdf) -* ["Learn You Some Erlang for Great Good!"](http://learnyousomeerlang.com/) by Fred Hebert +* [Elixir Cheat Sheet](https://media.pragprog.com/titles/elixir/ElixirCheat.pdf) +* ["Learn You Some Erlang for Great Good!"](https://learnyousomeerlang.com/) by Fred Hebert * ["Programming Erlang: Software for a Concurrent World"](https://pragprog.com/book/jaerlang2/programming-erlang) by Joe Armstrong -- cgit v1.2.3 From 6f9362b080b3b7ef2728a631acd3f5417382db4f Mon Sep 17 00:00:00 2001 From: Dan Tong Date: Tue, 3 Mar 2020 14:36:47 +1300 Subject: Use correct pattern matching for Elixir --- elixir.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'elixir.html.markdown') diff --git a/elixir.html.markdown b/elixir.html.markdown index 0b717ca6..49505128 100644 --- a/elixir.html.markdown +++ b/elixir.html.markdown @@ -439,7 +439,7 @@ self() #=> #PID<0.27.0> # Create an agent with `Agent.start_link`, passing in a function # The initial state of the agent will be whatever that function returns -{ok, my_agent} = Agent.start_link(fn -> ["red", "green"] end) +{:ok, my_agent} = Agent.start_link(fn -> ["red", "green"] end) # `Agent.get` takes an agent name and a `fn` that gets passed the current state # Whatever that `fn` returns is what you'll get back -- cgit v1.2.3 From 115ceaa13bdccc526b2a091de27bb20e6e19cc81 Mon Sep 17 00:00:00 2001 From: threadspeed <65226423+threadspeed@users.noreply.github.com> Date: Wed, 3 Jun 2020 20:08:51 +0200 Subject: Update elixir.html.markdown added link --- elixir.html.markdown | 1 + 1 file changed, 1 insertion(+) (limited to 'elixir.html.markdown') diff --git a/elixir.html.markdown b/elixir.html.markdown index 0b717ca6..c2dc171c 100644 --- a/elixir.html.markdown +++ b/elixir.html.markdown @@ -457,3 +457,4 @@ Agent.update(my_agent, fn colors -> ["blue" | colors] end) * [Elixir Cheat Sheet](https://media.pragprog.com/titles/elixir/ElixirCheat.pdf) * ["Learn You Some Erlang for Great Good!"](https://learnyousomeerlang.com/) by Fred Hebert * ["Programming Erlang: Software for a Concurrent World"](https://pragprog.com/book/jaerlang2/programming-erlang) by Joe Armstrong +* ["Introduction to Elixir"](https://learn-elixir.com/) -- cgit v1.2.3 From 8d4d4285b378c2ed6354f986c754d5d04058f198 Mon Sep 17 00:00:00 2001 From: threadspeed <65226423+threadspeed@users.noreply.github.com> Date: Wed, 3 Jun 2020 20:09:19 +0200 Subject: Update elixir.html.markdown added link --- elixir.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'elixir.html.markdown') diff --git a/elixir.html.markdown b/elixir.html.markdown index c2dc171c..0226ecaf 100644 --- a/elixir.html.markdown +++ b/elixir.html.markdown @@ -457,4 +457,4 @@ Agent.update(my_agent, fn colors -> ["blue" | colors] end) * [Elixir Cheat Sheet](https://media.pragprog.com/titles/elixir/ElixirCheat.pdf) * ["Learn You Some Erlang for Great Good!"](https://learnyousomeerlang.com/) by Fred Hebert * ["Programming Erlang: Software for a Concurrent World"](https://pragprog.com/book/jaerlang2/programming-erlang) by Joe Armstrong -* ["Introduction to Elixir"](https://learn-elixir.com/) +* [Introduction to Elixir](https://learn-elixir.com/) -- cgit v1.2.3