mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 13:49:17 +02:00
15 lines
438 B
Scheme
15 lines
438 B
Scheme
|
|
(define-library (chibi json)
|
|
(import (scheme base))
|
|
(export string->json json->string json-read json-write)
|
|
(include-shared "json")
|
|
(begin
|
|
(define (string->json str)
|
|
(let* ((in (open-input-string str))
|
|
(res (json-read in)))
|
|
(close-input-port in)
|
|
res))
|
|
(define (json->string json)
|
|
(let ((out (open-output-string)))
|
|
(json-write json out)
|
|
(get-output-string out)))))
|