Recent Changes - Search:

Home

Is the Laser up?

People

Publications

Calendar

Projects

Spring 2012

Older Courses

Fall 2011

Spring 2011

Fall 2010

Spring 2010

Fall 2009

Spring 2009

Fall 2008

Spring 2008

Fall 2007

HOWTOs

edit SideBar

PS6

Home Assignments Lecture Blog Resources Project Discussion Group

91.301 Organization of Programming Languages
Prof. F. Martin

Out: March 23, 2009
Due: March 30, 2009

Problem Set 6: Type Systems and Final Project Exploration 1

Overview

This problem set introduces three ways to build type systems in Scheme: generic operations with explicit dispatch, data-directed style, and message-passing style.

Reading

Before doing this problem set, read the following material:

Implementation

Use Module language in Dr. Scheme 4.x for this problem set.

Use this starter code for completing the work.

Problems

1. Exercise 2.76 on pp. 187, a discussion of the three strategies presented in the text. Before answering the questions, briefly define the three strategies.

2. Exercise 2.77 on pp. 192–193 on complex-number selectors in type table.

3. Exercise 2.78 on pp. 193, implementing our scheme-number type natively.

4. Exercise 2.79 on pp. 193, implementing a generic equality predicate.

5. Exercise 2.81 on pp. 200, fixing apply-generic so that it doesn't coerce two arguments of the same type.

6. Exercise 2.83 on pp. 201, raising objects’ type per the “tower of types.”

7. Exercise 2.84 on pp. 201, modifying apply-generic to coerce arguments to a higher type in the tower.

Final Project Exploration 1

In this exercise, you will play with at least one library provided by the PLT Scheme developers. You will have the opportunity to explore another library in each of the next two weeks.

Please choose libraries that you think you might be interested in using in your final project.

Start off at the PLT Scheme home page, http://plt-scheme.org/

Then there are two places you can go for library code:

In the Documentation area, you will find detailed Getting Started guides. The More: Systems Programming with PLT Scheme walks you through building a web server in Scheme from first principles. The Continue: Web Applications in PLT Scheme goes into greater depth with this approach.

If you may be interested in building a web app with Scheme, this would be a good place to start.

Otherwise, have a look at the various other libraries available, including GUI and graphics libraries, networking libraries, and parsing libraries.

Your job is to explore one library and write up your results. Load the library and write some code to drive it around.

For example, if we look at the net/url library, we will find functions for creating URLs, issuing HTTP GET commands, and displaying the results. Here is a little bit of code for driving around a few of the functions in this library:


#lang scheme

(require net/url)

(define myurl (string->url "http://www.cs.uml.edu/"))
(define myport (get-pure-port myurl))
(display-pure-port myport)

Notice that (require net/url) is all you need to put in your buffer in order to load the library and start using it.

This above is a trivial example; to complete this for the purposes of this assignment (if you go down the path of pulling HTTP requests), you should use the parsing libraries to parse the HTML that is returned, and then do something with the results.

To turn in: at least 2 pages of interspersed code and narrative explaining what you did. Reminder again: please think about what you might want to work on for your final project, and choose a relevant library to work with.

Edit - History - Print - Recent Changes - Search
Page last modified on March 22, 2009, at 01:31 PM