LaTeX defines in ltfssbas.dtx a macro called \strip@pt (at line [246]) which strips the pt part from a dimension returned by \the\dimension. The definition is shown as a minimal working example below:
\documentclass[11pt]{article}
\begin{document}
\parindent=0pt
\makeatletter
\begingroup
\catcode `P=12 % digits and punct. catcode
\catcode `T=12 % digits and punct. catcode
\lowercase{%
\def\x{\def\rem@pt##1.##2PT{##1\ifnum##2>\z@.##2\fi}}}
\expandafter\endgroup\x%
\def\strip@pt{\expandafter\rem@pt\the}
\newdimen\normallineskiplimit \normallineskiplimit=0.001pt
\texttt{Original dimen \the\normallineskiplimit}\\
\texttt{Stripped dimen \strip@pt\normallineskiplimit}\\
\makeatother
\end{document}
In the macro the catcode of the letters 'PT' are changed to category 12, which is the catcode for digits and punctuation. It then changes it to lowercase to match the pt returned by the \the\dimension. I can understand that the intent was to delimit the arguments with the PT returned by the \the\dimension, but why don't the lowercase letters work on their own?
And a second question (pls \relax the one question limit). Just before the \def\strip@pt
it writes \expandafter\endgroup\x. This could also be written as \x\endgroup and save the \expandafter. In the minimal I provided works both ways. Am I missing something?
expandafteralso makes perfect sense. Did try it out and is exactly as you say. Perfect answer on all counts. – yannisl Nov 30 '10 at 20:17\romannumeralto see another case of this. I guess that the source for TeX will give more detail on the decision, but I suspect it's to ensure that the tokens don't accidentally end up as part of a preceding control sequence (if there is some\expandafterstuff on the go). – Joseph Wright Nov 30 '10 at 20:21bpin the same vein. – Joseph Wright Dec 21 '12 at 13:16\__dim_strip_bp:nto get the numerical dim value in big points withoutbpunit? [This is actually what I need in one of my packages (media9).] – AlexG Dec 21 '12 at 13:23\dim_strip_bp:nand\dim_strip_pt:nor even\dim_strip_in:n,\dim_strip_cm:netc. would be highly welcome as public functions. – AlexG Dec 21 '12 at 13:26