Also assigning `nil` to a table key/index deletes that key/index. A table value can't be `nil`: ``````lua local t = { a = 1, b = 2, c = 3 } for k,v in pairs(t) do print(k, v) end -- prints -- a 1 -- b 2 -- c 3 -- but in a random order t.b = nil for k,v in pairs(t) do print(k,v) end -- Doesn't print b 2 because it doesn't exist anymore! `````` Den lör 6 maj 2023 10:35BPJ skrev: > > > Den fre 5 maj 2023 10:04ThomasH skrev: > >> Ah, ok, sorry, I've only come to Lua through Pandoc, so I'm often not >> aware of general Lua features. I will keep an eye open for the 'show' >> method. >> >> T. >> > > See > > https://www.lua.org/manual/5.4/manual.html > > https://learnxinyminutes.com/docs/lua/ > > Note that the latter seems to fail to mention that the full syntax for > long strings and comments includes balanced `=` characters between the > brackets so that you can include double brackets with or without a lower > number of `=` chars in the string, e.g. > > ``````lua > local foo = [===[ [==[ [=[ [[ foo ]] ]=] ]==] ]===] > `````` > > is a single string delimited by `[===[` and `]===]` > > Also escapes like `\n` don't work in long strings. > > > > >> On Friday, May 5, 2023 at 7:26:41 AM UTC+2 Albert Krewinkel wrote: >> >>> >>> ThomasH writes: >>> >>> > I just wished that would have been more apparent from the docs. >>> >>> The `tostring` function is the default Lua way to convert an object "to >>> a string in a human-readable format". Still, I made a mental note to add >>> better docs once we switch from a Haskell to a Lua representation as >>> `tostring` output. >>> >>> The Haskell/native output will probably become available via show >>> methods, as in `block:show()`. This already works for Block elements, >>> but not for Inlines. >>> >>> >>> >> Albert Krewinkel writes: >>> >> >>> >> > The alternative is to use `pandoc.write`, e.g.: >>> >> > >>> >> > print(pandoc.write(pandoc.Pandoc {element})) >>> >> >>> >> The above is missing the second parameter: >>> >> >>> >> print(pandoc.write(pandoc.Pandoc {element}, 'native')) >>> >>> >>> -- >>> Albert Krewinkel >>> GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124 >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "pandoc-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/pandoc-discuss/79a8dca6-9860-4109-b2e8-5841faa36cc0n%40googlegroups.com >> >> . >> > -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhCiFbdbX7QdtODq3Vd3hemrObiFpi0W9fmf_hyS077T-g%40mail.gmail.com.