Sha256: 77425ee0d2573dd189e967620b9b24c039b0473e32c1d4a3ff3511a66fc8b8e3
Contents?: true
Size: 520 Bytes
Versions: 396
Compression:
Stored size: 520 Bytes
Contents
(define-module (anagram) #:export (anagrams-for)) ;; Credit where credit is due: example borrows heavily ;; from xlisp/anagram (define anagram-equal (lambda (a b) (let ((sorted-string (lambda (s) (apply string (sort (string->list s) char-ci<?))))) (and (string-ci=? (sorted-string a) (sorted-string b)) (not (string-ci=? a b)))))) (define anagrams-for (lambda (subject candidates) (filter (lambda (w) (anagram-equal w subject)) candidates)))
Version data entries
396 entries across 396 versions & 1 rubygems