Arc Forumnew | comments | leaders | submitlogin
3 points by palsecam 3979 days ago | link | parent

FTR, 'hist could be just:

  (def hist (seq)
    (w/table h
      (each n seq
        (++ (h n 0)))))
I just learned about 'w/table reading your post, and I checked, and it returns the created hash. This is quite smart, I often find myself doing things like:

  (let h (table)
    ...  ; do stuff with h
    h)  ; return it
Where it's actually possible to do:

  (w/table h
    ...)  ; implicit return of "h"
But yes, here, use 'counts.