guile-pstk

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

commit 14101c5cb08c5c0fcd1da48bea38d19b945be194
parent 7bbddff92c5331f4a47c95350e592eb1a3bb5d15
Author: Yuval Langer <yuval.langer@gmail.com>
Date:   Sat, 15 Jun 2024 02:19:03 +0300

Unpack a letrec.

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

diff --git a/pstk.scm b/pstk.scm @@ -683,16 +683,14 @@ (set! wish-output (car result)))) (define (read-line in) - (letrec - ((collect-chars - (lambda (c s) - (cond ((or (eof-object? c) (char=? c #\newline)) - (apply string (reverse s))) - (else (collect-chars (read-char in) (cons c s)))))) - (first-char - (read-char in))) - (cond ((eof-object? first-char) first-char) - (else (collect-chars first-char '()))))) + (define (collect-chars c s) + (lambda (c s) + (cond ((or (eof-object? c) (char=? c #\newline)) + (apply string (reverse s))) + (else (collect-chars (read-char in) (cons c s)))))) + (define first-char (read-char in)) + (cond ((eof-object? first-char) first-char) + (else (collect-chars first-char '())))) (define (eval-wish cmd) (wish (string-append