# Token expansion with the token library

I don't understand how the token library of luatex works.

\documentclass{standalone}

\begin{document}

\def\mymacro{A}

\directlua{%
t = token.create ('mymacro')
token.expand(t)
token.get_next()
}

\end{document}


The token.expand does not work as I expected: luatex says Undefined control sequence. Why?

With the token.get_next(), I don't know exactly what I should get...

-
add comment

## 1 Answer

Unfortunately token.expand is currently broken. See the bug report which derives from an example exactly like yours.

-
add comment