Consider this example:
\documentclass{article}
\newcommand{\baz}{}
\newenvironment{foo}[1]{#1}{\makeatletter\g@addto@macro\baz{#1}\makeatother}
\begin{document}
\begin{foo}{bar}
\end{foo}
\end{document}
The example does not work. What I am aiming to achieve is concatenating all parameters used with foo, so I can output them at the end of the document. What is the correct approach for that?
\newenvironment. – xport Jun 7 '11 at 0:08\makeatletteretc. inside command arguments because they are parsed when they are read, not when they are executed. – Philipp Jun 7 '11 at 5:08