3

Possible Duplicate:
When to use \LetLtxMacro?

I have a problem in redefining a command with an optional argument in terms of its old definition. Here is what I did:

\newcommand{\testopt}[2][optional]{opt:#1;  arg:#2.}  
\let\oldtestopt\testopt  
\renewcommand{\testopt}[2][newoptional]{\oldtestopt[0]{1}} 

I expect now \testopt{argument} to typeset opt:0; arg:1..
When I typeset the file the compiler freezes as it was in a loop. I tried a similar example without optional argument and it worked as expected.

Can anybody explain me where the error is?

marked as duplicate by Martin Schröder, barbara beeton, user11232, Mensch, Claudio Fiandrino Jan 18 '13 at 13:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.