guix-patches
[Top][All Lists]
Advanced

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

[bug#36948] [PATCH 1/2] import: utils: Add hash-ref*.


From: Ludovic Courtès
Subject: [bug#36948] [PATCH 1/2] import: utils: Add hash-ref*.
Date: Thu, 22 Aug 2019 14:04:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Hello Chris,

Christopher Baines <address@hidden> 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’.





reply via email to

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