cws/core_cw03.tex
changeset 501 3717785f2c37
parent 498 0f1b97538ad4
equal deleted inserted replaced
500:fd7f8aff848c 501:3717785f2c37
    35 \subsection*{Reference Implementation}
    35 \subsection*{Reference Implementation}
    36 
    36 
    37 This Scala assignment comes with two reference implementations in
    37 This Scala assignment comes with two reference implementations in
    38 form of \texttt{jar}-files. This allows
    38 form of \texttt{jar}-files. This allows
    39 you to run any test cases on your own computer. For example you can
    39 you to run any test cases on your own computer. For example you can
    40 call scala-cli on the command line with the option \texttt{--extra-jars
    40 call scala on the command line with the option \texttt{--extra-jars
    41   postfix.jar} and then query any function from the
    41   postfix.jar} and then query any function from the
    42 \texttt{postfix.scala} file (similarly for file \texttt{postfix2.scala}). As
    42 \texttt{postfix.scala} file (similarly for file \texttt{postfix2.scala}). As
    43 usual you have to prefix the calls with \texttt{C3a} and
    43 usual you have to prefix the calls with \texttt{C3a} and
    44 \texttt{C3b}, respectively.
    44 \texttt{C3b}, respectively.
    45 
    45 
    46 
    46 
    47 \begin{lstlisting}[xleftmargin=1mm,numbers=none,basicstyle=\ttfamily\small]
    47 \begin{lstlisting}[xleftmargin=1mm,numbers=none,basicstyle=\ttfamily\small]
    48 $ scala-cli --extra-jars postfix.jar
    48 $ scala --extra-jars postfix.jar
    49 
    49 
    50 scala> C3a.syard(C3a.split("( 5 + 7 ) * 2"))
    50 scala> C3a.syard(C3a.split("( 5 + 7 ) * 2"))
    51 val res0: C3a.Toks = List(5, 7, +, 2, *)
    51 val res0: C3a.Toks = List(5, 7, +, 2, *)
    52 \end{lstlisting}%$
    52 \end{lstlisting}%$
    53 
    53