Skip to content

Instantly share code, notes, and snippets.

@zr-tex8r
Created June 19, 2012 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zr-tex8r/2954321 to your computer and use it in GitHub Desktop.
Save zr-tex8r/2954321 to your computer and use it in GitHub Desktop.
A sample code of something called "LISP on TeX"
\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