From da6bd4cf9794f4f0bbe859090eda9a00449cde28 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 26 Dec 2016 00:17:21 +0100 Subject: [PATCH] Add make-string, object->string. * module/mes/guile.mes (make-string, object->string): New functions. --- module/mes/guile.mes | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/module/mes/guile.mes b/module/mes/guile.mes index 29c3a855..558a1e31 100644 --- a/module/mes/guile.mes +++ b/module/mes/guile.mes @@ -25,6 +25,13 @@ (define-macro (define-module module . rest) #t) (define-macro (use-modules . rest) #t) +(define (make-string n . fill) + (list->string (apply make-list n fill))) + +(define (object->string x . rest) + (with-output-to-string + (lambda () ((if (pair? rest) (car rest) write) x)))) + (define (port-filename p) "") (define (port-line p) 0) (define (simple-format port format . rest) (map (lambda (x) (display x port)) rest))