summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lisp-on-tex/lisp-util.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-01-04 00:18:26 +0000
committerKarl Berry <karl@freefriends.org>2014-01-04 00:18:26 +0000
commitb726d3267b3e2c379d7e1e8e4302ab8339f0bccd (patch)
treed91ecd35f96891b43e4758c04e87fe255970fbfd /Master/texmf-dist/tex/latex/lisp-on-tex/lisp-util.sty
parentf5e68d092b878b0f0d86b10cbd8830cf08a153b8 (diff)
lisp-on-tex (3jan14)
git-svn-id: svn://tug.org/texlive/trunk@32561 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/lisp-on-tex/lisp-util.sty')
-rw-r--r--Master/texmf-dist/tex/latex/lisp-on-tex/lisp-util.sty17
1 files changed, 16 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/latex/lisp-on-tex/lisp-util.sty b/Master/texmf-dist/tex/latex/lisp-on-tex/lisp-util.sty
index da4244b9f6b..f263d7059cb 100644
--- a/Master/texmf-dist/tex/latex/lisp-on-tex/lisp-util.sty
+++ b/Master/texmf-dist/tex/latex/lisp-on-tex/lisp-util.sty
@@ -48,7 +48,22 @@
(\lambda (\binds \body)
(\lispif (\= \binds ())
\body
- (\list \let (\cdr \binds) (\list \@mlet (\car (\car \binds)) (\car (\cdr (\car \binds))) \body)))))
+ (\list \letM (\cdr \binds) (\list \@mlet (\car (\car \binds)) (\car (\cdr (\car \binds))) \body)))))
+% letrec
+(\defmacro \letrec (\lambda (\binds \body) (\list \@letrec \binds \binds \body)))
+(\defmacro \@letrec
+ (\lambda (\binds \save \body)
+ (\lispif (\= \binds ())
+ (\list \@@letrec \save \body)
+ (\list \@letrec (\cdr \binds) \save
+ (\list \begin
+ (\list \setB (\car (\car \binds)) (\car (\cdr (\car \binds))))
+ \body)))))
+(\defmacro \@@letrec
+ (\lambda (\binds \body)
+ (\lispif (\= \binds ())
+ \body
+ (\list \@@letrec (\cdr \binds) (\list \@mlet (\car (\car \binds)) () \body)))))
% nth
(\define \nth (\lambda (\lst \n)
(\lispif (\= \n :0) (\car \lst) (\nth (\cdr \lst) (\- \n :1)))))