Re: [NTG-context] An interesting default for recurselevel in xetex

2009-08-23 Thread Hans Hagen

Aditya Mahajan wrote:

Hi,

Guess what happens when you run this with xetex

\starttext\recurselevel\stoptext

This is a side effect of the definition of \dofastrecurse. After using 
\dofastrecurse, the default value of recurselevel is 
\number\fastrecursecounter rather than 0. I don't think that this will 
have any side effects.


no, it's just the last value; of course i can set it to zero

recurselevel is also known inside \doloop so there it makes sense to 
have it afterrwards (or when using \exitloop in any case)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | 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 : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] An interesting default for recurselevel in xetex

2009-08-23 Thread Aditya Mahajan

On Sun, 23 Aug 2009, Hans Hagen wrote:


Aditya Mahajan wrote:

Hi,

Guess what happens when you run this with xetex

\starttext\recurselevel\stoptext

This is a side effect of the definition of \dofastrecurse. After using 
\dofastrecurse, the default value of recurselevel is 
\number\fastrecursecounter rather than 0. I don't think that this will have 
any side effects.


no, it's just the last value; of course i can set it to zero


recurselevel is also known inside \doloop so there it makes sense to have it 
afterrwards (or when using \exitloop in any case)


Both \dorecurse and \doloop leave the value of \recurselevel to its 
previous value. \dofastrecurse does not and sets it to the last value.


\starttext
\recurselevel

\dorecurse{6}{Hello }
\recurselevel

\doloop{\ifnum\recurselevel6\relax \exitloop\else again  \fi}
\recurselevel

\dofastrecurse{1}{6}{1}{and again}
\recurselevel
\stoptext

I do not think that any change is needed (One shouldn't use \recurselevel 
outside a recursion macro anyways). I was just surprised to find that 
recurselevel was defaulting to such a weird value in xetex.


Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] An interesting default for recurselevel in xetex

2009-08-23 Thread Hans Hagen

Aditya Mahajan wrote:

I do not think that any change is needed (One shouldn't use 
\recurselevel outside a recursion macro anyways). I was just surprised 
to find that recurselevel was defaulting to such a weird value in xetex.


also in luatex but that will probably change once we have more direct 
access at the lua end


anyhow, here's teh way out

\def\dodofastrecurse
  {\ifnum\fastrecursecounter\lastrecursecounter
 \let\recurselevel\!!zerocount
   \else
 \fastrecursebody
 \advance\fastrecursecounter\steprecursecounter
 \expandafter\dodofastrecurse
   \fi}


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | 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 : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___