[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Support custom 'null' and 'false' objects when parsing JSON

From: Stefan Monnier
Subject: Re: [PATCH] Support custom 'null' and 'false' objects when parsing JSON
Date: Thu, 07 Jun 2018 15:13:17 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> the keyword :null, I have to explicitly check for non-`nil'ness *and*
> non-`:null'ness, whereas before only one check was necessary.  Other

IIUC this is a matter of changing things like

    (null x)
    (memq x '(nil :null))

right?  On this one example it doesn't look that bad, so I'm wondering
about the real impact it would have on your code.

> -json_to_lisp (json_t *json, enum json_object_type object_type)
> +json_to_lisp (json_t *json,
> +              enum json_object_type object_type,
> +              Lisp_Object null_object,
> +              Lisp_Object false_object)

Wouldn't it make sense to group those 3 parameters into a single object
(presumably a pointer to a stack-allocated struct containing those
3 fields)?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]