From f38bbcf4e9bf89a733699d3768ee9e44ddca0992 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sat, 28 Jan 2023 01:38:07 +0000 Subject: ast: Rewrite ast->string using string-join. * src/guile/skribilo/ast.scm (ast->string): Rewrite using string-join. --- src/guile/skribilo/ast.scm | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/guile/skribilo/ast.scm b/src/guile/skribilo/ast.scm index 4a39ebf..003619f 100644 --- a/src/guile/skribilo/ast.scm +++ b/src/guile/skribilo/ast.scm @@ -3,6 +3,7 @@ ;;; Copyright 2003, 2004, 2009 Erick Gallesio - I3S-CNRS/ESSI ;;; Copyright 2003, 2004 Manuel Serrano ;;; Copyright 2005, 2006, 2007, 2012, 2013, 2015, 2018 Ludovic Courtès +;;; Copyright 2023 Arun Isaac ;;; ;;; ;;; This file is part of Skribilo. @@ -206,16 +207,7 @@ (define-method (ast->string (ast )) (number->string ast)) (define-method (ast->string (ast )) - (let ((out (open-output-string))) - (let Loop ((lst ast)) - (cond - ((null? lst) - (get-output-string out)) - (else - (display (ast->string (car lst)) out) - (unless (null? (cdr lst)) - (display #\space out)) - (Loop (cdr lst))))))) + (string-join (map ast->string ast))) -- cgit v1.2.3