Annotation of 43BSD/contrib/icon/book/f/tabwords3.icn, revision 1.1.1.1

1.1       root        1: procedure main()
                      2:    a := sort(wordlengths())            # get sorted list
                      3:    i := 0
                      4:    while pair := a[i +:= 1] do
                      5:       write(left(pair[1] || ":",4),right(pair[2],6))
                      6: end
                      7: 
                      8: procedure wordlengths()
                      9:    wchar := &lcase ++ &ucase ++ '\'-'
                     10:    lengths := table(0)
                     11:    while line := read() do {
                     12:       i := 1
                     13:       while j := upto(wchar,line,i) do {
                     14:          i := many(wchar,line,j)
                     15:          lengths[*line[i:j]] +:= 1     # increment count
                     16:          }
                     17:       }
                     18:    return lengths
                     19: end

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.