开发者

Scheme: how to check if void

I get this error :

cdr: expects argument of type <pair>; given #<void>

and checking if (null? argument) isn't working

I searched开发者_如何转开发 alot for void? function , but I could find anything so , any ideas ppl :)

thanks a million in advance


Just use pair? to see if you can cdr it. There is no specific check for void, since it's essentially a phantom type.


Chris's answer is good because you really want to be checking for a pair to cdr, but for future reference, you may be able to do (eq? (void) (void)) if (void) is available or (eq? (if #f #t) (if #f #t)) if you want to define your own (void).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜