Re: [NTG-context] protected macro vs protected luacall

2023-01-27 Thread Hans Hagen via ntg-context
On 1/27/2023 12:03 PM, Henri Menke via ntg-context wrote: How much do you think would break if protected luacall were treated like protected macros after \the in the engine? That kind of incompatibility is no option (I'm not going to analyze it for mkiv let along other macro package usage

Re: [NTG-context] protected macro vs protected luacall

2023-01-27 Thread Henri Menke via ntg-context
On Fri, 2023-01-27 at 11:01 +0100, Hans Hagen via ntg-context wrote: > On 1/27/2023 10:35 AM, Henri Menke via ntg-context wrote: > > > Thanks, this is indeed the workaround that I currently use. > > However, > > the downside is that this has to tokenize the contents of > > \directlua > > every

Re: [NTG-context] protected macro vs protected luacall

2023-01-27 Thread Hans Hagen via ntg-context
On 1/27/2023 10:35 AM, Henri Menke via ntg-context wrote: Thanks, this is indeed the workaround that I currently use. However, the downside is that this has to tokenize the contents of \directlua every time (and is therefore susceptible to surrounding \catcode shenanigans) and it expands in at

Re: [NTG-context] protected macro vs protected luacall

2023-01-27 Thread Henri Menke via ntg-context
On Fri, 2023-01-27 at 10:30 +0100, Hans Hagen via ntg-context wrote: > On 1/27/2023 10:13 AM, Henri Menke via ntg-context wrote: > > On Thu, 2023-01-26 at 23:07 +0100, Hans Hagen via ntg-context > > wrote: > > > On 1/26/2023 9:33 PM, Henri Menke via ntg-context wrote: > > > > \directlua{ > > > >

Re: [NTG-context] protected macro vs protected luacall

2023-01-27 Thread Hans Hagen via ntg-context
On 1/27/2023 10:13 AM, Henri Menke via ntg-context wrote: On Thu, 2023-01-26 at 23:07 +0100, Hans Hagen via ntg-context wrote: On 1/26/2023 9:33 PM, Henri Menke via ntg-context wrote: \directlua{ userdata = userdata or {} function userdata.test() tex.print("\string\\numexpr

Re: [NTG-context] protected macro vs protected luacall

2023-01-27 Thread Henri Menke via ntg-context
On Thu, 2023-01-26 at 23:07 +0100, Hans Hagen via ntg-context wrote: > On 1/26/2023 9:33 PM, Henri Menke via ntg-context wrote: > > \directlua{ > >userdata = userdata or {} > >function userdata.test() > > tex.print("\string\\numexpr 17\string\\relax") > >end > > } > > > > \tt > >

Re: [NTG-context] protected macro vs protected luacall

2023-01-26 Thread Hans Hagen via ntg-context
On 1/26/2023 9:33 PM, Henri Menke via ntg-context wrote: \directlua{ userdata = userdata or {} function userdata.test() tex.print("\string\\numexpr 17\string\\relax") end } \tt \protected\def\test{\directlua{userdata.test()}} \meaning\test\par \edef\x{\test}\meaning\x\par

[NTG-context] protected macro vs protected luacall

2023-01-26 Thread Henri Menke via ntg-context
Dear list, I have noticed a somewhat strange difference between protected macros and protected luacalls, namely that the latter cannot be expanded by \the. In the example below I define a Lua function that prints \numexpr 17\relax to the token stream and I call it once from a protected TeX macro