bug#77762: [PATCH] web: Add JSON module.

Tomas Volf <[email protected]> Fri, 02 May 2025 14:03:56 +0200
Newsgroups gmane.lisp.guile.bugs
Message-ID <[email protected]>
"Thompson, David" <[email protected]> writes:

> On Sat, Apr 12, 2025 at 12:01=E2=80=AFPM Tomas Volf <[email protected]> wrote:
>>
>> > - null is the symbol 'null
>>
>> Out of curiosity, what are your thoughts about using #nil instead?
>
> My original patch from 10 years ago did this. Mark Weaver then
> explained to me that #nil was added specifically for the purpose of
> supporting Emacs Lisp on the Guile VM and shouldn't be used in Scheme
> code. The symbol 'null works well because there is no symbol type in
> JSON so there's no ambiguity.

Thanks for the explanation.  I asked not due to perceived ambiguity, but
due to how #nil interacts with conditions.  It would be handy to be able
to write

    (when (assq-ref data 'foo)
      ...)

instead of

    (when (not (eq? 'null (or (assq-ref data 'foo) 'null)))
      ...)

Tomas

--=20
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.