guix-devel
[Top][All Lists]
Advanced

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

Re: 02/02: import: cpan: Adapt for the change to guile-json version 3.


From: Mark H Weaver
Subject: Re: 02/02: import: cpan: Adapt for the change to guile-json version 3.
Date: Wed, 21 Aug 2019 16:06:55 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Hi Christopher,

address@hidden writes:

> cbaines pushed a commit to branch master
> in repository guix.
>
> commit 01ce7af25add55514f737af48ea6c127bedfde67
> Author: Christopher Baines <address@hidden>
> Date:   Tue Aug 6 20:17:28 2019 +0100
>
>     import: cpan: Adapt for the change to guile-json version 3.
>     
>     In guile-json version 3, JSON objects are represented as hash tables, 
> rather
>     than alists.

I haven't looked carefully, but I thought it was the other way around.
Quoting from the guile-json 3.0.0 release announcement:

  "JSON objects are now defined as alists (instead of hash tables) and
  JSON arrays are now defined as vectors (instead of lists)."

  <https://savannah.nongnu.org/forum/forum.php?forum_id=9340>

With this in mind, I'm surprised to see additional uses of hash tables
here.  It would be good to avoid hash tables except in cases where
efficiency demands it.

>     * guix/import/cpan.scm (string->license): Change the match expression to 
> match
>     on lists, rather than vectors.
>     (module->dist-name, cpan-source-url, cpan-version): Change assoc-ref to
>     hash-ref.
>     (cpan-module->sexp): Change assoc-ref to hash-ref, and assoc-ref* to
>     hash-ref*.
>     * tests/cpan.scm ("source-url-http", "source-url-https"): Convert the 
> alist to
>     a hash table.

Can you help me understand why the apparent switch _away_ from hash
tables in Guile-JSON-3 has somehow led to increased usage of hash tables
in this commit, as well as the addition of 'hash-ref*' in the exports of
(guix import utils)?

      Thanks,
        Mark



reply via email to

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