Today I came across these three commands:
\@nil
\@cdr
\@car
Some are mentioned here and here, but I didn't get the idea of it. It seems to have to do with the macro character.
I haven't seen any description about it on google and TeX.SX.
Today I came across these three commands:
\@nil
\@cdr
\@car
Some are mentioned here and here, but I didn't get the idea of it. It seems to have to do with the macro character.
I haven't seen any description about it on google and TeX.SX.
the names come from lisp.
In lisp, car returns the head of a list, cdr returns the tail of a list and nil is an empty list.
in latex
\def\@car#1#2\@nil{#1}
\def\@cdr#1#2\@nil{#2}
(\@nil
is not defined at all)
so
\@car abc\@nil
expands to a
and
\@cdr abc\@nil
expands to bc
\@nil
is undefined. Why is there no undefined error?
Commented
Feb 13, 2017 at 22:02
\def\foo#1\wibblethingy{hello #1}...\foo Maestro\wibblethingy
Commented
Feb 13, 2017 at 22:06
\tl_car:n
and tl_cdr:n
to honour the cultural heritage
Commented
Feb 13, 2017 at 22:08