summaryrefslogtreecommitdiff
path: root/ipl/progs/diffword.icn
blob: 8f94818fc437c806368b7eb0c295e13e4698ffe4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
############################################################################
#
#	File:     diffword.icn
#
#	Subject:  Program to list different words
#
#	Author:   Ralph E. Griswold
#
#	Date:     May 9, 1989
#
############################################################################
#
#   This file is in the public domain.
#
############################################################################
#
#  This program lists all the different words in the input text.
#  The definition of a "word" is naive.
#
############################################################################

procedure main()
   local letter, words, text

   letter := &letters
   words := set()
   while text := read() do
      text ? while tab(upto(letter)) do
         insert(words,tab(many(letter)))
   every write(!sort(words))
end