1
0
Fork
You've already forked sigil-json
0
JSON parsing and generation for Sigil.
  • Scheme 100%
Find a file
David Wilson 55c9e74712
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Bump sigil-json to Sigil 0.16
Update the package version and Sigil compatibility range to 0.16, then regenerate the lockfile against sigil-stdlib ^0.16.
Verification:
- /tmp/sigil-t-e6e9/build/dev/bin/sigil deps install
- /tmp/sigil-t-e6e9/build/dev/bin/sigil build
- /tmp/sigil-t-e6e9/build/dev/bin/sigil test
2026年05月06日 13:07:07 +03:00
docs Add quick reference docs for sigil-json and sigil-http 2026年01月08日 16:26:28 +02:00
src/sigil compiler: populate docs JSON exports from module at compile time 2026年04月17日 20:44:06 +03:00
test fix: Handle surrogate pairs in JSON unicode escapes 2026年02月20日 15:53:50 +02:00
.gitignore Extract sigil-json from sigil monorepo 2026年04月24日 15:11:50 +03:00
.woodpecker.yml Bump CI pin to sigil v0.14.3 2026年04月26日 20:07:21 +03:00
dev-redirects.sgl Extract sigil-json from sigil monorepo 2026年04月24日 15:11:50 +03:00
manifest.scm Extract sigil-json from sigil monorepo 2026年04月24日 15:11:50 +03:00
package.sgl Bump sigil-json to Sigil 0.16 2026年05月06日 13:07:07 +03:00
README.md Extract sigil-json from sigil monorepo 2026年04月24日 15:11:50 +03:00
sigil.lock Bump sigil-json to Sigil 0.16 2026年05月06日 13:07:07 +03:00

sigil-json

JSON parsing and generation for Sigil.

Bidirectional conversion between JSON and native Scheme types (dicts, arrays, strings, numbers, booleans) with port-based I/O for reading and writing JSON streams.

This package was extracted from the sigil monorepo — the in-tree history under packages/sigil-json/ is preserved here as master.

Usage

(import (sigil json))
;; Encode
(json-encode #{ name: "Alice" age: 30 })
; => "{\"name\":\"Alice\",\"age\":30}"
;; Decode
(json-decode "{\"name\":\"Alice\",\"age\":30}")
; => #{ name: "Alice" age: 30 }
;; Path lookup
(json-get-in (json-decode "{\"a\":{\"b\":42}}") '(a b))
; => 42

Type Mapping

JSON Scheme
object dict: #{ name: "Alice" }
array array: #[1 2 3]
string string: "hello"
number number: 42, 3.14
true #t
false #f
null 'null symbol

JSON null decodes as the symbol 'null (not #f). When a field may be JSON null, normalize it explicitly — see docs/json.md for the pattern.

API

(sigil json)

Procedure Purpose
json-encode Scheme value → JSON string
json-decode JSON string → Scheme value
json-read / json-write Port-based streaming I/O
json-get-in Path lookup into a decoded value

See docs/json.md for full details.

Dependencies

  • sigil-stdlib

Consumed here as a from-git ref pinned to ^0.13.1 against the sigil monorepo.

Build

sigil deps install
sigil build

Testing

sigil test

License

BSD-3-Clause.