Subject: bug#49660: 28.0.50; json-available-p should exist

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 21 Jul 2021 12:50:55 +0200

Eli Zaretskii <[email-masked]> writes:

> No, it doesn't have to.  You could have json-available-p that simply
> tested one of json.c primitives to be fboundp, and if so, tried to
> invoke one of them on a trivial input to see if it signals an error.

That's true -- especially since they now signal a distinct error when
the library isn't available.  Pushed to Emacs 28 now.

> Alternatively, we could do this like decompress.c does: it would
> require the test for availability to be slightly more complex:
>
>   (and (fboundp 'json-available-p)
>        (json-available-p))
>
> Would that be good enough?

No, I think the -available-p predicates should always be defined.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no