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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

A fast Lisp interpreter in Dart

64 点作者 suzuki将近 10 年前

3 条评论

suzuki将近 10 年前
This article is an English translation of <a href="http:&#x2F;&#x2F;www.oki-osk.jp&#x2F;esc&#x2F;dart&#x2F;lisp.html" rel="nofollow">http:&#x2F;&#x2F;www.oki-osk.jp&#x2F;esc&#x2F;dart&#x2F;lisp.html</a> which was introduced at <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9433114" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9433114</a> as &quot;Lisp in 1,200 lines of Dart.&quot;<p><pre><code> $ curl -R -O http:&#x2F;&#x2F;www.oki-osk.jp&#x2F;esc&#x2F;dart&#x2F;lisp&#x2F;lisp-27-05-08.tar.bz2 $ tar xf lisp-27-05-08.tar.bz2 $ cd lisp-27-05-08 $ dart lisp.dart &gt; (dump) (dotimes dolist while nconc last nreverse _nreverse assoc assq member memq listp or mapcar and append _append letrec let when if equal &#x2F;= &lt;= &gt;= &gt; setcdr setcar null = identity print consp not cdddr cddar cdadr cdaar caddr cadar caadr caaar cddr cdar cadr caar defun defmacro *version* dump exit apply symbol-name intern make-symbol gensym *gensym-counter* terpri princ prin1 truncate &#x2F; - * + mod % &lt; eql numberp stringp length rplacd rplaca list eq atom cons cdr car) &gt;</code></pre>
评论 #9904100 未加载
aidenn0将近 10 年前
&gt; Nevertheless, this defect is largely harmless because Common Lisp separates the name space into one for functions and one for variables. In other words, it can be said that the existence of this defect has been justified the separation of name spaces which has made the semantics of the Common Lisp language complex unnecessarily<p>One note on variable capture in Common Lisp; while it is true that a lisp-2 runs into the issues somewhat less often than a lisp-1, the existence of FLET and LABELS should let people know that it doesn&#x27;t solve the problem.<p>The real solution to this in Common Lisp is packages.<p><pre><code> (in-package foo) (defun bar () (do-something)) (defmacro baz (x) `(bar ,x)) (in-package quux) (flet ((bar () (do-something-else))) (baz 2)) ; calls foo::bar not the bar bound in above FLET </code></pre> Also, many people like that Common Lisp has two namespaces because there are many identifiers that are useful as both nouns and verbs (e.g. LIST).
评论 #9907777 未加载
erikb将近 10 年前
Anybody know that game where you write a program that can print itself? Are there games where a program interprets code from another language so well it can interpret an interpreter that can interpret its code? (interpreterA is written in langA, it can run interpreterB written in langB, which is able to run enough of langA to run interpreterA)
评论 #9904222 未加载