Oddbean new post about | logout
 @488cf7e2 This is for my #emacslisp port of Transducers though. CL has with-hash-table-iterator which makes this easy, since I can drive the iteration myself and stop when I want, but I don't see an analog in Elisp. 
 @6adcf666 If it's just about exiting early, this is how you can do it in Elisp:

(catch 'stop
  (maphash
   ;; do you stuff here
   ;; exit when you want    
    (throw 'stop retval)
   ht))
 
 @488cf7e2 @6adcf666 I usually use cl-loop. It uses maphash inside, but it also allows early return with cl-block ... cl-return-from, and a few other nice things.

And cl-block ... cl-return-from is essentially catch ... throw with an autogenerated exception name and lexical scoping. 
 @488cf7e2 Evil, but plausible.