how is the sicp cons-stream implemented?

前端 未结 2 459
悲&欢浪女
悲&欢浪女 2021-01-03 03:32

I\'m working through the streams section of the scip and am stuck on how to define a stream.

The following is my code:

(define (memo-func function)
          


        
2条回答
  •  时光取名叫无心
    2021-01-03 04:20

    You cannot define delay as a function, since prior to calling it, Scheme will evaluate its argument - which is exactly what you're trying to postpone. SICP says this explicitly that delay should be a special form.

提交回复
热议问题