Am 10.08.25 um 21:28 schrieb Hans Hagen via ntg-context:
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 -)

Of course. I meant, where can I find some docs?

Use the source, of course… (I should filk that Mr.Ed song.)

*) 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

Yes, you mention it in cld-mkiv, that’s why I point to it.

(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

Well, I try to choose the right tools. For ConTeXt stuff it makes sense for me to learn some Lua. But on one hand Lua is minimal so that I must write more myself (or find usable code), OTOH I know there must be something in the distribution that’s probably better than anything I can come up with – if I can find & understand it.

(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)

:D
___________________________________________________________________________________
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