On 8/10/2025 9:09 PM, Hraban Ramm wrote:
What’s the difference between table.tofile and table.save? tofile is
documented in cld-mkiv* while save is not. table.save is also not
mentioned in the Lua reference manual. Where does it come from?
just look at the files ...
as all lua code in context it comes from 'the makers of context' ..
where else from -)
my_table = tabel.load("my_file.lua")
wrt runfiles benefits:
- finding the file
- checking it
- reporting on it
Great, thank you!
*) BTW, cld-mkiv speaks of "luafilesystem" while the library is called
"lfs".
i probably need to update that document ... some day ... but making a
list of what is missing is quite some work
originally we used the lfs library but it got adapted ... in luametatex
the name sort of sticks but it's a different implementation (for various
reasons) and provides some more
(It’s strange, while in Python I just try everything, in Lua I feel the
need to check every step… Maybe it’s because I want my code to be "best
practice" because it might become part of documentation… And of course I
still lack the same experience that I have in Python.)
a matter if taste i guess ... i never use(d) python so i can't read it;
i remember at some point fixing some code wrt fonts but that's because I
know what to search for wrt fonts; i also - years ago - was in some
'educational moment' where someone had to impement some string
manipulation stuff, so there i could show that lua way way faster, and
later machine learning stuff that i then decided to trace with some
metapost also using lua because i didn't see a reason to look into python
for me the charm about lua is that it comes rather small .. no need to
study libraries and no dependencies; i'm also not much of an "oo" person
so i leave python to you
Hans
(no way i'd have spent time on pythontex, javascripttex, rubytex,
perltex, gotex, javatex or whatever else; i know people who collect
linux installations, various languages, web frameworks, but that's not me)
-----------------------------------------------------------------
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
___________________________________________________________________________________