这是我写的高阶函数,用到惰性
(define (stream-delay expr)
(lambda ()
expr))
(define (stream-force delayed)
(delayed))
(define (stream-car stream) (car stream))
(define (stream-cdr stream) (stream-force (cdr stream)))
(define (cons-stream a b) (cons a (stream-delay b)))
(define (stream-map proc stream)
(if (null? stream)
'()
(cons-stream (proc (stream-car stream))
(stream-map proc (stream-cdr stream)))))
调用(stream-map square '(1 2 3 4))
时,他给我返回一个错误
Exception: attempt to apply non-procedure (2 3 4) Type (debug) to enter the debugger.
这是怎么一回事??