Have you ever thought to yourself, “What can I do with all my spare time” or maybe “There are all these people at work, that I really would like to get to know better”? No, really, oh well I have. The game plan I came up with was simple, find something that was related to work but happened after work and beer was provided. The answer to all the worlds problems is Erlang, dun dun duda…. Ok maybe not, but the newly re-minted Erlang-NYC meetup group was the answer to my problems. For those of you who have never heard of this “Meetup” idea, it is a group of people getting together to talk or act on a unified topic or activity. This meetup’s unified topic is Erlang, DUH, and they get together about once a month or more.
One of the series the group is doing follows along with a beginners guide to Erlang called, Études for Erlang. Every week we meet to go through one of the chapters from the guide and hopefully we all become more familiar with the language, while making friends with people of similar interests. This week (06/10/2013) we had our first meeting to go through chapters 1 and 2. Here are my solutions:
Chapter 1: Getting Comfortable with Erlang
Try leaving out parentheses in arithmetic expressions:
Try adding "adam"
to 12
:
Make up variable names that you are sure Erlang wouldn’t ever accept
Chapter 2: Functions and Modules
Write a module with a function that takes the length and width of a rectangle and returns (yields) its area. Name the module geom
, and name the function area
. The function has arity 2, because it needs two pieces of information to make the calculation. In Erlang-speak: write function area/2
.
Test:
Generated EDoc:
Looking forward to next week! Hope you can join myself and other Medidatations at the 06/18/2013 Erlang-NYC Meetup.