From 52980a641e7434cb7610d7c857df6f1482bd07ec Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sat, 27 Feb 2021 19:46:12 +0530 Subject: Add scm->yaml-string. * ccwl/yaml.scm (scm->yaml-string): New function. --- ccwl/yaml.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 <>))) -- cgit v1.2.3