Workshop on Scheme

Exercises: Friday, July 21


Define a Scheme procedure that takes as argument a string that is the name of an existing and readable text file and returns the number of characters in that file. (In accordance with Unix tradition, the newline character counts as one character. The eof-object should not be counted as a character, however.)


Define a Scheme procedure that takes as argument an input port and reads in one line, returning all the characters except the final newline as a string. (In other words, the procedure should read in characters and append them to the result string until a newline character is encountered; the newline should be read, but not appended to the result string.)


I finished only about half of the ``familiar algorithms'' that I originally proposed to provide for the workshop. Define and test Scheme code implementing any of the algorithms that are not yet available (e.g., shortest-path algorithms, generators for permutations, combinations, and samples, Huffman encoding). Add commentary and HTML markup to obtain a WWW page presenting your implementation of the algorithm.


This document is available on the World Wide Web as

http://www.math.grin.edu/~stone/events/scheme-workshop/Friday-exercises.html


created July 20, 1995
last revised July 20, 1995

John David Stone (stone@math.grin.edu)