Scheme procedure problem
- by Zun
I defined the Scheme procedure to return another procedure with 2 parameters :
(define (smooth f)
(?(x dx)(/ (+ (f (- x dx))
(f x)
(f (+ x dx)))
3.0)))
if i run this procedure with sin procedure with 2 arguments 10 and 0.0001 then it is ok
((smooth sin) 10 0.0001) ==> -0.544021109075966
if i run this procedure recursively, then it has error
((smooth (smooth sin)) 10 0.0001)
==> procedure expects 2 arguments, given 1: #<promise:temp6>
So can anyone tell me where is my problem?
Thank you in advance !!!
PS:this is apart of exercise 1.44 in SICP