RosettaCodeData/Task/Anagrams/PicoLisp/anagrams-2.l
2023-07-01 13:44:08 -04:00

8 lines
278 B
Text

(let Words NIL
(in "unixdict.txt"
(while (line)
(let (Word (pack @) Key (pack (sort @)))
(if (idx 'Words Key T)
(push (car @) Word)
(set Key (list Word)) ) ) ) )
(flip (by length sort (mapcar val (idx 'Words)))) )