# [Dev-luatex] Assignments in runtoks

Hans Hagen j.hagen at xs4all.nl
Sun Sep 1 23:28:58 CEST 2019

On 9/1/2019 3:39 PM, Marcel Fabian Krüger wrote:
>>> fixed in next luatex but in a different way as we then also need to
>>> support deeper nesting
>>>
>>> \toks2{\def\deepermacro{deeper}}
>>>
>>> \toks0{\def\innermacro{inner}\def\deepermacro{weird}\directlua{tex.runtoks(2)}}
>>>
>>> \edef\outermacro{outer\directlua{tex.runtoks(0)}}
>>>
>>> \meaning\innermacro \par
>>> \meaning\deepermacro\par
>>> \meaning\outermacro \par
>>>
>>>
>>
>> done
>> ------------------------------------------------------------------------
>> r7186 | luigi.scarso at gmail.com | 2019-09-01 15:25:05 +0200 (Sun, 01 Sep
>> 2019) | 1 line
>>
>> permit nested runtoks in more complex situations of nesting (HH)
>> ------------------------------------------------------------------------
>
> Awesome, thank you.
> One further question out of academic interest: What was the problem with
> my former proposed fix? It seems to give the right result in your example
> and I currently can't see why it would have problems with nesting.
It's more a matter of symmetry ... to have it in the end_local handler
so that it happens at the same level. (Ok, I could change that but first
I need to ponder other side effects like node being produced when in an
edef. I knew that was an issue and could live with that because of
chicken-egg issues, but still. Maybe some variants in due time. Low
priority stuff.)

Hans

-----------------------------------------------------------------