guile-pstk

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 7de67666d36218c22bf84ff60ca03b225f3477a8
parent 288eb9af5017f2653887a7691c349c952a5a9602
Author: Yuval Langer <yuval.langer@gmail.com>
Date:   Sun, 16 Jun 2024 02:14:22 +0300

Simplify procedure `->string`.

Diffstat:
Mpstk.scm | 20++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/pstk.scm b/pstk.scm @@ -238,14 +238,18 @@ (set! enabled (car args)))))) (define (->string x) - (cond ((string? x) x) - ((symbol? x) (symbol->string x)) - ((char? x) (string x)) - ((number? x) (number->string x)) - (else - (let ((out (open-output-string))) - (display x out) - (get-output-string out))))) + ;; XXX: Commenting out for the simpler implementation below. + ;; (cond ((string? x) x) + ;; ((symbol? x) (symbol->string x)) + ;; ((char? x) (string x)) + ;; ((number? x) (number->string x)) + ;; (else + ;; (let ((out (open-output-string))) + ;; (display x out) + ;; (get-output-string out)))) + + (with-output-to-string + (lambda () (display x)))) ;;; Start weird letrec definitions: