home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / text / tex / 14788 < prev    next >
Encoding:
Text File  |  1993-01-09  |  1.4 KB  |  42 lines

  1. Newsgroups: comp.text.tex
  2. Path: sparky!uunet!pipex!warwick!pavo.csi.cam.ac.uk!camcus!cet1
  3. From: cet1@cus.cam.ac.uk (C.E. Thompson)
  4. Subject: re: question about parsing numbers
  5. Message-ID: <1993Jan9.222907.8717@infodev.cam.ac.uk>
  6. Sender: news@infodev.cam.ac.uk (USENET news)
  7. Nntp-Posting-Host: apus.cus.cam.ac.uk
  8. Organization: U of Cambridge, England
  9. References: <726603701.528921.BNB@MATH.AMS.ORG>
  10. Date: Sat, 9 Jan 1993 22:29:07 GMT
  11. Lines: 29
  12.  
  13. In article <726603701.528921.BNB@MATH.AMS.ORG>, BNB@MATH.AMS.ORG (bbeeton) writes:
  14. |> 
  15. |> take a simpler example:
  16. |>     \newcount\num
  17. |>     \def\newnum#1#2.{\num=#1 \def\rest{#2}}
  18. |>     \newnum12345.
  19. |> this will end up with \num=12345 and \rest empty (with a delimited
  20. |> string, the part between delimiters need not contain anything).
  21.  
  22. Ahem. No it won't. The splitting into '1' and '2345' occurs at macro
  23. argument parsing time, and is no different for this fragment than in
  24. the one you give later:
  25.  
  26. |>     \newcount\num
  27. |>     \def\newnum#1#2.{\def\xnum{#1}\num=\xnum \def\rest{#2}}
  28. |>     \newnum12345.
  29.  
  30. You are thinking of some case when the assignment is seeing the whole
  31. string of digits and will gobble as many as it can, e.g.
  32.  
  33.        \newcount\num
  34.        \def\newnum{\afterassignment\newnumrest \num=}
  35.        \def\newnumrest#1.{\def\rest{#1}}
  36.        \newnum12345.
  37.  
  38. Chris Thompson
  39. Cambridge University Computing Service
  40. JANET:    cet1@uk.ac.cam.phx
  41. Internet: cet1@phx.cam.ac.uk
  42.