Created
June 19, 2012 13:48
-
-
Save zr-tex8r/2954321 to your computer and use it in GitHub Desktop.
A sample code of something called "LISP on TeX"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{article} | |
\usepackage[scale=0.8]{geometry} | |
\usepackage{lisp} | |
\begin{document} | |
%% An expression equivalent to | |
% (let ((two (lambda (s) (lambda (z) (s (s z)))))) | |
% (let ((next (lambda (x) (cons "*" x)))) | |
% (((two (two two)) next) '()))) | |
% in Scheme. It calculates (2^2)^2 and makes an list consisting | |
% of as many "*"'s as the value (i.e. 16). | |
\lispread\expA{((\lambda.(\two.(((\lambda.(\next.((((\two.((\two.(\two.()))% | |
.())).(\next.())).((\quote.(().())).())).()))).((\lambda.(\x.((\cons.(*.(\x% | |
.()))).()))).())).()))).((\lambda.(\s.((\lambda.(\z.((\s.((\s.(\z.())).()))% | |
.()))).()))).()))} | |
\scrollmode % non-stop running | |
\lispeval\expA\valA | |
\lispprint\valA | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment