11 lines
393 B
Text
11 lines
393 B
Text
var words=L(), sz=0; // some state
|
|
fcn isLex(word){ word.reduce(fcn(p,c){ (p<=c) and c or T(Void.Stop,False) }) }
|
|
File("dict.txt").pump(Void,fcn(w){
|
|
w=w.strip(); // get rid of newline
|
|
if(isLex(w)){ n:=w.len();
|
|
if(n>sz){ words.clear(w); sz=n }
|
|
else if(n==sz) words.append(w)
|
|
}
|
|
})
|
|
println("Num words: %d, all size %d\n".fmt(words.len(),sz));
|
|
words.pump(Console.println);
|