Skip to content

Instantly share code, notes, and snippets.

@olligobber
Created July 6, 2021 11:12
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 olligobber/e044c87a834b34bc74d8c8903b0b0d94 to your computer and use it in GitHub Desktop.
Save olligobber/e044c87a834b34bc74d8c8903b0b0d94 to your computer and use it in GitHub Desktop.
Latex is a lazy functional language
\documentclass[a4paper]{article}
\def \error{\def\error1{}\error2}
\def \S#1#2#3{#1#3{#2#3}}
\def \K#1#2{#1}
\def \i#1{#1\S\K}
\begin{document}
\i{\i{\i\i}}1\error % Does not error
\i{\i{\i\i}}\error1 % Errors
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment