diff options
Diffstat (limited to 'README.org')
-rw-r--r-- | README.org | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -133,16 +133,13 @@ Convert ~lst~ to a ~list?~ of ~json-value?~. #+end_src #+begin_src scheme - (define-syntax case-values - (syntax-rules () - ((_ vals (pattern body1 body2 ...) ...) - (call-with-values (lambda () vals) (case-lambda (pattern body1 body2 ...) ...))))) + (import (srfi 210)) - (case-values (json-ref (json-object `("x" . ,(json-list "hello" "world"))) "x") + (case-receive (json-ref (json-object `("x" . ,(json-list "hello" "world"))) "x") (() 'not-found) ((x) (json-list? x))) ; => #t - (case-values (json-ref (json-object `("x" . ,(json-list "hello" "world"))) "y") + (case-receive (json-ref (json-object `("x" . ,(json-list "hello" "world"))) "y") (() 'not-found) ((x) (json-list? x))) ; => not-found #+end_src |