BASICS

*hello.erl - basics
  compilation, from command-line and top-level (.erl files vs. .beam files)
  exporting symbols
    Forget to export something
    Then add to the export list
  dynamic typing
  formatted IO 

*fun.erl
  define-once variables
  recursion by case statement
  recursion by clauses
  pattern matching refinements

*lists.erl
  basic list stuff and pattern matching, higher order functions, atoms

*qsort.erl
  cool use of lists stuff

*pairs.erl
  pairs, polymorphism

CONCURRENT PROGRAMMING

*spawnme.erl
  basic spawning, message receiving (send message to it from command line)

      - building blocks:
        - spawn/1 creates a new process.  Give it a function of the
	thing to run (like giving a Runnable to Thread.create()).
	- Pid ! message sends a message to a process Pid's "mailbox"
	- receive receives a message.  Can pattern match the message
	that is received (use ; between each pattern)

          Key Here: will take the first message in the queue that
          matches the pattern; if none match this pattern, goes on to
          the next one.

*processes.erl vs. Processes.java

*join.erl
  message receiving by pattern matching

*sequence1.erl
  FIrst look at Sequence.java
  Then look at sequence1.erl
    - Show how a reference is encoded by a shepherding process
      on the board, starting from the Sequence.java case.
    - Show the Erlang code
      - point out the building blocks, from above
      - for the test, notice that we don't do error checking: we just
        do things assuming it works, and pattern match failure becomes
	the error.
      - point out that reset() is faster than in the sync case since
        the caller doesn't have to wait: his request is queued up.
	- a *call* is a request sent that waits for a response
	- a *cast* is a request that needs no response

*server.erl: server framework
    - Abstract out the notion of a behavior for call-return
    - Show the pieces --state, and return value--
      - This pattern is called a *behavior*

*sequence2.erl: sequence using the server framework

*badsequence.erl: data race!

*sem.erl : exercise, write behavior that implements a semaphore

