From e01a6db5a6926acb73bfc37255bf2fcd799ab4b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pant=C5=AF=C4=8Dek?= Date: Wed, 22 Mar 2023 17:34:06 +0100 Subject: [PATCH] Render table rows statically. --- table.scm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/table.scm b/table.scm index 6559f0c..abfead6 100644 --- a/table.scm +++ b/table.scm @@ -201,7 +201,12 @@ (cell-border (get-keyword #:cell-border args (lambda () #f))) (border-style (get-keyword #:border-style args (lambda () 'ascii))) (table (table-prepare tbl))) - "")) + (string-intersperse + (flatten + (map (lambda (row) + (table-row->lines row "]" "|" "[")) + table)) + "\n"))) ;; Performs module self-tests (define (table-tests!) @@ -255,3 +260,8 @@ (import table) (table-tests!) + +(print + (table->string + '(("a" "bb" "ccc" "") + ("" "b" "z" "x"))))