Sha256: d8c78063de14ba6114ea77dca033be92b144829d5d60317ba1df1952af1fbc6a
Contents?: true
Size: 370 Bytes
Versions: 395
Compression:
Stored size: 370 Bytes
Contents
;;; word-count.el --- word-count Exercise (exercism) ;;; Commentary: ;;; Code: (defun word-count (sentence) (let ((count nil)) (dolist (i (split-string (downcase sentence) "[^a-z0-9]" t)) (let ((n (assoc i count))) (if n (setcdr n (1+ (cdr n))) (push (cons i 1) count)))) count)) (provide 'word-count) ;;; word-count.el ends here
Version data entries
395 entries across 395 versions & 1 rubygems