ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \doglobal\settrue/\setfalse
@ 2001-07-30 14:21 Giuseppe Bilotta
  2001-07-30 14:42 ` \doglobal\settrue/\setfalse Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Giuseppe Bilotta @ 2001-07-30 14:21 UTC (permalink / raw)


Hello,

studying a visible bug in my 2001.7.11 ConTeXt I discovered that

\doglobal\settrue
and
\doglobal\setfalse

do *not* set true/false globally, but only locally.

Substituting them with they alleged come-out:
\global\chardef\command=0
and
\global\chardef\command=1
does work.

Any ideas on the reason why?

(The bug appeared in the speech stuff, btw. Don't know if it is
apparent with other commands.)

Giuseppe "Oblomov" Bilotta


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: \doglobal\settrue/\setfalse
  2001-07-30 14:21 \doglobal\settrue/\setfalse Giuseppe Bilotta
@ 2001-07-30 14:42 ` Hans Hagen
  2001-07-31  6:56   ` Re[2]: \doglobal\settrue/\setfalse Giuseppe Bilotta
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2001-07-30 14:42 UTC (permalink / raw)
  Cc: ntg-context

At 04:21 PM 7/30/2001 +0200, Giuseppe Bilotta wrote:
>Hello,
>
>studying a visible bug in my 2001.7.11 ConTeXt I discovered that
>
>\doglobal\settrue
>and
>\doglobal\setfalse
>
>do *not* set true/false globally, but only locally.
>
>Substituting them with they alleged come-out:
>\global\chardef\command=0
>and
>\global\chardef\command=1
>does work.
>
>Any ideas on the reason why?

\settrue and setfalse are rather primitive commands, i.e. chardefs

\doglobal is used for some commands for which the global assignment is to b 
eapplied somewhere in the middle of the macro def or multiple times; since 
\doglobal is meant for experts, i assume that they peek into the code of 
syst-* macros to see where it is applicable: dodoglobal, redoglobal, 
resetglobal are its low low low level companions

Hans

-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re[2]: \doglobal\settrue/\setfalse
  2001-07-30 14:42 ` \doglobal\settrue/\setfalse Hans Hagen
@ 2001-07-31  6:56   ` Giuseppe Bilotta
  2001-07-31  7:24     ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Giuseppe Bilotta @ 2001-07-31  6:56 UTC (permalink / raw)
  Cc: ntg-context

Monday, July 30, 2001 Hans Hagen wrote:

HH> \settrue and setfalse are rather primitive commands, i.e. chardefs

HH> \doglobal is used for some commands for which the global assignment is to b 
HH> eapplied somewhere in the middle of the macro def or multiple times; since 
HH> \doglobal is meant for experts, i assume that they peek into the code of 
HH> syst-* macros to see where it is applicable: dodoglobal, redoglobal, 
HH> resetglobal are its low low low level companions

So \settrue and \setfalse have to be precede by \global and
not \doglobal?

Giuseppe "Oblomov" Bilotta


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re[2]: \doglobal\settrue/\setfalse
  2001-07-31  6:56   ` Re[2]: \doglobal\settrue/\setfalse Giuseppe Bilotta
@ 2001-07-31  7:24     ` Hans Hagen
  2001-07-31  8:00       ` Re[3]: \doglobal\settrue/\setfalse Giuseppe Bilotta
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2001-07-31  7:24 UTC (permalink / raw)
  Cc: ntg-context

At 08:56 AM 7/31/2001 +0200, Giuseppe Bilotta wrote:

>Monday, July 30, 2001 Hans Hagen wrote:
>
>HH> \settrue and setfalse are rather primitive commands, i.e. chardefs
>
>HH> \doglobal is used for some commands for which the global assignment is 
>to b
>HH> eapplied somewhere in the middle of the macro def or multiple times; 
>since
>HH> \doglobal is meant for experts, i assume that they peek into the code of
>HH> syst-* macros to see where it is applicable: dodoglobal, redoglobal,
>HH> resetglobal are its low low low level companions
>
>So \settrue and \setfalse have to be precede by \global and
>not \doglobal?

right, they are hash efficient alternatives for \newif cum suis

\newconditional\iunderstand
\ifconditional\iunderstand
\settrue\iunderstand
\setfalse\iunderstand

since \ifconditional is just a \ifcase it works in nested if's; think about 
it: tex lacks a type declaration \ifdef\blabla where \blabla is a scanner 
recognized if [this wish as never honored by *tex dev, so maybe something 
for texlib -)]

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re[3]: \doglobal\settrue/\setfalse
  2001-07-31  7:24     ` Hans Hagen
@ 2001-07-31  8:00       ` Giuseppe Bilotta
  0 siblings, 0 replies; 5+ messages in thread
From: Giuseppe Bilotta @ 2001-07-31  8:00 UTC (permalink / raw)
  Cc: ntg-context

Tuesday, July 31, 2001 Hans Hagen wrote:

>>
>>So \settrue and \setfalse have to be precede by \global and
>>not \doglobal?

HH> right, they are hash efficient alternatives for \newif cum suis

core-mis.tex has \doglobal before \settrue and \setfalse in the
speech handling macros. You might consider fixing this ;-)

Giuseppe "Oblomov" Bilotta


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-07-31  8:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-30 14:21 \doglobal\settrue/\setfalse Giuseppe Bilotta
2001-07-30 14:42 ` \doglobal\settrue/\setfalse Hans Hagen
2001-07-31  6:56   ` Re[2]: \doglobal\settrue/\setfalse Giuseppe Bilotta
2001-07-31  7:24     ` Hans Hagen
2001-07-31  8:00       ` Re[3]: \doglobal\settrue/\setfalse Giuseppe Bilotta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).