通常在方案中 - syntax: (if test consequent alternate)
。如果條件下的方案運行
我試圖在consequent
部分中執行一些操作,例如:如果爲true,則將sum1設置爲44並返回1。
在Scheme代碼的 -
(if #t (
(set! sum1 44)
(if #t 1)
))
上面的代碼不工作了,並提示 -
application: not a procedure;
expected a procedure that can be applied to arguments
given: #<void>
arguments...:
1
看到我的最新答案的替代解決方案這個問題 –