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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Why Clojure?

3 点作者 jchen42超过 4 年前

1 comment

dreamcompiler超过 4 年前
&gt; Clojure provides some advantages over other Lisps like Common Lisp and Scheme: CL only includes lists in its core language spec. Clojure introduces vectors, sets, and maps which makes reading and writing code so much less tedious.<p>CL most assuredly includes vectors and hash tables in its core language spec (not to mention multidimensional arrays). And hash tables are one form of what Clojure calls a map. (The other forms exist in Common Lisp too; they&#x27;re just called different things.)<p><a href="http:&#x2F;&#x2F;www.lispworks.com&#x2F;documentation&#x2F;HyperSpec&#x2F;Body&#x2F;t_vector.htm" rel="nofollow">http:&#x2F;&#x2F;www.lispworks.com&#x2F;documentation&#x2F;HyperSpec&#x2F;Body&#x2F;t_vect...</a><p><a href="http:&#x2F;&#x2F;www.lispworks.com&#x2F;documentation&#x2F;HyperSpec&#x2F;Body&#x2F;18_.htm" rel="nofollow">http:&#x2F;&#x2F;www.lispworks.com&#x2F;documentation&#x2F;HyperSpec&#x2F;Body&#x2F;18_.ht...</a><p>The author may be assuming that because CL does not use the &#x27;[]&#x27; and &#x27;{}&#x27; delimiters, CL doesn&#x27;t implement the things that Clojure uses &#x27;[]&#x27; and &#x27;{}&#x27; for. If so, that assumption is wrong.<p>If the author finds that the use of &#x27;[]&#x27; and &#x27;{}&#x27; make code more readable, that&#x27;s a matter of opinion. It would take about 6 total lines of code to teach CL to read &#x27;[]&#x27; and &#x27;{}&#x27; as a vector or a hash-table if one so desired. And yet over several decades of programming in Common Lisp, I have yet to see a program where a programmer did that. That tells me that working Common Lisp programmers have no difficulty with vectors or hash-tables absent special delimiters.