You don't have to define `\First` and `\Second` since these are predefined as `\@firstoftwo` and `\@secondoftwo`. Also the Unicode bytes are already active so setting their catcode is useless. Also redefining the first octet breaks LaTeX's UTF-8 handling and the else case forms an infinite loop. Changing the catcodes of `(` and `)` means that this command doesn't work in the arguments of other commands and it breaks other uses of `(` and `)` in the argument.<p>Instead you could do this as<p><pre><code> \documentclass{article}
\usepackage{xparse}
\NewDocumentCommand \LambdaCalc {u{.} r()} {%
[arg:(#1) body:(#2)]
}
\DeclareUnicodeCharacter {03BB} {\LambdaCalc}
\begin{document}
λx.(2x)
\end{document}</code></pre>
A bit disapointing. It's mostly about parsing, not usage.<p>Half of the post is about handling UTF-8, which AFAIK both LuaTeX and XeTeX (you really shoulduse either) do natively.
Combine this with that paper of C compiler written entirely in lambda terms[0], now LaTeX is a compilation platform as well!<p>[0] <a href="https://news.ycombinator.com/item?id=33115719" rel="nofollow">https://news.ycombinator.com/item?id=33115719</a>
Sums up the LaTeX experience quite well imho:<p>> LaTeX is great for typesetting math.<p>Q: Ok, great! So how do I typeset this bit of common math?<p>A: a 20-line barrage of import statements, makeatletter's and definitions that you copy-paste into your preamble and cross your fingers that it won't conflict with the half-dozen other barrages that you copied there to do other bits of common math, often hidden between other Google results with wildly different answers.
Is it possible to do something like Jupiter notebook like so you can demonstrate some (commonn lisp) and then show their result. Like Notebook support some tex.<p>Too much to ask for I guess. Continue waiting.
Having spent most of the day stepping on LaTeX rakes, I am really at a loss how anyone could think that making it <i>more</i> programmable would think that's a good idea.<p>There are very few bits of software that are more arcane and broken by default than this absolute crapstraction of a platform.