I have the following issue with endnotes and macros. Here is the code:
\documentclass{article}
\usepackage{endnotes}
\begin{document}
\def\tmp{yellow}
yellow\endnote{\tmp}
\def\tmp{blue}
blue\endnote{\tmp}
\theendnotes
\end{document}
In other words the second definition of /tmp kills the content of the first endnote. This is caused by the way endnotes handles macros and generates the .ent file:
\@doanenote {1}
macro:->\tmp
\@endanenote
\@doanenote {2}
macro:->\tmp
\@endanenote
Is there a way around it? I have a fairly complex tex application where endnote content is assembled at runtime from a database (using package datatool) and I can't avoid the use of macros. Content is however fairly simple and made of simple text, nothing fancy. I'd like to pass to \endnote{} this simple text and not the macro used to generate it, but I'm at a loss. Sorry if the answer is kinda trivial.

