unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* guile-json 0.5.0 released
@ 2016-02-24  6:23 Aleix Conchillo Flaqué
  2016-02-24 17:07 ` Christopher Allan Webber
  0 siblings, 1 reply; 3+ messages in thread
From: Aleix Conchillo Flaqué @ 2016-02-24  6:23 UTC (permalink / raw
  To: guile-user

Hi,

I am happy to announce a new minor guile-json release 0.5.0. This
release allows converting simple alists to json. Thanks to Jan
Nieuwenhuizen!

For example:

    scheme@(json)> (scm->json-string '((a . 1) (b . 2)))
    $2 = "{\"a\" : 1,\"b\" : 2}"

For installation details and documentation:

    https://github.com/aconchillo/guile-json

Happy hacking!

Aleix



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: guile-json 0.5.0 released
  2016-02-24  6:23 guile-json 0.5.0 released Aleix Conchillo Flaqué
@ 2016-02-24 17:07 ` Christopher Allan Webber
  2016-02-24 19:09   ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 3+ messages in thread
From: Christopher Allan Webber @ 2016-02-24 17:07 UTC (permalink / raw
  To: Aleix Conchillo Flaqué; +Cc: guile-user

Aleix Conchillo Flaqué writes:

> Hi,
>
> I am happy to announce a new minor guile-json release 0.5.0. This
> release allows converting simple alists to json. Thanks to Jan
> Nieuwenhuizen!
>
> For example:
>
>     scheme@(json)> (scm->json-string '((a . 1) (b . 2)))
>     $2 = "{\"a\" : 1,\"b\" : 2}"
>
> For installation details and documentation:
>
>     https://github.com/aconchillo/guile-json
>
> Happy hacking!
>
> Aleix

That's interesting!

BTW, how do you differentiate between these two cases?

  {"a": ["b", "c", "d"]}
  ["a", "b", "c", "d"]

AFAICT both in scheme would be represented as:

  '("a" . ("b" "c" "d"))

... or can only symbols be keys?



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: guile-json 0.5.0 released
  2016-02-24 17:07 ` Christopher Allan Webber
@ 2016-02-24 19:09   ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Nieuwenhuizen @ 2016-02-24 19:09 UTC (permalink / raw
  To: Christopher Allan Webber; +Cc: guile-user

Christopher Allan Webber writes:

> Aleix Conchillo Flaqué writes:
>
>> I am happy to announce a new minor guile-json release 0.5.0. This
>> release allows converting simple alists to json. Thanks to Jan
>> Nieuwenhuizen!

Yay!

> BTW, how do you differentiate between these two cases?
>
>   {"a": ["b", "c", "d"]}

    scheme@(json)> (scm->json-string '((a . (b c d))))
    $2 = "{\"a\" : [\"b\", \"c\", \"d\"]}"

>   ["a", "b", "c", "d"]

    scheme@(json)> (scm->json-string '(a . (b c d)))
    $3 = "[\"a\", \"b\", \"c\", \"d\"]"

> AFAICT both in scheme would be represented as:
>
>   '("a" . ("b" "c" "d"))
>
> ... or can only symbols be keys?

Alists (json-alist?) are converted to objects, other lists to arrays.  A
"json-alist" has key-value pairs and uses atoms as key.

Greetings,
Jan

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-24 19:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-24  6:23 guile-json 0.5.0 released Aleix Conchillo Flaqué
2016-02-24 17:07 ` Christopher Allan Webber
2016-02-24 19:09   ` Jan Nieuwenhuizen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).