DIRECTORY IO USING [STREAM], Rope USING [ROPE]; WordCount: CEDAR DEFINITIONS = BEGIN STREAM: TYPE = IO.STREAM; ROPE: TYPE = Rope.ROPE; CountStream: PROC [s: STREAM, tokenMode: BOOL ¬ FALSE] RETURNS [lines, words, characters: INT]; CountSelection: PROC [tokenMode: BOOL ¬ FALSE] RETURNS [lines, words, characters: INT]; CountRope: PROC [r: ROPE, tokenMode: BOOL ¬ FALSE] RETURNS [lines, words, characters: INT]; CountFile: PROC [file: ROPE, tokenMode: BOOL ¬ FALSE] RETURNS [lines, words, characters: INT]; END. f WordCount.mesa Copyright Σ 1988, 1992 by Xerox Corporation. All rights reserved. Wes Irish, November 9, 1988 4:15:02 pm PST Programmers interface -- WordCount counts the number of lines, words, and characters in a file (or stream, or rope, or selection). Each PROC counts the number of lines, words, and characters from the indicated source. If tokenMode is FALSE (the default) then words are defined to be non-white-space delimited by white-space. If tokenMode is TRUE then words will be delimited in a fashion similar to Cedar tokens. Will return [-1, -1, -1] if there is trouble opening the file. Κ”–"cedarcode" style•NewlineDelimiter ™šœ™Icodešœ Οeœ7™BKšœ'Οk™*J™—šž ˜ Kšžœžœžœ˜Kšœžœžœ˜—K˜KšœΟcl™‚K˜šΟn œžœž œ˜Kšž˜K˜Kšžœžœžœžœ˜Kšžœžœžœ˜K™Kšœ›™›K™Kš  œžœžœ žœžœžœžœ˜_K™Kš  œžœ žœžœžœžœ˜WK˜Kš  œžœžœ žœžœžœžœ˜[K˜š  œžœžœ žœžœžœžœ˜^K™>—K˜Kšžœ˜—Icedar˜—…—