开发者

Why isn't this Do Form valid?

I'm new to Common Lisp. I tried out the following do form:

(do ((n 0 (+ n 1)))
    (< n 10)
    (print n))

Clisp responds with:

*** - IF: variable < has no value

From my understanding, the do form is as follows:

(do (<lexically scoped variables> [per-iteration-expression])
    (end-expression)
    <statements&开发者_如何学Gogt;)

Where's the error in my understanding of this?


Forgive me, my Lisp is rusty, but shouldn't that be a >? And then shouldn't it be ((> n 10))? (Two parens, not one. You need something evaluated there).

This could be completely wrong, but that would be my next try.


According to this (random Google search result), the second term should be ((end-expression) return-value).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜