Re: [NTG-context] Writing to .tuc directly from Lua

2021-03-24 Thread Jairo A. del Rio
El mié, 24 de mar. de 2021 a la(s) 16:47, Hans Hagen (j.ha...@xs4all.nl) escribió: > On 3/24/2021 6:33 PM, Jairo A. del Rio wrote: > > Hi, Hans. Here's my (miserably failing) attempt: > > > > \definedataset[nicedata] > > > > \starttext > > > > \startluacode > > > > local name = "nicedata" > > > >

Re: [NTG-context] Writing to .tuc directly from Lua

2021-03-24 Thread Hans Hagen
On 3/24/2021 6:33 PM, Jairo A. del Rio wrote: Hi, Hans. Here's my (miserably failing) attempt: \definedataset[nicedata] \starttext \startluacode local name = "nicedata" -- For exposition only local function dofactorial(n) local function inner(c,m) if m<2 then return c end return

Re: [NTG-context] Writing to .tuc directly from Lua

2021-03-24 Thread Jairo A. del Rio
No, no actually. I only put a toy example. What I need to solve is related with storing data in the .tuc file when processes take a long time. Memoization doesn't work as data is lost with each new run. Jairo El mié, 24 de mar. de 2021 a la(s) 15:36, Aditya Mahajan (adit...@umich.edu) escribió:

Re: [NTG-context] Writing to .tuc directly from Lua

2021-03-24 Thread Jairo A. del Rio
Hi, Hans. Here's my (miserably failing) attempt: \definedataset[nicedata] \starttext \startluacode local name = "nicedata" -- For exposition only local function dofactorial(n) local function inner(c,m) if m<2 then return c end return inner(c*m, m-1) end return inner(1,n) end local

Re: [NTG-context] Writing to .tuc directly from Lua

2021-03-24 Thread Hans Hagen
On 3/24/2021 5:20 AM, Jairo A. del Rio wrote: Thank you very much. It's useful, indeed. However, what I need is to bypass TeX (Lua > .tuc) if possible, since all the data I need to handle is generated with Lua scripts. datasets-001.tex in the test suite

Re: [NTG-context] Writing to .tuc directly from Lua

2021-03-23 Thread Jairo A. del Rio
Thank you very much. It's useful, indeed. However, what I need is to bypass TeX (Lua > .tuc) if possible, since all the data I need to handle is generated with Lua scripts. Jairo El mar, 23 de mar. de 2021 a la(s) 23:12, Aditya Mahajan (adit...@umich.edu) escribió: > On Tue, 23 Mar 2021, Jairo

Re: [NTG-context] Writing to .tuc directly from Lua

2021-03-23 Thread Aditya Mahajan
On Tue, 23 Mar 2021, Jairo A. del Rio wrote: > Hi, list. I read about this: > > https://www.mail-archive.com/ntg-context@ntg.nl/msg60217.html > > But I want to know how to pass data to the .tuc file directly from Lua. I > think about some complex strings are calculations which are done in each

[NTG-context] Writing to .tuc directly from Lua

2021-03-23 Thread Jairo A. del Rio
Hi, list. I read about this: https://www.mail-archive.com/ntg-context@ntg.nl/msg60217.html But I want to know how to pass data to the .tuc file directly from Lua. I think about some complex strings are calculations which are done in each pass and slow down the whole compilation process.