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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Java.next() - Clojure: The Return of the Lispers

79 点作者 bozhidar大约 14 年前
The third chapter of Java.next() series. A glance at the Clojure programming language, a modern Lisp-1 dialect for the JVM and .Net.

4 条评论

efsavage大约 14 年前
I'd love to be sold on a new language, but using it by showing me ridiculous examples of a language I know reduces the credibility of the seller. It's an otherwise good looking article but when I see this:<p><pre><code> public boolean hasUpperCase(String word) { if (word == null) { return false; } int len = word.length(); for (int i = 0; i &#60; len; i++) { if (Character.isUpperCase(word.charAt(i))) { return true; } } return false; } </code></pre> Where it should be this:<p><pre><code> public boolean hasUpperCase(String word) { return word != null &#38;&#38; word.matches(".*[A-Z]+.*"); } </code></pre> It casts doubt on the other examples. I'm not saying Java isn't a verbose language that can get tedious, but let's use some decent examples.
评论 #2553286 未加载
评论 #2553624 未加载
评论 #2553856 未加载
评论 #2553787 未加载
评论 #2553356 未加载
评论 #2553456 未加载
评论 #2553928 未加载
评论 #2553557 未加载
评论 #2553288 未加载
评论 #2555170 未加载
dotcomsmarties大约 14 年前
I've been coding Java/Python for 10+ years (C/C++ before that), and recently started on Clojure a few months ago. I'm having trouble grokking Clojure since I'm not a Lisp guy, but after stumbling around like a blind rat I find that Clojure's syntax is quite extraordinary. I hope Clojure will become more mainstream as more people use them, and creates more tutorials for a layman like me.
d0m大约 14 年前
I feel like when people are comparing languages, they are exaggerating.. For instance:<p><pre><code> public boolean hasUpperCase(String word) { if (word == null) { return false; } int len = word.length(); for (int i = 0; i &#60; len; i++) { if (Character.isUpperCase(word.charAt(i))) { return true; } } return false; } or public boolean hasUpperCase(String word) { if (null != word) return any(charactersOf(word), new Predicate() { public boolean apply(Character c) { return isUpperCase(c); } }) else return false; }</code></pre>
评论 #2553040 未加载
th0ma5大约 14 年前
I've been playing a lot with Kawa (Scheme) for Java, it's rather nice.
评论 #2554383 未加载
评论 #2554754 未加载