🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #2142

Re: want full evaluation like \edef

#2142
From: Donald Arseneau
Date: Thu, 13 Aug 1992 05:53
31 lines
1900 bytes
In article <1992Aug12.163437.12527@news.cs.indiana.edu>, edrbtsn@bigeye.cs.indiana.edu (Ed Robertson) writes...
>The primitive command \edef expands its second arguement before
>assigning it (as a macro definition) to its first arguement.
>However, primitive commands inside the second arguement are not
>executed.
> 
>What I want is a \fulledef, so that
>	\fulledef\temp{\libmac}
>fully evaluates \libmac before assigning it to \temp.  There are obvious
>problems specifying how far to evaluate, so such a \fulledef would
>need to be used with care.

Yes there are obvious problems.  You can make TeX so several levels of
evaluation:

o No evaluation or expansion
o Single expansion to get top-level definitions (can only be applied easily
  to single commands, not to arbitrary token lists)
o Complete expansion without processing of unexpandable tokens.  Since
  assignments are unexpandable they are not processed.
o Complete evaluation of tokens to produce a `list'.  If you want anything
  more than expansion, this is the only option.  Here is how to do it:

Instead of \fulldef\temp{\libmac}, use
\setbox\temp\hbox{\libmac}  % or \vbox

And to use \temp, use \unhbox\temp or \unvbox\temp.

If that isn't what you need, you will probably have to reevaluate your needs.

Donald Arseneau             asnd@reg.triumf.ca
Technical Details
Message-ID: <12AUG199222530854@msr.triumf.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!sol.ctr.columbia.edu!destroyer!ubc-cs!unixg.ubc.ca!msr.triumf.ca!asnd
References: <1992Aug12.163437.12527@news.cs.indiana.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.text.tex
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!sol.ctr.columbia.edu!destroyer!ubc-cs!unixg.ubc.ca!msr.triumf.ca!asnd
From: asnd@msr.triumf.ca (Donald Arseneau)
Subject: Re: want full evaluation like \edef
Message-ID: <12AUG199222530854@msr.triumf.ca>
News-Software: VAX/VMS VNEWS 1.41    
Sender: news@unixg.ubc.ca (Usenet News Maintenance)
Nntp-Posting-Host: msr.triumf.ca
Organization: TRIUMF: Tri-University Meson Facility
References: <1992Aug12.163437.12527@news.cs.indiana.edu>
Date: Thu, 13 Aug 1992 05:53:00 GMT
Lines: 31