diff options
author | Robby Zambito <contact@robbyzambito.me> | 2023-02-21 16:56:01 -0500 |
---|---|---|
committer | Robby Zambito <contact@robbyzambito.me> | 2023-02-21 16:56:01 -0500 |
commit | 863f67d2ab3423e840f3bf09f965b64819d8e5db (patch) | |
tree | 154544413737108830602296b457cc0401485a09 /lib/zambyte/meta/guile-json.scm | |
parent | 26197ab6e647ae9e37fb56f7844cf711fc10409c (diff) |
Mutating an empty object should return a new object if it cannot be mutated.
Diffstat (limited to 'lib/zambyte/meta/guile-json.scm')
-rw-r--r-- | lib/zambyte/meta/guile-json.scm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/zambyte/meta/guile-json.scm b/lib/zambyte/meta/guile-json.scm index a5815ff..903182b 100644 --- a/lib/zambyte/meta/guile-json.scm +++ b/lib/zambyte/meta/guile-json.scm @@ -48,7 +48,7 @@ (set-cdr! (assoc (symbol->string key) json) value) json) ((null? json) - (error "json-object-set!: cannot set on an empty object" json)) + (json-object (cons key value))) ((list? json) (append! json (list (cons (symbol->string key) value)))) ((json-record? json) |