Supercharge Your Elixir Skills with These Expert Tips

10 Killer Elixir Tips #3

Maximize Your Elixir Knowledge with These 10 Killer Tips

Malreddy Ankanna
blackode
Published in
5 min readMar 11, 2017

--

Photo by Indian Yogi (Yogi Madhav) on Unsplash

Hey guys ..!
Welcome to another set of 10 Killer Elixir Tips #3
Read if you missed Killer Elixir Tips #1 and Killer Elixir Tips #2

Let’s Dive Straight into These 10 Killer Elixir Tips and Boost Your Skills

1. Functions as Guard Clauses

We cannot make use of the functions as guard clauses in Elixir. It means, when cannot accept custom functions though return Boolean values. Consider the following lines of code…

Here, we defined a module Hello and a function hello that takes two parameters of name and age. So, based on age I am trying IO.puts accordingly. If you do so you will get an error saying….

** (CompileError) hello.ex:2: cannot invoke local is_kid/1 inside guard
hello.ex:2: (module)

--

--

Malreddy Ankanna
blackode

Programmer & Writer, I write about coding, thoughts, ideas, personal musings, technical articles, and tutorials.https://bio.link/blackode