A Guide to Modula-2 by Kaare Christian

By Kaare Christian

Modula-2 is an easy but robust programming language that's compatible for a large choice of purposes. it truly is in accordance with Pascal, a winning programming language that used to be brought in 1970 by means of Niklaus Wirth. in the course of the 1970's Pascal turned the main commonly taught programming language and it won attractiveness 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 family members among the most important elements of courses. In advert­ dition Modula-2 comprises low-level good points for platforms software­ ming and coroutines for concurrent programming. Programming languages are very important simply because they're used to precise principles. a few programming languages are so restricted that convinced rules cannot be simply expressed. for instance languages that lac okay floating element mathematics are beside the point for clinical com­ putations. Languages similar to easy and Fortran that lack recur­ sion are mistaken for textual content processing or platforms programming. occasionally a programming language is useable for a definite appli­ cation however it is way from excellent. a very good instance is the trouble of writing huge courses in natural Pascal. Pascal is a negative language for big jobs since it lacks amenities for partitioning a application viii Preface 6< ; ~~~~er zero\ Sheet steel Tube /" zero (to Affix Eraser to Shaft) ~ hole wood Shaft A Lead middle determine 1. An exploded diagram. into separate items that may be constructed independently.

Show description

Read or Download A Guide to Modula-2 PDF

Similar programming: programming languages books

Start Here! Learn Microsoft Visual C# 2010 (Developer)

Able to research programming? commence right here! ™Learn the basics of recent programming with visible C# 2010—and commence development your first apps for the laptop and net. when you've got totally no past event, no problem—simply begin the following! This ebook introduces must-know techniques and strategies via easy-to-follow causes, examples, and workouts.

Extra info for A Guide to Modula-2

Example text

Modula-2 provides the usual operations for INTEGERS including addition, subtraction, comparison, multiplication, division, conversion to floating point form, etc. Appendix VI lists the operations that Modula-2 provides for its data TYPES. Modula-2's primary data TYPES include whole numbers, floating point numbers, and characters. More complicated data TYPES include RECORDS, ARRAYS, SETS, POINTERS, enumerations and subranges. 1. Declarations and Variables Modula-2 MODULES and PROCEDURES have two distinct parts: • The declaration part • The statement part Statements in Modula-2 (and most other languages) are used to specify a series of actions.

However you are free to use whatever style you prefer - Modula-2 ignores the appearance (page layout) of a program. In general, line breaks are ignored unless they are necessary to separate one symbol from another. You can't continue a symbol across a line although comments (see below) can range across several lines. The following is the entire donothing program that was alluded to above. MODULE donothing; BEGIN END donothing. 17 "') In the donothing program the first line break doesn't serve any purpose other than to make the program appear attractively.

1. BOOLEAN The BOOLEAN TYPE contains but two values: TRUE and FALSE. There are two roles for BOOLEANS in Modula-2: • To store truth values • To formalize Modula-2's decision making rules I believe that the second role is more important than the first. Anything (CHARS, INTEGERS, strings) could be used to store truth values, the important thing is to have a clear set of rules and opetations for making decisions. BOOLEAN values can come from two types of Modula-2 expresSIOns: • Comparisons of INTEGERS, CARDINALS, CHARS, REALS, BOOLEANS (and other TYPES) yield BOOLEAN values.

Download PDF sample

Rated 4.83 of 5 – based on 35 votes