From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from cgl.ntg.nl (Cgl.ntg.nl [5.39.185.202]) by inbox.vuxu.org (Postfix) with ESMTP id 322BC2015F for ; Sat, 11 Jan 2025 16:02:05 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 2CF48485695 for ; Sat, 11 Jan 2025 16:02:04 +0100 (CET) Authentication-Results: cgl.ntg.nl (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=ntg.nl DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ntg.nl; h= content-type:content-type:from:from:list-unsubscribe :list-subscribe:list-post:list-owner:list-help:list-archive :archived-at:list-id:subject:subject:reply-to:precedence :x-mailer:date:date:message-id:mime-version:received:received :received:received:received:received; s=cgl; t=1736607723; x= 1739199724; bh=OXdfCS7pIQoIhSEEznppfUFWiGFshuvOsfBIsm1P69w=; b=P r2cSs1TK/Ia0LHZMNbBNPsoDbG0KjGUbp5bNGUHGJNkNb2WIXWJ67fQ0PNHbsR+D 6+Bu4oVr+Yi+5bfPTik1PC2+HuLyovwJ9EkzGKPkTJ7TC0PMfHp73qjnWx/oabnc 6e9pSMMtiyMd/sJUs9+1f2WVgxmYl+OiiIXNYGgi90= X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Authentication-Results: cgl.ntg.nl (amavisd-new); dkim=fail (2048-bit key) reason="fail (message has been altered)" header.d=mac.com Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gjmW4dDVxPVg for ; Sat, 11 Jan 2025 16:02:03 +0100 (CET) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 97E91485498 for ; Sat, 11 Jan 2025 16:01:28 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id D9B2A48530D for ; Sat, 11 Jan 2025 16:01:11 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ofPXXttIbg5W for ; Sat, 11 Jan 2025 16:01:09 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=17.58.6.56; helo=pv50p00im-ztdg10021801.me.com; envelope-from=haksan@mac.com; receiver= Received: from pv50p00im-ztdg10021801.me.com (pv50p00im-ztdg10021801.me.com [17.58.6.56]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id 5C46E48528C for ; Sat, 11 Jan 2025 16:01:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=1a1hai; t=1736607668; bh=dmmnMv/ztiqa1r1L0yuYn4DjSU6ozYDhFS3OcrPIwYw=; h=From:Content-Type:Mime-Version:Subject:Message-Id:Date:To: x-icloud-hme; b=udOm1E+9HD+XbgmHjTIP0xRn80qYXpL3UzsGoxKLITo8esLdLEKAcBw5pr0egFndO n5iPiNhuH6IJANmHWVmmSxGgpmNRD9O7kGa5npyFOorMvS1cTJdciuApKWFb9tbOmt AUrMJs94FIeYyDCINfHePMIxwqIowWpFdYCLzA00cMuFhA+klOObeEiEPPeUcSWqNY A8+SVAgCOe7kRToJDJKuuwy4ZlbcrLZwg51NBLVKX2jGnodhR56wjZSRWbHuJelmA2 UIWnpr6/n3QKhFe0EaOIjT+kDKY+S3+b9glivlo+NS7/+ynKgGpxRqdRLpXW7O7S2z +xCF5JEHw+Msw== Received: from smtpclient.apple (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-ztdg10021801.me.com (Postfix) with ESMTPSA id 63F442010261 for ; Sat, 11 Jan 2025 15:01:06 +0000 (UTC) Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Message-Id: <3D77A83F-3238-411E-BE8D-218EC4185D00@mac.com> Date: Sun, 12 Jan 2025 00:01:03 +0900 To: mailing list for ConTeXt users X-Mailer: Apple Mail (2.3654.120.0.1.15) X-Proofpoint-GUID: Ro3rAEfeyiqEOkK0L5Cd-YfgPR6P_CqH X-Proofpoint-ORIG-GUID: Ro3rAEfeyiqEOkK0L5Cd-YfgPR6P_CqH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-11_06,2025-01-10_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 malwarescore=0 adultscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 clxscore=1015 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2501110129 Message-ID-Hash: ASBFKYBL6KG65K6TV4EZASL6DDXXO4FJ X-Message-ID-Hash: ASBFKYBL6KG65K6TV4EZASL6DDXXO4FJ X-MailFrom: haksan@mac.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Lua question - table.save, table.load List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Jeong Dal via ntg-context Cc: Jeong Dal Content-Type: multipart/mixed; boundary="===============8256086283695021607==" --===============8256086283695021607== Content-Type: multipart/alternative; boundary="Apple-Mail=_D08E184D-C6B4-4E2E-86DD-85C896A1D933" --Apple-Mail=_D08E184D-C6B4-4E2E-86DD-85C896A1D933 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Dear all, I save a table =E2=80=9CtfList=E2=80=9D using table.save in Lua: \startluacode ... table.save(=E2=80=9CtempList.lua=E2=80=9D,tfList) ... \stopluacode And I call it in MetaFun using a method explained in the MetaFun book. \startMPcode lua("MP =3D { } MP.data =3D table.load('tempList.lua')") ; =E2=80=A6 \stopMPcode However, I found that whenever I save =E2=80=9CtfList=E2=80=9D, table = contents are appended to the file =E2=80=9CtempList.lua=E2=80=9D 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=E2=80=99t 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 --Apple-Mail=_D08E184D-C6B4-4E2E-86DD-85C896A1D933 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Dear = all,

I save a table = =E2=80=9CtfList=E2=80=9D using table.save in Lua:
\startluacode
= ...
= table.save(=E2=80=9CtempList.lua=E2=80=9D,tfList)
= ...
\stopluacode

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

\startMPcode
lua("MP =3D { } MP.data =3D = table.load('tempList.lua')") ;
=E2=80=A6
\stopMPcode

However, I found that whenever I save =E2=80=9CtfList=E2=80=9D,= table contents are appended to the file =E2=80=9CtempList.lua=E2=80=9D = 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=E2=80=99t 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



= --Apple-Mail=_D08E184D-C6B4-4E2E-86DD-85C896A1D933-- --===============8256086283695021607== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============8256086283695021607==--