Search code examples
iodesign-by-contracteiffel

Interface of read_character and last_character in STD_FILES


According to a std_files.e that I have found, read_character requires not end_of_file, but it doesn't specify any post-condition; and last_character has no preconditions. Therefore, what happens if you call last_character before calling read_character?


Solution

  • last_character will give a default value '%U' unless there is some unusual code around, e.g. the code that redefines this feature or accesses an object input on STD_FILES and reads something without using STD_FILES, etc.