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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: Am I missing the Lisp magic?

15 点作者 syberslidder超过 12 年前
I grew up coding in C and the many languages it inspired syntactically. I am currently learning some Erlang, which is cool. I for one can not understand the draw to Lisp or its syntax. It just looks confusing to me and in no way any easier than C to write/read. And looking at C-ish source code is effortless to get the right context but with stuff like )))))) ?? Someone explain please, also I understand some people like Lisp for some of its features, but are they tied to the syntax or can be easily copied over in another language? Also I know why functional programming so lets keep the discussion on the Syntax!

6 条评论

magnusjonsson超过 12 年前
If you are looking at the ))))) you are looking at the wrong place. It's like placing your attention on the } } } } in C. Look at the opening parenthesis instead, and more importantly <i>the indentation</i>.<p>The benefit of S-expressions (lisp syntax) is that they make it easy to work with "code as data" instead of "code as text". This in turn makes it easy enough to generate code and define new forms of expression that people can actually do it without blowing the complexity budget.
评论 #4994732 未加载
michaelsbradley超过 12 年前
Another point is that when programming in a Lisp, it's highly recommended to use an editor/IDE that automatically handles the balancing of parentheses and provides keyboard shortcuts for common transformations of s-expressions.<p>For my day-to-day work with Clojure, Emacs and Paredit[1] meet that need handily.<p>[1] <a href="http://emacswiki.org/emacs/ParEdit" rel="nofollow">http://emacswiki.org/emacs/ParEdit</a><p>See also the Paredit CheatSheet: <a href="http://www.emacswiki.org/emacs/PareditCheatsheet" rel="nofollow">http://www.emacswiki.org/emacs/PareditCheatsheet</a>
michaelsbradley超过 12 年前
An important aspect of the "Lisp magic" is the language's homoiconicity[1].<p>Scheme, Clojure and other members of the Lisp-family share this language property, but it's not exclusive to lisps[2].<p>[1] <a href="http://en.wikipedia.org/wiki/Homoiconicity" rel="nofollow">http://en.wikipedia.org/wiki/Homoiconicity</a><p>[2] <a href="http://en.wikipedia.org/wiki/Homoiconicity#Examples" rel="nofollow">http://en.wikipedia.org/wiki/Homoiconicity#Examples</a>
debacle超过 12 年前
You can implement the functional aspects of lisp in almost any language, however S-expressions are only present in a very limited number of programming languages.
orangethirty超过 12 年前
Have you ever written anything with it?
rman666超过 12 年前
(no)