Spring 2001, CSE 428: Quiz 8.1 - 22 March 2001


Please write your Name and Student ID,at the top of the page.
By default, this quiz will be returned in Section 2 (morning section).
  1. [Pts 2] 

    Consider the definition

       fun f [] = 0
         | f (x::L) = x - (f L);
    
    What is the result of f [0,1,2]; ? (only one answer, please)

  2. [Pts 2]  What is the effect of the following sequence of declarations? (only one answer, please)
       val x = 1;
       val (x,y) = (2,true);
    

  3. [Pts 2]  What is the result of the expression hd [0,1,2,3]; (only one answer, please. Remember that hd represents the function "head of a list".)

  4. [Pts 4]  Consider the following definition:
       fun app [] L = L
         | app (x::K) L = x::(app K L);
    
    For each of the following expressions, say what is the result, or say whether it's an error.