84 words
1 minute
scheme-1.3.1
Some information may be outdated
过程作为参数
- 前面遇到的函数参数是数值、数据,而现在参数可以是动作,规则,逻辑。
(define (sum term a next b) (if (> a b) 0 (+ (term a) (sum term (next a) next b))))- 当调用过程
(sum + a inc b)时,参数term绑定到了+过程,参数next绑定到了inc过程。
scheme-1.3.1
https://infini.cv/posts/scheme/scheme-131/