On 1/11/2025 4:01 PM, Jeong Dal via ntg-context wrote:
Dear all,

I save a table “tfList” using table.save in Lua:

\startluacode
...
table.save(“tempList.lua”,tfList)
...
\stopluacode

And I call it in MetaFun using a method explained in the MetaFun book.

\startMPcode
lua("MP = { } MP.data = table.load('tempList.lua')") ;
…
\stopMPcode

However, I found that whenever I save “tfList”, table contents are appended to the file “tempList.lua” at the end which cause a trouble.
I want the tempList.lua contains the new table only.
I search the method to do that, but I can’t find it.
The only way is to change the file name each time which is not good to make a macro.

Is there a way to clear the contents in the tempList.lua before I save another table?

so you add to that list?

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to