fork download
  1. ;; (import (chicken bitwise))
  2. (define (popcount d)
  3. (define (aux acc d)
  4. (if (= d 0)
  5. acc
  6. (aux (+ acc (bitwise-and d 1)) (arithmetic-shift d -1))))
  7. (aux 0 d))
  8. (define f
  9. (compose popcount char->integer))
  10. (print (f #\a))
  11.  
Success #stdin #stdout 0.01s 7908KB
stdin
Standard input is empty
stdout
3