An interesting default for recurselevel in xetex
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. Aditya
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 -----------------------------------------------------------------
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\recurselevel>6\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
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 -----------------------------------------------------------------
participants (2)
-
Aditya Mahajan
-
Hans Hagen