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.

Data Structures in Clojure: Hash Tables

74 pointsby defectover 11 years ago

4 comments

Jachover 11 years ago
I love these posts. Even though I'd never use this in production, it's an excellent intro to the same basic data structure taught everywhere. But instead of mucking with a templated C++ implementation (or getting lost in the "plain cons cells for everything!" weeds)... Clojure! It also shows that as much as idiomatic Clojure frowns on OOP and mutability... it's not really that unpleasant to read. I almost want to go through all my old C++ assignments and redo them in Clojure like this.
评论 #7187983 未加载
vinkelhakeover 11 years ago
&gt; On the machine this was implemented, insertion speed increased ~110x, compared with the non-hinted implementation.<p>That makes it sound like type hints are essentially mandatory for anything where performance matters.<p>Nice article! It would have been interesting to see how it fares against something like java.util.HashMap.
评论 #7179281 未加载
评论 #7179027 未加载
评论 #7179282 未加载
copxover 11 years ago
Where is the definition of the actual hash function? That is the interesting and tricky part of a hash table. Is &quot;hash&quot; a Clojure built-in?
评论 #7179377 未加载
the_frenchover 11 years ago
Very nitpicky but I find the ligatures on all the &quot;t&quot; characters very distracting.<p>Additionally, I don&#x27;t know Closure, but are there any default hash-table implementations? If so, how does this implementation compare against the base one?
评论 #7179431 未加载