Path: utzoo!utgpu!watserv1!watmath!att!att!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!ux1.cso.uiuc.edu!csrd.uiuc.edu!s41.csrd.uiuc.edu!eijkhout From: eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) Newsgroups: comp.text.tex Subject: Re: letA=3 edefB{A} does not put 3 into B ????? Message-ID: <1990Nov23.200527.17577@csrd.uiuc.edu> Date: 23 Nov 90 20:05:27 GMT References: <1990Nov22.001531.7022@zaphod.mps.ohio-state.edu> Sender: news@csrd.uiuc.edu (news) Organization: UIUC Center for Supercomputing Research and Development Lines: 30 eao@shape.mps.ohio-state.edu (Ed Overman) writes: >I want to do > \let\A=3 \edef\B{\A} >and have \B contain 3. \let is a very strange thing. It makes a control sequence to a synonym for a token, which can be a control sequence token, or a character token. Note: a synonym, not a definition that has to be expanded. Thus in \edef\B{\A} the \A is not expanded, because there is nothing to expand; \A *is* already a charcter. For instance \if 3\A is true! However, you cannot get at for instance the Ascii code of the character that is \A: `\A is 65, which is Ascii for 'A'. >The only solution I have found is to use \meaning\A since the third word the output of \meaning\A is `the character 3'. I'm afraid I can't do any better than this. But do you need to do it this way? What is wrong with \def\GetOneLetter#1{ ... } ? This works at least for all letters and digits, tho' not for things like braces, and unfortunately also not for spaces. You can distinguish between a lot of tokens if you have \let\A, using \ifcat. For instance, '\ifcat a\A' will be true if \A has been let to a letter. Victor.