Hi Christopher,

guix-comm...@gnu.org writes:

> cbaines pushed a commit to branch master
> in repository guix.
>
> commit 01ce7af25add55514f737af48ea6c127bedfde67
> Author: Christopher Baines <m...@cbaines.net>
> 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