LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

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

Print Reply
Subject:
From:
Joachim Schrod <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Mon, 14 Nov 2005 18:57:09 +0100
Content-Type:
text/plain
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\a[1]{f1\b{#1}}
    \newcommand\b[2]{\par #2 #1}

and an input of

    ab\a12

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.

	Joachim

[*] 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

ATOM RSS1 RSS2