(import (std text json) (scheme hash-table)) (begin (define (json-object . pairs) (alist->hash-table pairs equal?)) (define json-list list) (define json-null (if #f #f)) (define json-object? hash-table?) (define json-list? list?) (define (json-null? obj) (eq? obj json-null)) (define (json-object-contains-key? json key) (hash-table-contains? json key)) (define string->json string->json-object) (define json->string json-object->string) (define (json-object-ref json key) (if (json-object-contains-key? json key) (hash-table-ref json key) ((json-key-not-found)))) (define json-list-ref list-ref) (define json-list-length length) (define json-object->alist hash-table->alist) (define json-list->list values))