Download A Guide to Modula-2 by Kaare Christian PDF

By Kaare Christian

Modula-2 is a straightforward but strong programming language that's compatible for a large choice of functions. it really is in keeping with Pascal, a winning programming language that used to be brought in 1970 via Niklaus Wirth. throughout the 1970's Pascal grew to become the main extensively taught programming language and it received reputation in technological know-how and undefined. In 1980 Dr. Wirth published the Modula-2 software­ ming language. Modula-2 is an evolution of Pascal. It improves at the successes of Pascal whereas including the MODULE - a device for ex­ urgent the relatives among the most important components of courses. In advert­ dition Modula-2 comprises low-level beneficial properties for platforms software­ ming and coroutines for concurrent programming. Programming languages are vital simply because they're used to specific principles. a few programming languages are so restricted that yes rules cannot be simply expressed. for instance languages that lac ok floating aspect mathematics are irrelevant for medical com­ putations. Languages corresponding to uncomplicated and Fortran that lack recur­ sion are fallacious for textual content processing or platforms programming. occasionally a programming language is useable for a undeniable appli­ cation however it is way from perfect. a very good instance is the trouble of writing huge courses in natural Pascal. Pascal is a terrible language for big jobs since it lacks amenities for partitioning a software viii Preface 6< ; ~~~~er zero\ Sheet steel Tube /" zero (to Affix Eraser to Shaft) ~ hole wood Shaft A Lead center determine 1. An exploded diagram. into separate items that may be constructed independently.

Show description

Read Online or Download A Guide to Modula-2 PDF

Similar programming: programming languages books

Additional resources for A Guide to Modula-2

Example text

Thus comments don't count as a basic symbol- they are just a soapbox for programmers. White space consists of spaces, tabs, or line breaks. It doesn't count as a basic symbol type; it only serves to separate one symbol from another. When two adjacent symbols are both composed of alphanumeric (letters and numerals) characters then they must be separated by white space: spaces, tabs, or line breaks. 13 *) Part I. 24 ('" Example 1. 14 "') MODULEdonothing; When a punctuation symbol is next to an alphanumeric symbol then white space separating them is optional.

4 *) (* Capitalize text *) MODULE Caps; FROM InOut IMPORT Read, Write, Done; VAR ch CHAR; BEGIN Read( ch) ; WHILE Done DO IF (ch )= 'a') AND (ch <= 'z') THEN Write( CAP( ch» ELSE Write( ch) END; (* IF *) Read(ch) END (* WHILE *) END Caps. 12. Modify Caps to avoid using the CAP PROCEDURE. 13. Write a program to discover what CAP returns when it is passed something other than a letter. Try a digit, a punctuation symbol, and a control character. Note that this is an exploratory exercise, it is not wise to write a program that relies on this behavior.

A set of operations that are performed each time the PROCEDURE is invoked. 3. The parameters (if any) that are passed to the PROCEDURE and the value (if any) that is returned from the PROCEDURE. • A MODULE declaration defines: 1. A group of local declarations. The variables in a MODULE are created whenever the surrounding scope of the MODULE is activated. 2. A set of operations that are performed whenever the surrounding scope of the MODULE is activated. 3. The IMPORTS and EXPORTS of the MODULE.

Download PDF sample

Rated 4.14 of 5 – based on 39 votes