1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 19:50:24 +02:00

Revert "Add record type printers for srfi-41 and srfi-45."

This reverts commit 4a1cdc9d5d, which was
prematurely pushed.
This commit is contained in:
Chris K. Jester-Young 2013-04-05 13:31:12 -04:00
parent 4a1cdc9d5d
commit 4b76acfa38
2 changed files with 2 additions and 29 deletions

View file

@ -27,7 +27,6 @@
#:use-module (srfi srfi-1) #:use-module (srfi srfi-1)
#:use-module (srfi srfi-8) #:use-module (srfi srfi-8)
#:use-module (srfi srfi-9) #:use-module (srfi srfi-9)
#:use-module (srfi srfi-9 gnu)
#:use-module (srfi srfi-26) #:use-module (srfi srfi-26)
#:use-module (ice-9 match) #:use-module (ice-9 match)
#:export (stream-null stream-cons stream? stream-null? stream-pair? #:export (stream-null stream-cons stream? stream-null? stream-pair?
@ -149,7 +148,7 @@
(define stream? stream-promise?) (define stream? stream-promise?)
(define %stream-null (cons 'stream 'null)) (define %stream-null '(stream . null))
(define stream-null (stream-eager %stream-null)) (define stream-null (stream-eager %stream-null))
(define (stream-null? obj) (define (stream-null? obj)
@ -181,26 +180,6 @@
(define-syntax-rule (stream-lambda formals body0 body1 ...) (define-syntax-rule (stream-lambda formals body0 body1 ...)
(lambda formals (stream-lazy (begin body0 body1 ...)))) (lambda formals (stream-lazy (begin body0 body1 ...))))
(set-record-type-printer! stream-promise
(lambda (strm port)
(display "#<stream" port)
(let loop ((strm strm))
(define value (stream-promise-val strm))
(case (stream-value-tag value)
((eager)
(let ((pare (stream-value-proc value)))
(if (eq? pare %stream-null)
(write-char #\> port)
(let* ((kar (stream-kar pare))
(kar-value (stream-promise-val kar)))
(write-char #\space port)
(case (stream-value-tag kar-value)
((eager) (write (stream-value-proc kar-value) port))
((lazy) (write-char #\? port)))
(loop (stream-kdr pare))))))
((lazy)
(display " ...>" port))))))
;;; Derived stream functions and macros: (streams derived) ;;; Derived stream functions and macros: (streams derived)
(define-syntax-rule (define-stream (name . formal) body0 body1 ...) (define-syntax-rule (define-stream (name . formal) body0 body1 ...)

View file

@ -39,8 +39,7 @@
eager eager
promise?) promise?)
#:replace (delay force promise?) #:replace (delay force promise?)
#:use-module (srfi srfi-9) #:use-module (srfi srfi-9))
#:use-module (srfi srfi-9 gnu))
(cond-expand-provide (current-module) '(srfi-45)) (cond-expand-provide (current-module) '(srfi-45))
@ -77,8 +76,3 @@
;; (*) These two lines re-fetch and check the original promise in case ;; (*) These two lines re-fetch and check the original promise in case
;; the first line of the let* caused it to be forced. For an example ;; the first line of the let* caused it to be forced. For an example
;; where this happens, see reentrancy test 3 below. ;; where this happens, see reentrancy test 3 below.
(set-record-type-printer! promise
(lambda (promise port)
(define content (promise-val promise))
(format port "#<~a ~s>" (value-tag content) (value-proc content))))