Subject: | |
From: | |
Reply To: | |
Date: | Fri, 24 Apr 2009 11:21:20 +0200 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
On Fri, Apr 24, 2009 at 03:03:08PM +0930, Will Robertson wrote:
> On 21/04/2009, at 8:30 PM, Uwe Lück wrote:
>
> >I wonder whether this is a bug that should go to the LaTeX Bug
> >Database, since it only
> >-- is about an internal
> >-- contradicts what one might expect
> >-- while it is not clear to me whether this can affect LaTeX's
> >function on the user-level
>
> This certainly seems like a bug to me, although I had to modify your
> examples to see the error:
>
> \documentclass{article}
> \begin{document}
> \makeatletter
> \in@{bonbon}{bon}\ifin@ YES\else NO\fi % gives YES
> \in@{bonbon}{bonb}\ifin@ YES\else NO\fi % gives NO
> \in@{client-to-client}{client-to}\ifin@ YES\else NO\fi % gives NO
> \in@{client-to-client}{client-to-}\ifin@ YES\else NO\fi % gives YES
> \makeatother
> \end{document}
>
> The tendency seems to be not to change the internals of LaTeX2e, but
> I'd be happy to replace the current implementation of \in@ with a more
> correct version. What do others think?
I don't see any sense in preserving such a silly bug.
> If others are amenable to the
> change, would you be willing to write the new version?
\catcode`\@=11 %
\def\@empty{}% (for testing with plain-TeX)
%%% begin of fixed definition %%%
\def\in@#1#2{%
\def\in@@##1#1##2\in@@{%
\def\in@@{##2}%
\ifx\in@@\@empty
\in@false
\else
\in@true
\fi
}%
\in@@#2\@nil#1\in@@
}
%%% end of fixed definition %%%
\newif\ifin@
\def\test#1#2#3{%
\in@{#1}{#2}%
\edef\@result{%
\ifin@ yes\else no\fi
}%
\def\@expected{#3}%
\immediate\write16{%
[\string\in@{#1}{#2} = \@result\space] => %
\ifx\@result\@expected OK.\else FAILED!\fi
}%
}
\test{bonbon}{bon}{no}
\test{bon}{bonbon}{yes}
\test{bona}{bon}{no}
\test{bon}{bona}{yes}
\test{ionization}{ionizat}{no}
\test{client-to-client}{client-to-}{no}
\csname @@end\endcsname\end
Yours sincerely
Heiko <[log in to unmask]>
|
|
|