home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.text.tex
- Path: sparky!uunet!pipex!warwick!pavo.csi.cam.ac.uk!camcus!cet1
- From: cet1@cus.cam.ac.uk (C.E. Thompson)
- Subject: re: question about parsing numbers
- Message-ID: <1993Jan9.222907.8717@infodev.cam.ac.uk>
- Sender: news@infodev.cam.ac.uk (USENET news)
- Nntp-Posting-Host: apus.cus.cam.ac.uk
- Organization: U of Cambridge, England
- References: <726603701.528921.BNB@MATH.AMS.ORG>
- Date: Sat, 9 Jan 1993 22:29:07 GMT
- Lines: 29
-
- In article <726603701.528921.BNB@MATH.AMS.ORG>, BNB@MATH.AMS.ORG (bbeeton) writes:
- |>
- |> take a simpler example:
- |> \newcount\num
- |> \def\newnum#1#2.{\num=#1 \def\rest{#2}}
- |> \newnum12345.
- |> this will end up with \num=12345 and \rest empty (with a delimited
- |> string, the part between delimiters need not contain anything).
-
- Ahem. No it won't. The splitting into '1' and '2345' occurs at macro
- argument parsing time, and is no different for this fragment than in
- the one you give later:
-
- |> \newcount\num
- |> \def\newnum#1#2.{\def\xnum{#1}\num=\xnum \def\rest{#2}}
- |> \newnum12345.
-
- You are thinking of some case when the assignment is seeing the whole
- string of digits and will gobble as many as it can, e.g.
-
- \newcount\num
- \def\newnum{\afterassignment\newnumrest \num=}
- \def\newnumrest#1.{\def\rest{#1}}
- \newnum12345.
-
- Chris Thompson
- Cambridge University Computing Service
- JANET: cet1@uk.ac.cam.phx
- Internet: cet1@phx.cam.ac.uk
-