Modula-2 Reloaded

A Modern Typesafe & Literate Programming Notation

Site Menu

Project

Specification

Implementation

Recommendations

Reference

Needs Updating

Work in Progress

Wastebasket

Wiki Manual

edit SideBar

Terminal

Spec.Terminal History

Hide minor edits - Show changes to markup

2010-05-24 12:39 by benjk -
Changed lines 3-11 from:

PROCEDURE Read (VAR theItem : <anyType>); (* This is a macro that the compiler expands to Type Of? (theItem).Read (Std IO.Std In File? (), theItem) *) (* Pre: theItem.Read is visible in the requesting scope *) (* Post: theItem is read from the currently defined standard output file and assigned to theItem *)

PROCEDURE Write (theItem : <anyType>); (* This is a macro that the compiler expands to Type Of? (theItem).Write (Std IO.Std Out File? (), theItem) *) (* Pre: theItem.Write is visible in the requesting scope *) (* Post: theItem is written to the currently defined standard output file *)

to:

(* Basic Terminal-based IO *)

PROCEDURE Read ( VAR ch : CHAR ); (* Reads one character from stdIn and passes it back in <ch>. *)

PROCEDURE Write ( ch : CHAR ); (* Writes character <ch> to stdOut. *)

PROCEDURE Read String? ( VAR s : ARRAY OF CHAR ); (* Reads a character sequence terminated by Newline from stdIn

   and passed it back in s. *)

PROCEDURE Write String? ( CONST s : ARRAY OF CHAR ); (* Writes character string s to stdOut. *)

PROCEDURE Write Ln?; (* Writes Newline to stdOut. *)