Skip to content

Instantly share code, notes, and snippets.

@ejbs
Last active August 29, 2015 13:56
Show Gist options
  • Save ejbs/8924773 to your computer and use it in GitHub Desktop.
Save ejbs/8924773 to your computer and use it in GitHub Desktop.
(defun read-hash-list (stream)
(read-delimited-list #\} stream))
(defun make-read-hash-table (stream char)
(declare (ignore char))
(let ((a-list (read-hash-list stream))
(ht (make-hash-table)))
(assert (evenp (length a-list)))
(loop for i = 0 then (+ i 2) until (= i (length a-list))
do (setf (gethash (elt a-list i) ht)
(elt a-list (1+ i))))
ht))
@johnwalker
Copy link

The issue is when you actually try using this - there's some extra setup that you have to do to make it work correctly.

{"a" 'b}| C-x C-e => B}

@ejbs
Copy link
Author

ejbs commented Feb 11, 2014

It's really just a minor bug that can be fixed during execution of read-hash-list. I knew about it but didn't really care enough to fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment