Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在方案中有这个代码:
(define (calculate-mark MidTerm FinalExam Assignment Clicker) (lambda(MidTermWeight) (/(* 3 MidTerm)10) (display MidTermWeight)) )
现在,当我通过以下方式调用此函数时:
(calculate-mark 10 10 10 10)
它显示了这一点:
#<procedure>
为什么它没有显示任何结果?
在 Scheme 中,您可以定义这样的函数
(define (foo bar) ...)
或者
(define foo (lambda (bar) ...))
但是你已经完成了这两个过程,所以你的过程返回另一个过程:(lambda (midtermWeight)...。你必须用中量级再次调用它才能得到结果。
(lambda (midtermWeight)...