This is a step-by-step process to make sure you are comfortable with the Lisp environment. Try doing each of the following steps on your own. If you have trouble, come to the workshop for help.
Step 1: Download the example.lisp file into a directory
Step 2: Edit your .emacs file as described above, or just download this one into your home directory. Start Emacs and open the example.lisp file with "C-x C-f".
Step 3: Type "M-l" ('l' as in lisp, not '1' as in one). After hitting enter several times, this should create a new buffer which is connected to a Lisp process.
Step 4: Type "C-x b" (and hit enter to accept the default). This will take you back to the previous buffer (example.lisp). Position the cursor within the first function definition and type "M-e". This should load that function. Type "M-l". This will take you back to the Lisp buffer. Now try testing the function to make sure that it was loaded properly. Type "(two-to-the 4)" and you should see '16' be returned.
Step 5: Type "M-p" and hit enter. This will recall your last command and run it again. You should get '16' again.
Step 6: Type "C-x b" to edit "example.lisp" again. Change the definition of 'two-to-the' by adding the line "(format t "n = ~s~%" n)". Type "M-e" and "C-x b" to load the function and go back to Lisp and type "M-p" and see that we can now see the value of 'n' in recursive iterations of 'two-to-the'.
Step 7: Type "(trace two-to-the)". This tags the function as one that we want to watch. Now type "M-p" twice and see that we see each time the function is called. "0: (two-to-the 6) means the 0th function on the stack is "two-to-the" and it was passed the parameter "6". We also see each time the function returns. "6: returned 1 means that the 6th function on the stack returned with a value "1". Since this is a recursive function, we get a nested structure.
Step 8: Type "(untrace)". This will stop all functions from being traced. "(untrace two-to-the)" would only untrace that one function.
Step 9: Replace the format expression from before with a form "(break)" and reload the function. Run it. At the break call type ":continue 0" to continue past the break point. When you hit the next, repeat. When you hit the next, this time type ":zoom" or ":up" to see the stack trace.