Commits

Moritz Heidkamp committed dd76239

Add default-edn-emitters

Comments (0)

Files changed (2)

 (define (emit-tag el out)
   (write-edn/tag (caadr el) (cdadr el) (caddr el) out))
 
+(define (default-edn-emitters)
+  (list (cons keyword?       emit-keyword)
+        (cons symbol?        write)
+        (cons number?        write)
+        (cons string?        write)
+        (cons boolean?       emit-boolean)
+        (cons (car? 'list)   (coll-emitter #\( #\)))
+        (cons (car? 'vector) (coll-emitter #\[ #\]))
+        (cons (car? 'set)    emit-set)
+        (cons (car? 'map)    emit-map)
+        (cons (car? 'tag)    emit-tag)))
+
 (define edn-emitters
   (make-parameter
-   (list (cons keyword?       emit-keyword)
-         (cons symbol?        write)
-         (cons number?        write)
-         (cons string?        write)
-         (cons boolean?       emit-boolean)
-         (cons (car? 'list)   (coll-emitter #\( #\)))
-         (cons (car? 'vector) (coll-emitter #\[ #\]))
-         (cons (car? 'set)    emit-set)
-         (cons (car? 'map)    emit-map)
-         (cons (car? 'tag)    emit-tag))))
+   (default-edn-emitters)))
 
 (define (register-edn-emitter! pred emitter)
   (edn-emitters (alist-cons pred emitter (edn-emitters))))
  write-edn
  write-edn/tag
  edn-emitters
+ default-edn-emitters
  register-edn-emitter!)
 
 "edn-impl.scm"