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 whi
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 tim
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 m
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{
> > > >
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 17\str
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
> >
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
\the\test
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