RosettaCodeData/Task/Ordered-words/Oforth/ordered-words.fth
2023-07-01 13:44:08 -04:00

9 lines
266 B
Forth

: longWords
| w longest l s |
0 ->longest
File new("unixdict.txt") forEach: w [
w size dup ->s longest < ifTrue: [ continue ]
w sort w == ifFalse: [ continue ]
s longest > ifTrue: [ s ->longest ListBuffer new ->l ]
l add(w)
] l ;