Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Elixir

You're reading from   Learning Elixir Unveil many hidden gems of programming functionally by taking the foundational steps with Elixir

Arrow left icon
Product type Paperback
Published in Jan 2016
Publisher
ISBN-13 9781785881749
Length 286 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Kenneth Ballou Kenneth Ballou
Author Profile Icon Kenneth Ballou
Kenneth Ballou
Kenny Ballou Kenny Ballou
Author Profile Icon Kenny Ballou
Kenny Ballou
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Introducing Elixir – Thinking Functionally FREE CHAPTER 2. Elixir Basics – Foundational Steps toward Functional Programming 3. Modules and Functions – Creating Functional Building Blocks 4. Collections and Stream Processing 5. Control Flow – Occasionally You Need to Branch 6. Concurrent Programming – Using Processes to Conquer Concurrency 7. OTP – A Poor Name for a Rich Framework 8. Distributed Elixir – Taking Concurrency to the Next Node 9. Metaprogramming – Doing More with Less Index

Everything is an expression


We have hinted at this concept in the previous chapter, but let's discuss it in more detail here.

In Elixir, there are no statements. Everything is an expression. Let's break this down. Statements typically refer to instructions where the programmer specifies to the computer or runtime to perform some action. This action could, for example, add two numbers together and assign the value to a variable. Or, it could instruct the machine to print data—strings, numbers, and bits—to the console. Or, it could instruct the machine to make a remote connection to another machine and request a web page. These actions may have ephemeral results—the value of the variable, output text on the screen, and page data from the request. But in all of these examples, the code, itself, which instructs the performance of such actions, does not necessarily, nor inherently return anything.

To contrast this to expressions, we note that we can still do all of these things, however, each instruction...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image