Project 4 warmup: Erlang exercises

Due: Tuesday, November 20, 1:59 PM

Updates

Overview

These are a bunch of exercises to get your feet wet with Erlang programming. Among other things, doing these should help prepare you for the exam.

This project will be worth only 2% of your grade. To get full credit, you just have to turn something in that makes an attempt at every function. Note that for some of these, the answers are likely available somewhere on-line. I'm not going to check for cheating; if you don't make a serious attempt yourself to work out the problems, you will suffer on the exam which is worth a lot more of your grade. There will be no late deadline; you must turn it in on time to get credit.

You will almost certainly want to refer to the Erlang documentation. Links to tutorials, books, and manual pages are on the main course schedule page.

The Exercises

Testing Your Submission on Linuxlab

Erlang is installed on Linuxlab and you can run it from the command line using erl like we do in class. Alternatively, you can install Erlang on your own machine and test the programs there.

A Note About Running in Eclipse

There is an Eclipse plugin for Erlang, called Erlide. Unfortunately, as far as I can tell it only works for version R14, not R16, which is the most recent version. I have been unable to get it to work, but it might work for you. You can find detailed instructions about setting up Erlide, including integrating an Erlang runtime here.

Because Erlide only allows Eclipse "Run Configurations" with a single argument, you may need to run your code using the Console. Once you have successfully provided an Erlang backend, look for the Console tab at the bottom of the screen. You can interact with the Console just as with the "erl" command-line tool, running your code with a command such as semaphore:test().

What to Turn In

Every file you submit should have your name and UID. Each file should also have a no-argument function test in it that actually runs the code you've implemented. As such, I ought to be able to iterate through all of your files, compile them, and then run FILE:test() to see things work. Feel free to use helper functions in your tests that we have provided in sample code, or that you write yourself.

Submit your code on the Department's Submit Server. Contact the TA if you have any troubles submitting.

Web Accessibility