This page documents what we do in class. It contains programs that we will discuss in class, reading assignments from our textbook, links to other sources of information, etc.
The reading assignments are listed by the date on which they were assigned. The sample program files are listed by the date on which they were used. When you are viewing a source code page, you can use your browser's "File -> Save As..." menu item to save a copy of the code on your computer. It is a good idea for you to "play" with these example programs; compile them, run them, make simple changes to them and compile and run them again.
- Thursday, May 1.
- The second exam is a take home exam. Each student should do their own work on all of the problems. Unlike a homework assignment, you should not discuss your ideas on these problems with other students in the class. You can either print out the PDF version of this exam and write your answers on the printout, or you can type your answers into the MS Word version of this exam, or you can do a combination of the two. This exam is due, either in my physical mail box in CLO 316 or in my email mail box, by Wednesday, May 7.
- Here is an interesting essay about Lisp/Scheme.
- Thursday, April 24.
- Read Sections 7.4 (pages 349-366), Section 7.7 (just pages 369-382) and Section 7.8 (pages 389-392) from Programming Language Pragmatics.
- Here is an example of why we care (or should care) about programming languages (all of the examples in one zip file).
- Here is an implementation of a recursive (true) iterator written in C. The code is very weird. It tries to mimic coroutines. There must be a better way to do this (probably by using threads).
- Tuesday, April 22.
- See the homework page for your seventh assignment.
- Read Sections 7.3 (pages 336-349) from Programming Language Pragmatics.
- Thursday, April 17.
- Read Sections 7.1-7.2 (pages 307-336) from Programming Language Pragmatics.
- Here are examples of "arbitrary number of paramters" in Maple, Scheme and C.
- Tuesday, April 15.
- Here are two files that help explain call-by-name using "macro expansion" and call-by-name using "thunks".
- Here are the Scheme programs that demonstrate lazy evaluation of a list.
- Thursday, April 10.
- Here is the example we did in class about "breaking" call-by-const-reference in C++.
- Here is a related example contributed by Brian Hunter (along with a few variations on his example).
- Thursday, April 3.
- See the homework page for your sixth assignment.
- Read Sections 8.1-8.3 (pages 407-434) from Programming Language Pragmatics.
- Tuesday, April 1.
- Read Sections 8.1-8.3 (pages 407-434) from Programming Language Pragmatics.
- Here are the iterator examples from the textbook (one in Clu, one in Java, and two in C#). You can also download these examples in a single zip file.
- Tuesday, March 25.
- Read Sections 6.4-6.5 (pages 261-287) from Programming Language Pragmatics.
- Here is a simple C program that gives an example of the distinction between a statement and an expression.
- Here is a simple C program that gives an example of how programming with side effects can be a problem.
- Thursday, March 20.
- Read Sections 6.1-6.3 (pages 233-261) from Programming Language Pragmatics.
- Tuesday, March 18.
- Another example of a function that returns a function (or, how to create objects in Scheme) and a comparison of nested blocks in Scheme and C.
- Thursday, March 6.
- Here is a list of review problems for the upcoming midterm exam. The exam is on Thursday, March 20.
- Here are two Scheme programs that illustrate non-local references from within nested functions.
- These two Scheme programs illustrate non-local references from within nested functions that are passed as paramters.
- These two Scheme programs illustrate non-local references from within nested functions that are returned as values.
- Tuesday, March 4.
- Here are some notes about non-local references in nested functions.
- Microsoft is becoming more and more involved with functional programming. Here are two recent magazine articles that illustrate this nicely.
- The concept of "closures" is common to many more recent languages, even languages that are not functional languages. Here are some references to closures in several popular langauages. (These references are not a reading assignment. They are just to illustrate how common closures are becomming.)
- Thursday, February 28.
- Tuesday, February 26.
- Thursday, February 21.
- Tuesday, February 19.
- See the homework page for your fourth assignment.
- Read Sections 3.5-3.6 (pages 136-149) and Section 3.7 (page 149 and the book's CD) from Programming Language Pragmatics.
- Tuesday, February 12.
- Here is a zip file chock full of little programs that demonstrate aspects of the C runtime system.
- Thursday, February 7.
- See the homework page for your third assignment.
- Read Sections 3.1-3.3 (pages 103-134) from Programming Language Pragmatics.
- Here are two extensions to our baby language.
- C programs that demonstrate various static and dynamic semantic errors.
- Tuesday, February 5.
- Here are some more examples of simple syntaxes for "expression like" languages and here are recursive descent "recognizers" for several of these languages.
- Thursday, January 31.
- Here is an example of a baby language that helps explain associativity in BNF and EBNF grammars. Here are two parsers for this simple language.
- Here is how we can add parentheses to our baby language.
- Tuesday, January 29.
- Here are some examples of simple syntaxes for arithmetic expressions.
- Here are two very simple parsers for arithmetic expressions.
- Thursday, January 24.
- See the homework page for your second assignment.
- A few more interesting examples.
- Tuesday, January 22.
- Read Sections 2.3, 2.3.1 and 2.3.2 (pages 61-80) from Programming Language Pragmatics.
- A simple C program (and a Java version of it) that demonstrates the need to understand the syntax of C tokens.
- A simple C program that demonstrates an ambiguity in the syntax of C.
- Thursday, January 17.
- For next Tuesday, read Chapter 2, Sections 2.1 and 2.2 (pages 37-61) from Programming Language Pragmatics.
- Here are slides about syntax and parsing from the textbook Modern Programming Languages: A Practical Introduction.
- Read the following web pages about syntax and BNF.
- Here are some more links to web pages about syntax and BNF (including the syntax for the C, Java, JavaScript and Pascal programming languages).
- Here is an interesting example of a BNF, the syntax of URL's (see Section 5).
- Tuesday, January 15.
- See the homework page for your first assignment.
- Read Chapter 1 from Programming Language Pragmatics.
- Follow the instructions on the DrScheme installation page to install the Scheme programming language on your computer at home.
- Read A Brief Tour of DrScheme and Chapter 2 from the online textbook, The Scheme Programming Language. Be sure to do Exercises 2.3.1, 2.4.1, 2.4.2, 2.5.1, and 2.6.1 at the end of the sections. These exercises are not a homework assignment to turn in, but feel free to ask me any questions you have about them.
|
|