Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
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
Kenny Ballou Kenny Ballou
Author Profile Icon Kenny Ballou
Kenny Ballou
Kenneth Ballou Kenneth Ballou
Author Profile Icon Kenneth Ballou
Kenneth Ballou
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Learning Elixir
Credits
About the Author
About the Reviewers
www.PacktPub.com
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

More to do about modules


Modules are the enclosing unit of our building blocks. They are the super block to which functions are the blocks. But occasionally, we wish to get data about our modules and metadata on our building blocks. We would probably like to document our code. We would like those following us to be able to read those comments and documentation. Better yet, we would like to have nice tooling around building rich documentation about our code while minimizing duplication, if not entirely eliminating it. Or, instead of documentation, we would like to tag our modules and functions with certain attributes that we could later use for any other number of reasons.

To support these goals, Elixir gives us the ability to give modules attributes, which we can use as developers, or users, or they can be used by the VM. Similarly, we can use attributes as constants.

Attributes are defined in Elixir as @name. For example, I could add the @vsn attribute to annotate a module named MyModule...

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 $15.99/month. Cancel anytime
Visually different images