Is \toksapp assignment?
Hello, If I try: \def\test{test} \afterassignment\test \advance\count0 by2 then \test is processed immediately after the \advance command. But if I do: \afterassignment\test \toksapp 0{xx} \the\toks0 then \test waits to another assignment than \toksapp. It means, that \toksapp <toks> (and friends \gtoksapp etc.) is not assignment. Is it an intention or a bug? Petr Olšák
On 2/5/2022 11:43 AM, Petr Olsak wrote:
Hello,
If I try:
\def\test{test}
\afterassignment\test \advance\count0 by2
then \test is processed immediately after the \advance command. But if I do:
\afterassignment\test \toksapp 0{xx} \the\toks0
then \test waits to another assignment than \toksapp. It means, that \toksapp <toks> (and friends \gtoksapp etc.) is not assignment. Is it an intention or a bug? it's intention ... these prepend and append things are a command class on their own which is why we have explicit g and x variants
Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On 2/5/22 12:08 PM, Hans Hagen wrote:
On 2/5/2022 11:43 AM, Petr Olsak wrote:
Hello,
If I try:
\def\test{test}
\afterassignment\test \advance\count0 by2
then \test is processed immediately after the \advance command. But if I do:
\afterassignment\test \toksapp 0{xx} \the\toks0
then \test waits to another assignment than \toksapp. It means, that \toksapp <toks> (and friends \gtoksapp etc.) is not assignment. Is it an intention or a bug? it's intention ... these prepend and append things are a command class on their own which is why we have explicit g and x variants
I respect the intention but I don't understand your argument. The \def is a command on its own too, it has explicit g and x variants and _it is_ assignment. After \tracingall we can see {changing \toks0=} {into \toks0=xx} which is similar report as {changing \m=undefined} {into \m=macro:-> xx} when \def\m{xx} is traced. Petr
On 2/5/22 12:08 PM, Hans Hagen wrote:
On 2/5/2022 11:43 AM, Petr Olsak wrote:
Hello,
If I try:
\def\test{test}
\afterassignment\test \advance\count0 by2
then \test is processed immediately after the \advance command. But if I do:
\afterassignment\test \toksapp 0{xx} \the\toks0
then \test waits to another assignment than \toksapp. It means, that \toksapp <toks> (and friends \gtoksapp etc.) is not assignment. Is it an intention or a bug? it's intention ... these prepend and append things are a command class on their own which is why we have explicit g and x variants
I respect the intention but I don't understand your argument. The \def is a command on its own too, it has explicit g and x variants and _it is_ assignment.
After \tracingall we can see {changing \toks0=} {into \toks0=xx} which is similar report as {changing \m=undefined} {into \m=macro:-> xx} when \def\m{xx} is traced.
On 2/5/2022 12:19 PM, Petr Olsak wrote: this append and prepend mechanism started out as an experiment and it has some nasty pitfalls (esp when local and global get mixed) so that is why it has its own handler in luametatex it's a bit different but there i can test what happens when the non prefixed variant is also added (but for different reasons) to the prefixed handler where afterassignment is handled but it would anyway be an incompatible change to luatex so be delayed to after the upcoming code freeze (it might also have a little performance hit) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On 2022-02-05 13:48, Hans Hagen wrote:
this append and prepend mechanism started out as an experiment and it has some nasty pitfalls (esp when local and global get mixed) so that is why it has its own handler
Bug related to this: prefixing \toksapp and similar gives a Fatal error, where I would expect either that it works, or errors with "You can't use a prefix with \toksapp". (Here I'm removing unrelated lines in the output.) $ luatex '\global\toksapp' This is LuaTeX, Version 1.13.2 (TeX Live 2021) ! This can't happen (prefix). <*> \global\toksapp ! ==> Fatal error occurred, no output PDF file produced! Bruno
On 2022-02-05 13:48, Hans Hagen wrote:
this append and prepend mechanism started out as an experiment and it has some nasty pitfalls (esp when local and global get mixed) so that is why it has its own handler
Bug related to this: prefixing \toksapp and similar gives a Fatal error, where I would expect either that it works, or errors with "You can't use a prefix with \toksapp". (Here I'm removing unrelated lines in the output.)
$ luatex '\global\toksapp' This is LuaTeX, Version 1.13.2 (TeX Live 2021) ! This can't happen (prefix). <*> \global\toksapp ! ==> Fatal error occurred, no output PDF file produced!
On 2/5/2022 2:35 PM, Bruno Le Floch wrote: that can be fixed Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On Sat, Feb 5, 2022 at 3:05 PM Hans Hagen
On 2022-02-05 13:48, Hans Hagen wrote:
this append and prepend mechanism started out as an experiment and it has some nasty pitfalls (esp when local and global get mixed) so that is why it has its own handler
Bug related to this: prefixing \toksapp and similar gives a Fatal error, where I would expect either that it works, or errors with "You can't use a prefix with \toksapp". (Here I'm removing unrelated lines in the output.)
$ luatex '\global\toksapp' This is LuaTeX, Version 1.13.2 (TeX Live 2021) ! This can't happen (prefix). <*> \global\toksapp ! ==> Fatal error occurred, no output PDF file produced!
On 2/5/2022 2:35 PM, Bruno Le Floch wrote: that can be fixed
Fixed in rev. 7489. -- luigi
participants (4)
-
Bruno Le Floch
-
Hans Hagen
-
luigi scarso
-
Petr Olsak