CS 334
Programming Languages
Spring 2002

Assignment 0
Due Tuesday, 2/12/02

This first assignment is mainly for you to get used to using sml on our UNIX system. See the lecture notes for lecture 2 for assistance. You must do the problems, but they are not to be turned in. Because they are not to be turned in, you may receive help from other members of the class without penalty. In particular, ask for help if you need assistance in using the sml compiler. However, be sure that you are able to write programs like this without help.

Chris Cyll, the TA, will be available in the UNIX lab on the 3rd floor of TCL for help between 8 and 10pm on this Monday evening only.

These problems are not to be turned in

  1. Define a function sumsqrs that, given a nonnegative integer n, returns the sum of the squares of the numbers from 1 to n.

    1. Define a function dup which takes an element, e, of any type and returns a tuple with the element duplicated. E.g.,
         dup "ab" = ("ab","ab").
    2. . Define a function list_dup which takes an element, e, of any type, and a positive number, n, and returns a list with n copies of e. E.g.,
         list_dup "ab" 3 = ["ab","ab","ab"].

Back to:
  • CS 334 home page
  • Kim Bruce's home page
  • CS Department home page
  • kim@cs.williams.edu