From: Jeong Dal via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Jeong Dal <haksan@mac.com>
Subject: [NTG-context] Lua question - table.save, table.load
Date: Sun, 12 Jan 2025 00:01:03 +0900 [thread overview]
Message-ID: <3D77A83F-3238-411E-BE8D-218EC4185D00@mac.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 809 bytes --]
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?
Thank you for reading.
Best regards,
Dalyoung
[-- Attachment #1.2: Type: text/html, Size: 2629 bytes --]
[-- Attachment #2: Type: text/plain, Size: 511 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
next reply other threads:[~2025-01-11 15:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-11 15:01 Jeong Dal via ntg-context [this message]
2025-01-11 16:48 ` [NTG-context] " Hans Hagen
2025-01-11 21:10 ` Jeong Dal via ntg-context
2025-01-12 11:00 ` Jeong Dal via ntg-context
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3D77A83F-3238-411E-BE8D-218EC4185D00@mac.com \
--to=ntg-context@ntg.nl \
--cc=haksan@mac.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).