all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Christopher Baines <mail@cbaines.net>
Cc: 36948@debbugs.gnu.org
Subject: [bug#36948] [PATCH 1/2] import: utils: Add hash-ref*.
Date: Thu, 22 Aug 2019 14:04:28 +0200	[thread overview]
Message-ID: <8736htqucz.fsf@gnu.org> (raw)
In-Reply-To: <20190806191728.22923-1-mail@cbaines.net> (Christopher Baines's message of "Tue, 6 Aug 2019 20:17:27 +0100")

Hello Chris,

Christopher Baines <mail@cbaines.net> skribis:

> With the change to guile-json version 3, JSON objects are represented as hash
> tables, rather than alists. The cpan importer uses assoc-ref* on a hash table,
> so add an equivalent function for hash tables.
>
> * guix/import/utils.scm (hash-ref*): New procedure.

[...]

> In guile-json version 3, JSON objects are represented as hash tables, rather
> than alists.

I seems to me that this is adapting for Guile-JSON v1, not v3: in v3,
JSON arrays map to Scheme vectors, and JSON dictionaries map to alists;
JSON dictionaries used to map to hash tables in v1.

Indeed, ‘tests/cpan.scm’ now fails for me:

--8<---------------cut here---------------start------------->8---
actual-error:
+ (wrong-type-arg
+   "scm_hash_fn_get_handle"
+   "Wrong type argument in position ~A (expecting ~A): ~S"
+   (1
+    "hash-table"
+    (("version" . "0.1")
+     ("author" . "Guix")
+     ("download_url"
+      .
+      "http://example.com/Foo-Bar-0.1.tar.gz")
[…]
--8<---------------cut here---------------end--------------->8---

Could it be that you were testing this in an environment containing v1
and not v3?

Sorry for not noticing earlier!

Thanks,
Ludo’.

  parent reply	other threads:[~2019-08-22 12:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-06 19:07 [bug#36948] [PATCH 0/2] Fix the CPAN importer Christopher Baines
2019-08-06 19:17 ` [bug#36948] [PATCH 1/2] import: utils: Add hash-ref* Christopher Baines
2019-08-06 19:17   ` [bug#36948] [PATCH 2/2] import: cpan: Adapt for the change to guile-json version 3 Christopher Baines
2019-08-22 12:04   ` Ludovic Courtès [this message]
2019-08-21 17:30 ` bug#36948: [PATCH 0/2] Fix the CPAN importer Christopher Baines

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8736htqucz.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=36948@debbugs.gnu.org \
    --cc=mail@cbaines.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.