different side-effects in programming-examples?
- From: "Norman Yates" <yates@xxxxxxxxxxxxxx>
- Date: Mon, 18 Jul 2005 08:54:15 +0200
Hello!
I created two minimal examples which - according
to my understanding - lead to the same result:
The macro "\hello" is globally redefined by the
the macro "\tempa". After that "\tempa" regains
"undefined"-status.
Is this true? If not: Where do the results differ from
each other and/or from the description given above?
Which differences in "side-effects" might occur?
In what situations might these differences get
relevance?
The programming-style of which example can be
considered more elegant - why?
Example 1:
\def\hello{Something to be overridden}%
\begingroup
\def\tempa{\def\hello{Hello\thinspace!}}%
\expandafter\endgroup\tempa
\show\hello
\show\tempa
\bye
Example 2:
\def\hello{Something to be overridden}%
\def\tempa{\def\hello{Hello\thinspace!}}%
\tempa
\let\tempa\undefined
\show\hello
\show\tempa
\bye
Many thanks.
Sincerely
Norman
.
- Follow-Ups:
- Re: different side-effects in programming-examples?
- From: Donald Arseneau
- Re: different side-effects in programming-examples?
- From: Ulrich M. Schwarz
- Re: different side-effects in programming-examples?
- Prev by Date: Re: Multicolumns and floating bodies
- Next by Date: LaTeX also for curriculum vitae ?
- Previous by thread: Multicolumns and floating bodies
- Next by thread: Re: different side-effects in programming-examples?
- Index(es):
Relevant Pages
|