mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Removing stray files, ensuring everything is in the tree
This commit is contained in:
parent
560f429926
commit
9354379513
1 changed files with 0 additions and 33 deletions
|
@ -1,33 +0,0 @@
|
|||
(import
|
||||
(scheme base)
|
||||
(srfi 41 primitive)
|
||||
(scheme cyclone test))
|
||||
|
||||
(test-group
|
||||
"srfi 41 (primitive)"
|
||||
(define strm123 (stream-cons 1 (stream-cons 2 (stream-cons 3 stream-null))))
|
||||
(test 1 (stream-car strm123))
|
||||
(test 2 (stream-car (stream-cdr strm123)))
|
||||
(test-not (stream-pair? (stream-cdr (stream-cons (/ 1 0) stream-null))))
|
||||
(test-not (stream? (list 1 2 3)))
|
||||
|
||||
(define iter (stream-lambda (f x)
|
||||
(stream-cons x (iter f (f x)))))
|
||||
|
||||
(define nats (iter (lambda (x) (+ x 1)) 0))
|
||||
|
||||
(test 1 (stream-car (stream-cdr nats)))
|
||||
|
||||
(define stream-add
|
||||
(stream-lambda (s1 s2)
|
||||
(stream-cons (+ (stream-car s1) (stream-car s2))
|
||||
(stream-add (stream-cdr s1)
|
||||
(stream-cdr s2)))))
|
||||
|
||||
(define evens (stream-add nats nats))
|
||||
|
||||
(test 0 (stream-car evens))
|
||||
(test 2 (stream-car (stream-cdr evens)))
|
||||
(test 4 (stream-car (stream-cdr (stream-cdr evens)))))
|
||||
|
||||
(test-exit)
|
Loading…
Add table
Reference in a new issue