TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Common Lisp - Lazy Evaluation in Tic Tac Toe

57 pointsby alexboweabout 14 years ago

1 comment

mahmudabout 14 years ago
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 未加载