RosettaCodeData/Task/Ordered-words/Oforth/ordered-words.oforth
2016-12-05 23:44:36 +01:00

9 lines
266 B
Text

: 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 ;