TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Common Lisp - Lazy Evaluation in Tic Tac Toe

57 点作者 alexbowe大约 14 年前

1 comment

mahmud大约 14 年前
The DO clause of LOOP has an implicit progn[1], no need to do it explicitly.<p>Don't be clever with FLET/LABELS, 99% of the time you're doing it out of some vague "information hiding" principle. 99% of the time you end up making it a toplevel function, since local functions just make debugging harder.<p>A lot of (if (= x 1) ..) and (if (= x 0)) .. type forms are usually a sign you need a readable predicate. (when (foo-p &#60;expr&#62;) .. body)<p>Array this, array that. Wrap the BOARD type already. You can use classes and structs. This is not Scheme.<p>Excessive use of REDUCE and LAMBDA is a sign of Schemish hacking. Again, Common Lisp is neither C nor Scheme. The code uses MAP &#38; REDUCE half the time, then AREF, LOOP and SETF the other half. FP-purism is the root cause of code schizophrenia like this. Try to write <i>pronounceable</i> code -- well, relatively speaking.<p>--<p>Ohboy, looking at hyperspec I don't see this spelled out, but it works that way, at least when do is the last/only clause.
评论 #2506066 未加载