summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/lisp-on-tex/tug2013/bench/lot/tarai.tex
blob: f443187397ffeea464ae4095cc1f0fe30c4c026c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
\documentclass{article}
\usepackage{lisp-on-tex}
%\tracingmacros=1
\lispinterp{
  (\define \tarai (\lambda (\x \y \z)
    (\lispif (\or (\< \x \y) (\= \x \y)) 
      \y
      (\tarai (\tarai (\- \x :1) \y \z) (\tarai (\- \y :1) \z \x) (\tarai (\- \z :1) \x \y)))))
}
\begin{document}
  $\mathrm{Tarai}(14,10,6) = \lispinterp{(\texprint (\tarai :14 :10 :6))}$
\end{document}