mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +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:
parent
4a1cdc9d5d
commit
4b76acfa38
2 changed files with 2 additions and 29 deletions
|
@ -27,7 +27,6 @@
|
|||
#:use-module (srfi srfi-1)
|
||||
#:use-module (srfi srfi-8)
|
||||
#:use-module (srfi srfi-9)
|
||||
#:use-module (srfi srfi-9 gnu)
|
||||
#:use-module (srfi srfi-26)
|
||||
#:use-module (ice-9 match)
|
||||
#:export (stream-null stream-cons stream? stream-null? stream-pair?
|
||||
|
@ -149,7 +148,7 @@
|
|||
|
||||
(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? obj)
|
||||
|
@ -181,26 +180,6 @@
|
|||
(define-syntax-rule (stream-lambda formals 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)
|
||||
|
||||
(define-syntax-rule (define-stream (name . formal) body0 body1 ...)
|
||||
|
|
|
@ -39,8 +39,7 @@
|
|||
eager
|
||||
promise?)
|
||||
#:replace (delay force promise?)
|
||||
#:use-module (srfi srfi-9)
|
||||
#:use-module (srfi srfi-9 gnu))
|
||||
#:use-module (srfi srfi-9))
|
||||
|
||||
(cond-expand-provide (current-module) '(srfi-45))
|
||||
|
||||
|
@ -77,8 +76,3 @@
|
|||
;; (*) 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
|
||||
;; 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))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue