29.05.2014 Views

The history of luaTEX 2006–2009 / v 0.50 - Pragma ADE

The history of luaTEX 2006–2009 / v 0.50 - Pragma ADE

The history of luaTEX 2006–2009 / v 0.50 - Pragma ADE

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Collecting tokens can take place inside the callback but also outside. This also gives you<br />

the opportunity to collect them in efcient ways and keep an eye on the memory demands.<br />

Of course using TEX directly takes less code:<br />

\def\SwapChars#1#2{#2#1}<br />

<strong>The</strong> example shown here involves so little tokens that running it takes no noticeable time.<br />

Here we show this denition in tokenized form:<br />

cmd chr id name<br />

def 0 706 def<br />

undefined_cs 0 636553 SwapChars<br />

mac_param 35<br />

other_char 49 1<br />

mac_param 35<br />

other_char 50 2<br />

left_brace 123<br />

mac_param 35<br />

other_char 50 2<br />

mac_param 35<br />

other_char 49 1<br />

right_brace 125<br />

64 How about performance

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!