Paste number 50081: ClusterBy

Paste number 50081: ClusterBy
Pasted by: slobodan
When:2 years, 3 months ago
Share:Tweet this! | http://paste.lisp.org/+12N5
Channel:None
Paste contents:
Raw Source | XML | Display As
(defun cluster-by (f l)
  (loop with r = (make-hash-table)
    for e in l do  (push e (gethash (funcall f e) r))
    finally (return (loop for v being the hash-values of r collect v))))

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.