* An interesting default for recurselevel in xetex
@ 2009-08-23 7:04 Aditya Mahajan
2009-08-23 10:54 ` Hans Hagen
0 siblings, 1 reply; 4+ messages in thread
From: Aditya Mahajan @ 2009-08-23 7:04 UTC (permalink / raw)
To: mailing list for ConTeXt users
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
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: An interesting default for recurselevel in xetex
2009-08-23 7:04 An interesting default for recurselevel in xetex Aditya Mahajan
@ 2009-08-23 10:54 ` Hans Hagen
2009-08-23 19:56 ` Aditya Mahajan
0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2009-08-23 10:54 UTC (permalink / raw)
To: mailing list for ConTeXt users
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: An interesting default for recurselevel in xetex
2009-08-23 10:54 ` Hans Hagen
@ 2009-08-23 19:56 ` Aditya Mahajan
2009-08-23 21:44 ` Hans Hagen
0 siblings, 1 reply; 4+ messages in thread
From: Aditya Mahajan @ 2009-08-23 19:56 UTC (permalink / raw)
To: mailing list for ConTeXt users
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
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: An interesting default for recurselevel in xetex
2009-08-23 19:56 ` Aditya Mahajan
@ 2009-08-23 21:44 ` Hans Hagen
0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2009-08-23 21:44 UTC (permalink / raw)
To: mailing list for ConTeXt users
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-08-23 21:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-23 7:04 An interesting default for recurselevel in xetex Aditya Mahajan
2009-08-23 10:54 ` Hans Hagen
2009-08-23 19:56 ` Aditya Mahajan
2009-08-23 21:44 ` Hans Hagen
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).