fix stream/c
using generics chaperone property support
This commit is contained in:
parent
d69af6af30
commit
aae35ea3ac
|
@ -962,7 +962,9 @@ lists are checked immediately, as if @racket[c] had been used with
|
||||||
If a contract is applied to a stream, and that stream is subsequently used as
|
If a contract is applied to a stream, and that stream is subsequently used as
|
||||||
the tail of another stream (as the second parameter to @racket[stream-cons]),
|
the tail of another stream (as the second parameter to @racket[stream-cons]),
|
||||||
the new elements will not be checked with the contract, but the tail's elements
|
the new elements will not be checked with the contract, but the tail's elements
|
||||||
will still be enforced.}
|
will still be enforced.
|
||||||
|
|
||||||
|
@history[#:added "6.1.1.8"]}
|
||||||
|
|
||||||
@close-eval[sequence-evaluator]
|
@close-eval[sequence-evaluator]
|
||||||
|
|
||||||
|
|
|
@ -191,8 +191,7 @@
|
||||||
(define (impersonate-stream s first-proc rest-proc . props)
|
(define (impersonate-stream s first-proc rest-proc . props)
|
||||||
(impersonate-generics
|
(impersonate-generics
|
||||||
gen:stream
|
gen:stream
|
||||||
; the struct-info param is a hack, see PR 14970
|
s
|
||||||
(apply impersonate-struct s struct-info (λ (a b) (values a b)) props)
|
|
||||||
[stream-first
|
[stream-first
|
||||||
(λ (stream-first)
|
(λ (stream-first)
|
||||||
(impersonate-procedure stream-first
|
(impersonate-procedure stream-first
|
||||||
|
@ -200,13 +199,13 @@
|
||||||
[stream-rest
|
[stream-rest
|
||||||
(λ (stream-rest)
|
(λ (stream-rest)
|
||||||
(impersonate-procedure stream-rest
|
(impersonate-procedure stream-rest
|
||||||
(λ (s) (values (λ (v) (rest-proc v)) s))))]))
|
(λ (s) (values (λ (v) (rest-proc v)) s))))]
|
||||||
|
#:properties props))
|
||||||
|
|
||||||
(define (chaperone-stream s first-proc rest-proc . props)
|
(define (chaperone-stream s first-proc rest-proc . props)
|
||||||
(chaperone-generics
|
(chaperone-generics
|
||||||
gen:stream
|
gen:stream
|
||||||
; the struct-info param is a hack, see PR 14970
|
s
|
||||||
(apply chaperone-struct s struct-info (λ (a b) (values a b)) props)
|
|
||||||
[stream-first
|
[stream-first
|
||||||
(λ (stream-first)
|
(λ (stream-first)
|
||||||
(chaperone-procedure stream-first
|
(chaperone-procedure stream-first
|
||||||
|
@ -214,7 +213,8 @@
|
||||||
[stream-rest
|
[stream-rest
|
||||||
(λ (stream-rest)
|
(λ (stream-rest)
|
||||||
(chaperone-procedure stream-rest
|
(chaperone-procedure stream-rest
|
||||||
(λ (s) (values (λ (v) (rest-proc v)) s))))]))
|
(λ (s) (values (λ (v) (rest-proc v)) s))))]
|
||||||
|
#:properties props))
|
||||||
|
|
||||||
;; Stream contracts ----------------------------------------------------------------------------------
|
;; Stream contracts ----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user