different side-effects in programming-examples?



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


.



Relevant Pages

  • Re: different side-effects in programming-examples?
    ... > to my understanding - lead to the same result: ... > The macro "\hello" is globally redefined by the ... so it may not regain anything. ... Prev by Date: ...
    (comp.text.tex)
  • Re: different side-effects in programming-examples?
    ... > to my understanding - lead to the same result: ... > The macro "\hello" is globally redefined by the ... Ulrich ... Prev by Date: ...
    (comp.text.tex)
  • Re: You know what makes me laugh....?
    ... >> It's called being a real football fan. ... I suspected you would be incapable of understanding the concept. ... you talk more bollox than Poopex and Norman and Bernie rolled into ... Prev by Date: ...
    (uk.sport.football.clubs.liverpool)
  • Re: Remove all manual page breaks
    ... Regards, ... Norman ... > I'm looking for help with using a macro to insert page breaks and am ... Prev by Date: ...
    (microsoft.public.excel.programming)
  • Re: Macro to view Print dialog box
    ... Regards, ... Norman ... > I need to use a macro to bring up the same dialog box that appears when ... Prev by Date: ...
    (microsoft.public.excel.programming)