A question inspired by @gernot's elegant answer in the topic Environment with a dummy parameter.
However some further experiments lead to the following. Indeed, what the
devil? Take a @gernot version of the look
-environment there and look at this.
\documentclass{article}
\begin{document}
\newenvironment{look}[1][\empty]%
{\begin{trivlist}\item[]\textsc{ThinkOut}%
\ifx#1\empty\else\ (#1)\fi.\itshape}{\end{trivlist}}
\begin{verbatim}
\begin{look}[some addendum]
Text ...
\end{look}
\end{verbatim}
\begin{look}[some addendum]
Text ...
\end{look}
\begin{verbatim}
\begin{look}[q]
Seems allright? Look below ...
\end{look}
\end{verbatim}
\begin{look}[q]
Seems allright? Look below ...
\end{look}
\begin{verbatim}
\begin{look}[qq]
Double-q disappears. Where parentheses?
\end{look}
\end{verbatim}
\begin{look}[qq]
Double-q disappears. Where parentheses?
\end{look}
\begin{verbatim}
\begin{look}[aaa]
One of three a's survives; no ()'s do.
\end{look}
\end{verbatim}
\begin{look}[aaa]
One of three a's survives; no ()'s do.
\end{look}
\begin{verbatim}
\begin{look}[ qq]
Allright again.
\end{look}
\end{verbatim}
\begin{look}[ qq]
Allright again.
\end{look}
\begin{verbatim}
\begin{look}[{}aa]
Allright too.
\end{look}
\end{verbatim}
\begin{look}[{}aa]
Allright too.
\end{look}
\begin{verbatim}
\begin{look}[==]
Any double symbol disappears.
\end{look}
\end{verbatim}
\begin{look}[==]
Any double symbol disappears.
\end{look}
\end{document}
Or may be this is the known LaTeX bug?
PS. Sorry, I was not able to download the pdf-result file here.
PPS. The system I have is (info from a log-file)
e-TeX, Version 3.141592-2.1 (MiKTeX 2.3) (preloaded format=latex 2000.11.28)
LaTeX2e <2001/06/01> Document Class: article 2001/04/21 v1.4e
Standard LaTeX document class
\begin{look}[qq]
the\ifx
test is\ifx qq\empty
and obviously evaluates to true. What did you expect? Use\ifx\empty#1
instead.\empty#1
instead of#1\empty
.