On 5/22/2016 10:07 AM, Meer, Hans van der wrote:

On 26 Jun 2014, at 12:08, Hans Hagen <[email protected]> wrote:

Another addition is that

\definemode[something][keep]

define an undefined mode; the keep makes sure that the already set value is 
kept (another option is 'yes').

Using defined modes (that is, set with: \enablemode, \disablemode or 
\definemode) can be tested about twice as fast as undefined modes which can 
make a small difference


I do not understand this fully:
- if the mode is undefined, how can "define an undefined mode" for a mode that has 
already been given a value with either \enablemode or \disablemode keep a value? Must not 
\enablemode, \disablemode do some sort of 'defining' in order to facilitate testing? Does 
"define" here implements some other mechanism than the 'defining' done by \enablemod, 
\disablemode?

it's more an internal issue. less checking at the tex end and so .. it's only relevant when you check modes tens of thousands of times in a run

Is this what happens:
- if \enablemode or \disablemode has been used before to set a value for the 
mode, than \definemode[themode][keep] stashes some special definition of that 
mode and does not change c.q. transfers its value;
- \definemode[themode][yes] and \definemode[themode][no] always set that value 
for the mode in case, regardless of what has been done by a preceding 
\enablemode or \disablemode.

Is that the correct interpretation? Just to make sure I understand.

Finally, when \definemode makes testing a lot faster why than not implement 
this always? That is, using \enablemode or \disablemode the first time implies 
a \definemode for that mode. Doing so avoids another macro to remember: less 
clutter for my brain ;-)

because one property of modes is that one doesn't have to define them, you'd be quite unhappy if you would have to define all possible modes that could be introduced in styles

Hans


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to