(require srfi/13) (foldl (lambda (word hash) (let [(current-value (hash-ref hash word 0))] (hash-set hash word (add1 current-value)))) (make-immutable-hash '()) ; feed in the separated words (string-tokenize (port->string (current-input-port))))