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.

Immutable Persistent Data Structures in Common Lisp

48 pointsby postfuturistalmost 13 years ago

5 comments

arohneralmost 13 years ago
&#62; They can be useful for certain constructions, but they don’t really enable anything amazing that you can’t do otherwise, just with a slightly different algorithm.<p>One really nice property of laziness is dealing with data larger than RAM. A couple of months ago I wrote some ML processing of the wikipedia XML in Clojure. In about 5 lines, I had a lazy sequence of every &#60;Article&#62; tag from the XML. Then I can (map my-fn all-articles-from-wikipedia), without blowing the heap (the wikipedia XML was like ~10GB, zipped).<p>Yes, it's possible to do non-lazy, but this was cleaner and simpler.<p>One algorithmic advantage of lazy seqs is that (map foo (map bar (map baz my-big-seq))) makes only one pass over the data, as opposed to 3 when non-lazy.
评论 #4277409 未加载
ScottBursonalmost 13 years ago
Historical note: FSet was inspired by a language called Refine, which was in turn inspired by SETL, created in the late 1970s at NYU. As far as I know, SETL was the first language to have functional collection types (does anyone know for sure?).<p>Anyway, some of the operation names used in FSet -- 'with', 'less', and 'arb', for example -- can be traced back to SETL.<p>SETL also appears to have been the first language with what are now called "comprehensions" (it used the term "formers") to construct collections declaratively. For example,<p><pre><code> { x ** 2 : x in {1 .. 5} } </code></pre> would produce a set of the squares of the integers from 1 through 5. (Does anyone know of an earlier language with these?)
评论 #4276577 未加载
enduseralmost 13 years ago
This is primarily a blog post about the FSet library for Common Lisp, available at <a href="http://common-lisp.net/project/fset/" rel="nofollow">http://common-lisp.net/project/fset/</a>
评论 #4276262 未加载
评论 #4276268 未加载
jacobolusalmost 13 years ago
A bit off topic, but I found the radioactive syntax highlighting and bold-everything in the code samples extremely distracting and hard to read. I would recommend sticking to dark-on-light code when it’s in the middle of dark-on-light text.
评论 #4278281 未加载
thyrsusalmost 13 years ago
Could someone help me with the "thread" example at the end? Something in my shallow understanding seems wrong:<p>"Threads in Clojure give access to concurrent processing."<p>"Nothing in the recursive (defmacro -&#62; ...) starts a parallel process."
评论 #4279354 未加载