开发者

Error in scheme when using cadr

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜