From 26197ab6e647ae9e37fb56f7844cf711fc10409c Mon Sep 17 00:00:00 2001 From: Robby Zambito Date: Tue, 21 Feb 2023 16:53:25 -0500 Subject: Bring SRFI 180 up to feature parity Record mutators may not mutate the record in place. Mutating an empty object should return a new object if it cannot be mutated. --- lib/zambyte/meta/chibi.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/zambyte/meta/chibi.scm') diff --git a/lib/zambyte/meta/chibi.scm b/lib/zambyte/meta/chibi.scm index 856e1b8..3ce8192 100644 --- a/lib/zambyte/meta/chibi.scm +++ b/lib/zambyte/meta/chibi.scm @@ -46,7 +46,7 @@ (set-cdr! (assoc 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 key value)))) ((json-record? json) -- cgit