Please Reload Every Time You Read This Page!

CSC123/252: Programming Languages, Fall 2003

Dr. Chuck C. Liang
Assistant Professor of Computer Science, Hofstra University .

Office Address:
201A Adams Hall
Hofstra University
Hempstead, NY 11550
Office Phone: (516 463) 5559

Email: cscccl@hofstra.edu (<- click to send me mail)

Official Office Hours: MW 12:45am-1:45pm, TuThFr 2-3pm, or by appointment


Course Syllabus

Online Resources:

Halting Problem in Lambda Calculus/Scheme
Fixed point combinator that will work under applicative order of evaluation.
Lambda Calculus in Perl!
Simple Scheme examples
more Simple Scheme examples
More interesting scheme code (lists and trees - based on program from 9/22 class)
Quicksort in Scheme
Graph search in Scheme
www server in Scheme. Here's the page it serves.
Dynamic scoping in Perl
Higher-order functions in Perl
lists and trees in C. (these programs may be expanded later).
OOP in Scheme (contains new assignment)
More OOP examples: Rational number objects in Scheme, C++, Java, and C#
And now for something really special: rats in Eiffel!! rational.e, rats.e. See compilation instructions in rats.e
And now for the ultimate: Bank Accounts in Perl!!!
Example with inheritance in Scheme and C#
Polymorphic bank accounts in C and C#.
What's wrong with C++ pointers?.
Static and dynamic method dispatch in C#
secure type casting in C#/Java
polymorphic bubblesort (Java)
Three versions of polymorphic lists: polylist1.cs, polylist2.cs, polylist3.cs. They all use number.cs as a dll.
"student" visitor pattern example. from 11/10 class. updated, now includes xml file parser
type theory notes. (pdf will look fine when printed)
C++ templates and their problems
Sample pizza programs: plain (contains compiler instructions)
Inlined classes: without generics, with generics
pepperoni pizza (from 11/19)

My first AOP program! (contains compilation instructions)
My second AOP program!! (and stand alone "superprivate" aspect)
My third AspectJ program (!!!) does aspect-oriented bank accounts.
More AspectJ Programs: afourth (advice precedence), circles, cflows, aif (if pointcut), linkedlist (modified), pertarget (new)

Python basics (sample program)
Python oop


Homework 1. Sample Solutions
Scheme Lab and Assignment. Appended
Sample solutions to all Scheme assignments
C# Goblins Assignment
Food example: foods.cs, foodvisitors.cs, aboutfood.cs (comment out usage of xmlwriter until you've written it yourself).
Food Assignment. Your visitor should write files consistent with this example. Due Wednesday 11/19. Part 4 is now optional.
Pizza assignment. Due before turkey break
AspectJ assignment. Due 12/10. Please note that I changed the recursion detection problem again! Also see note below for further hints

Python Lab assignment


Announcements:

Sunday help seesion CANCELED because of snow!. I will hold it on Monday (weather permitting) from 6-7:30m, and again on Tuesday from 6-7pm (approx). At the tuesday session I will also take questions concerning the quiz on Wednesday. I'll also be in my office both Monday and Tuesdays

I decided to give a ~20 minute quiz on the date of the final> (12/17 at 6:15pm). I may also ask you to demonstrate your final programs. The quiz will cover the use of pointcuts in AspectJ, including the meaning of target, this, withincode, and cflow. The quiz may also ask a general question about parametric polymorphism and how it differs from inheritance polymorphism.
Practice Quiz Questions. Don't look at the sample solutions before trying them yourself.

On the AspectJ assignment:
When using an around advice to replace parameters to a function call, you'll need to call the function with the new parameters inside the advice code. To do so you may need to:

  1. prevent the advice from executing recursively
  2. obtain the target object (&& target(A)) that the function was called on (unless the function is static, like in the case of the factorial function of the 1st problem).

Some people have asked me to post the java version of the goblins program. The following is what I get with my solution to the last problem:
> java goblinapp2b
number of recursive calls == 0
number of instance var reads: 27936
number of instance var writes: 2853
number of void method calls: 3971
number of non-void method calls: 8306
number of method calls within same object: 2812
number of method calls outside same object: 7945
The exact numbers you get will depend on how long you ran the program for, but the *ratios* should be similar.