How does \detokenize work?
The e-TeX Short Reference Manual states:
When followed by a
<general text>, expands to yield a sequence of character tokens of\catcode10 (space) or 12 (other) corresponding to a decomposition of the tokens of the<balanced text>of the unexpanded<general text>; c.f.\showtokens. The effect is rather as if\scantokensapplied to the<general text>within a régime in which only\catcodes10 and 12 existed. Note that in order to preserve the boundaries between control words and any following letter, a space is yielded after each control word including the last.
What does that mean in plain English? I want to understand this snippet of code:
\def\task#1{\@task#1::\@nil}
\def\@task#1:#2:#3\@nil{%
\if\relax\detokenize{#2}\relax
...
I think that \task is defined as a macro taking one argument which calls \@task. I don't know what \@nil means -- it is probably used to end the macro call. I also don't know what \relax and \detokenize do, but detokenize takes the second part of the argument for the task macro (the parts are separated with semicolons).
- Why are arguments for
::.
- Will
– ipavlic Jun 06 '11 at 14:50\@tasksplit like that?xyz+AB+cdeorxyz+AB:cde+uorxyz+AB+cde:uall seem to satisfy\detokenizesplit\relaxinto\relax?\@nil. 2. Yes. – egreg Jun 06 '11 at 14:57cde:uinstead ofuas written in the answer? This should not be nitpicking, I am really not sure enough to edit it. If I am wrong, please explain why. – Patrick Häcker Oct 09 '12 at 17:19