這是SICP中的一個示例,我輸入它但出現錯誤。 (define (sum term a next b)
(if (> a b)
0
(+ (term a)
(sum term (next a) next b))))
這是錯誤: function call: expected a function after the open parenthesis
我是功能語言的新手,我正在使用Racket進行SICP編程任務。 下面的代碼片段,以及球拍告訴我說define: expected only one expression for the function body, but found 5 extra parts,在第5行((define (y k)): (define (simpson f a b n)
(define h (/ (- b
有一種叫lambda演算的簡單語言,它是方案的一個子集。它在下面只有4個表達式。 exp : n (1 2 3)
varref (variable reference)
(lambda (x) body) (this is a procedure)
(procedure argument) (this is a application which applies argument as re