class TEST1
  -- stores keys in alphabetical order, without
  -- repetition

creation
  go

feature


go is
  local
    file : STD_FILE_READ
    words : GBN_WORDS
    tree : GBN_RBST [ STRING ]
    it : GBN_ITERATOR [ STRING ]
  do
    if argument_count /= 1 then
      std_error . put_string ( argument(0) + " expects one file argument%N" )
    else
      !! file.connect_to ("retort")
      !! tree.make
      from
        !! words.make
      until
        words.last_word = Void
      loop
        words.get_word (file)
        if words.last_word /= Void then
  	if not tree.has_key (words.last_word) then
  	  tree . add ( words.last_word )
  	end
        end
      end
      from
        it := tree.the_tuple.iterator
      until
        it.finished
      loop
        io . put_string ( it.item + "%N" )
        it . forth
      end
    end
  end

end -- class TEST1
