Skip to content

Conversation

sktometometo
Copy link

Add JSON Loader.

This PR offers json parser implementation in pure euslisp.

{
    "a": 1,
    "b": {
        "cde": ["fgh", 1.0, true, 2]
    }
}
> (load "json.l")
> (parse-json-file "./hoge.json")
(("a" . 1) ("b" ("cde" . #("fgh" 1.0 t 2))))

In this implementation, json object (dictionary) will become an association list and json array (list) will become a vector.

So this library also offer simple accessor for association list like below.

> (setq data (parse-json-file "./hoge.json"))
> (access-alist data "a")
1
> (access-alist data "b")
(("cde" . #("fgh" 1.0 t 2)))

@mqcmd196
Copy link

Sorry for being late. Is this different from https://github.com/jsk-ros-pkg/jsk_roseus/tree/master/roseus_mongo/euslisp/json ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants