Questions tagged [hash-tables]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3 votes
1 answer
106 views

Emacs native database for fast key/value access?

I would like to do a key -> value lookup for data that may not fit into memory (or simply avoid the overhead of having to load it an keep it in memory). Does Emacs natively support any kind of ...
ideasman42's user avatar
  • 8,546
1 vote
1 answer
70 views

How to use markers as keys in a hash map?

I'm creating a hash map and I'd like to use markers as keys. I set the hash map equality test to "equal", but the last line from the below code is returning ("bye" "fly") ...
rclark's user avatar
  • 113
1 vote
1 answer
106 views

Access hash table by value, not key?

Q: how can I access a hash table by its value, not its key? Association lists can be accessed via either their key or their value: (setq alist '((a .1) (b . 2) (c . 3))) (assoc 'a alist) ...
Dan's user avatar
  • 32.7k
2 votes
1 answer
290 views

Is there a way to change order of the key in a hashtable?

Say i have following keys in hashtable: "first1" "second2" "third3" "forth4" Is there a way to put key "third3" at the top. So that when i run func hash-table-keys i get following list: ("third3" "...
Sime1's user avatar
  • 31
0 votes
1 answer
89 views

How to define a singe weak reference in elisp?

Hash tables in elisp supports weak references, however weak references may be useful without the need to use a hash. How can a weak reference to an object be defined without having to use a hash-...
ideasman42's user avatar
  • 8,546
0 votes
1 answer
84 views

Helm source from a hash-table

I want to build a helm-source from a large hash-table, is there a smarter/faster way to to this, than the way described below? (setq tab #s(hash-table size 16 test equal ...
gdkrmr's user avatar
  • 175
1 vote
1 answer
430 views

how to implement a simple lookup table in lisp

I want to write an elisp function, when a country name is given, it returns the short code for the country. I've been reading about hash tables, but still not sure how to hashify my data set and make ...
american-ninja-warrior's user avatar
4 votes
3 answers
2k views

Get a better printed representation of a hash-table

I work with ELisp hash-table and I would like to have a better printed representation of it. I'm on Emacs version 24.5.1. When I create a hash-table (setq table (make-hash-table)) (puthash :name "...
dag's user avatar
  • 141
7 votes
1 answer
7k views

Accessing JSON data in elisp

JSON: { "name": "xxxxx", "job": "xxxxxx", "projects": [ { "name": "xxxxx", "date": "xxxxx", "about": "xxxxxxxxxx" }, { "name": "xxxxx", "date": "xxxxx",...
I'm Mo's user avatar
  • 73
4 votes
1 answer
189 views

Does Elisp replay on hash lookups every time code require access to symbol value?

I go across blog post: http://blog.cdleary.com/2010/09/picing-on-javascript-for-fun-and-profit/ It is about JS performance on accessing object properties and tricks that help reduce that time. Usual ...
gavenkoa's user avatar
  • 3,362
2 votes
1 answer
124 views

Insert an entry into hash using put

(defvar-local hash-entries nil) (put 'hash-entries "key" "val") (message "%S" hash-entries) I try to add a key-value pair to the hash variable, hash-entries using the function put. But when i print ...
Madhavan's user avatar
  • 1,977
1 vote
1 answer
180 views

What's the most concise way to make a hash table with data in it?

I'd like to create a hash table with data already in it. I know I can do so as follows: (let ((my-table (make-hash-table))) (puthash 'k1 'v1 my-table) (puthash 'k2 'v2 my-table) (puthash 'k3 '...
zck's user avatar
  • 9,034
7 votes
2 answers
353 views

How to speed up the loading of large hashtables?

As I understand from the manual (last paragraphs of http://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Hash.html) and the question https://stackoverflow.com/questions/11745097/ on ...
Name's user avatar
  • 7,749
1 vote
3 answers
220 views

How to increment several numeric keys of a hash-table

Q: How to programmatically increment several numeric keys of a hash-table. Background: I am working on a modificion of speedbar to support the concept of speedbar-get-marked-files -- speedbar -- ...
lawlist's user avatar
  • 18.9k
0 votes
2 answers
71 views

"Lisp error" when trying to append hash tables to a list

Q:  Is there a way to create one cache that consists of one cons cell and two hash tables? If so, how, please. If not, what is the best way to handle this scenario? Background: I'm working on a ...
lawlist's user avatar
  • 18.9k