pandoc.utils.type() return values seem to be a little inconsistent. For example, it can return:
I was toying with not indicating HsLua.JSON.array (i.e., showing it like any other table) but perhaps it's better just to report things as they are. Can any other HsLua.JSON.xxx values be returned, e.g., why not HsLua.JSON.object or indeed HsLua.JSON.{boolean,number,string,null}?

On Fri, 20 Jan 2023 at 16:33, William Lupton <wlupton@broadband-forum.org> wrote:
Update: Until today, logging.lua assumed that pairs() would work on all userdata. Option 2 (my favourite) should work well if there are ever any other types of userdata (not sure whether there ever will be).

On Fri, 20 Jan 2023 at 16:29, William Lupton <wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org> wrote:
Thanks Albert. I expect I'll raise an issue. I assume that this is the only use of light userdata?

Looking more closely (why didn't I do this before?) I see that tostring() returns 'userdata: 0x0' for these values, so I think it makes sense to report them as one of:
  • Whatever tostring() returns
  • As above with the leading 'userdata: ' removed                   <--- probably my favourite
  • As above with '0x0' reported as 'nil' (not sure about this)

On Fri, 20 Jan 2023 at 16:05, ChrisD <cd34-gg@intielectronics.com> wrote:
On 1/20/2023 2:54 AM, 'William Lupton' via pandoc-discuss wrote:
> I investigated, and parts of the writer options are "light userdata" (I hadn't heard of that). I've committed and merged a fix that will report such items as "<pointer>". You can now list most of the writer options (just a few colors show as <pointer>).

Your update works well. (I didn't know about light userdata either.) Thanks!

--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/fbca8e05-fed7-39e1-08f0-0498c399f33f%40intielectronics.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAEe_xxjkBZfgeh5jDbZNDNrFbG4SKTA0S9qjzaEXgxTr5BZVNw%40mail.gmail.com.