Wilfred/ht.el — pull request #1 by rolando2424 (2013-02-24 03:21:32+00:00)
Title: Add `ht-to-alist`, `ht-to-plist` and an optional TEST argument to `hn-create`

Hello,

First of all thank you for creating ht.el. Creating a hash table utility library for emacs has been in my backlog for a while, but I couldn't find the time to package the code that I had written for it. So thank you for implementing most of the functionality I had in my dotemacs. :)

I did notice that you hadn't written an `ht-to-alist` so I added my own.

Since `ht-to-plist` already exists in the form of `ht-items` I made an alias for that.

Also sometimes it's useful to create an hash-table with an #'equalp test, so I added an optional argument TEST to hn-create. If it's not supplied, it uses the #'equal test. So (hn-create) still works the same as before.

Finally since both dash.el and s.el try to avoid the 'cl dependency, I removed the calls to `first` and `second` that you had in ht.el and replaced them with `car` and `cadr`.

There is however a macro that I have in my personal dotemacs that I haven't merged with ht.el mostly because its a bit "heavy" in the syntax, since it tries to emulate the hash syntax of ruby and since it's called just `{}` it breaks the "functions should have their package on its prefix" rule. Also it has a bug that I need to fix.

Here's an example of its use:

```
(gethash '(a b) ({} a => b
c => d
25 => 35
(a b) => (df)))

;;; This returns (df)
```

If you want, I can send you the code for that macro.