LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Classic View

Use Monospaced Font
Show HTML Part by Default
Condense Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
Date: Mon, 14 Nov 2005 18:57:09 +0100
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
In-Reply-To: <[log in to unmask]>
Content-Type: text/plain; charset=us-ascii
From: Joachim Schrod <[log in to unmask]>
Parts/Attachments: text/plain (53 lines)
>>>>> "WR" == Will Robertson <[log in to unmask]> writes:

WR> The token stream won't change retrospectively, so in theory it
WR> should be able to be examined.

But it does change. That's the whole point of macros, to change the
token stream.

With a definition of 

    \newcommand\b[2]{\par #2 #1}

and an input of


this results in the following token stream [*]

    (char "a") (char "b") (cseq "a") (other "1") (other "2")

which is in turn transformed into the token stream

    (char "a") (char "b") (cseq "b") (bgroup "{") (other "1")
    (egroup "}") (other "2")

and then into the token stream

    (char "a") (char "b") (cseq "par") (other "2") (other "1")

Which of those do you want to keep? There are good arguments for all
of them.


[*] The notation per token is (TOKEN-TYPE NAME), where the token types
are hopefully self-explained. Please note that TOKEN-TYPE is not
identical to catcodes, as catcodes are attributes of input characters
for configuration of lexical analysis (aka scanning), and not
attributes of tokens (which are the result of the scan process). There
are some catcodes that have a one-to-one mapping to token types, of
course, when the token is created from one input char according to
that catcode.

Joachim Schrod					Email: [log in to unmask]
Roedermark, Germany

	``How do we persuade new users that spreading fonts across the page
	like peanut butter across hot toast is not necessarily the route to
	typographic excellence?''			-- Peter Flynn