equal
  deleted
  inserted
  replaced
  
    
    
|      1 \documentclass{article} |      1 \documentclass{article} | 
|      2 \usepackage{../style} |      2 \usepackage{../style} | 
|         |      3 \usepackage{../langs} | 
|      3 \usepackage{../graphics} |      4 \usepackage{../graphics} | 
|      4  |      5  | 
|      5 \begin{document} |      6 \begin{document} | 
|      6  |      7  | 
|      7 \section*{Homework 8} |      8 \section*{Homework 8} | 
|     16       compiling a WHILE-program? |     17       compiling a WHILE-program? | 
|     17  |     18  | 
|     18 \item What is the main difference between the Java assembler |     19 \item What is the main difference between the Java assembler | 
|     19       (as processed by Jasmin) and Java Byte Code? |     20       (as processed by Jasmin) and Java Byte Code? | 
|     20  |     21  | 
|         |     22 \item Consider the following Scala snippet. Are the two functions | 
|         |     23 \texttt{is\_even} and \texttt{is\_odd} tail-recursive?      | 
|         |     24  | 
|         |     25 \begin{lstlisting}[numbers=none] | 
|         |     26 def iseven(n: Int) : Boolean = { | 
|         |     27     if (n == 0) true else isodd(n - 1) | 
|         |     28 } | 
|         |     29  | 
|         |     30 def isodd(n: Int) : Boolean = { | 
|         |     31     if (n == 0) false  | 
|         |     32     else if (n == 1) true else iseven(n - 1) | 
|         |     33 } | 
|         |     34 \end{lstlisting} | 
|         |     35        | 
|         |     36 Do they cause stack-overflows when compiled to the JVM (for example by Scala)? | 
|         |     37  | 
|     21  |     38  | 
|     22 \item Explain what is meant by the terms lazy evaluation and eager |     39 \item Explain what is meant by the terms lazy evaluation and eager | 
|     23   evaluation. |     40   evaluation. | 
|     24  |     41  | 
|     25 \item \POSTSCRIPT     |     42 \item \POSTSCRIPT     |