about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2021-02-27 19:46:12 +0530
committerArun Isaac2021-02-27 19:46:12 +0530
commit52980a641e7434cb7610d7c857df6f1482bd07ec (patch)
treef05985d158efec76a3ecc762ce39279329c224a4
parentead05e253861cc796eaf21d19cae1ae3707bef9e (diff)
downloadccwl-52980a641e7434cb7610d7c857df6f1482bd07ec.tar.gz
ccwl-52980a641e7434cb7610d7c857df6f1482bd07ec.tar.lz
ccwl-52980a641e7434cb7610d7c857df6f1482bd07ec.zip
Add scm->yaml-string.
* ccwl/yaml.scm (scm->yaml-string): New function.
-rw-r--r--ccwl/yaml.scm8
1 files changed, 7 insertions, 1 deletions
diff --git a/ccwl/yaml.scm b/ccwl/yaml.scm
index 2036815..f24d27e 100644
--- a/ccwl/yaml.scm
+++ b/ccwl/yaml.scm
@@ -4,8 +4,10 @@
 ;; This file implements a library to convert a scm tree to yaml.
 
 (define-module (ccwl yaml)
+  #:use-module (srfi srfi-26)
   #:use-module (ice-9 match)
-  #:export (scm->yaml))
+  #:export (scm->yaml
+            scm->yaml-string))
 
 (define (kebab->camel string)
   "Convert STRING from kebab case to CAMEL case."
@@ -83,3 +85,7 @@ PORT. LEVEL is an internal recursion variable."
     (symbol
      (display-atom symbol port)
      (newline port))))
+
+(define (scm->yaml-string scm)
+  (call-with-output-string
+    (cut scm->yaml scm <>)))