开发者

Error in scheme when using cadr

开发者 https://www.devze.com 2023-02-27 00:33 出处:网络
Can anyone clarify what this error means? cadr: expects argument of type <cadrable value开发者_开发问答>; given (1)

Can anyone clarify what this error means?

cadr: expects argument of type <cadrable value开发者_开发问答>; given (1)


cadr means car and cdr. (i.e, return the car of the cdr of a list). Both the following expressions have the same effect:

> (car (cdr '(1 2 3 4)))
2
> (cadr '(1 2 3 4))
2

(cadr '(1)) will fail because (cdr '(1)) evaluates to null.

0

精彩评论

暂无评论...
验证码 换一张
取 消