开发者

Not sure what this line does

(or (parse-integer (prompt-read "Rating") :junk-allowed t) 0)

This line confuses me quite a bit. the full program is here if you need it to follow: http://paste.lisp.org/display/124929

'Parse-integer' will turn a string into and integer right? if possible. And ':junk-allowed t' makes it开发者_高级运维 accept junk strings somehow right?

Not sure what the 'or' and the 0 at the end are though.

Thanks.


or goes through the forms passed to it, evaluates them in order until it finds one that does not evaluate to nil, and returns that result. So this will return the result of parse-integer if that call succeeds in parsing an integer, or 0 if not.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜