Mops
Mike's Object-oriented Programming System Version 2.6
Mops is an object-oriented programming system, derived from the Neon language developed by Charles Duff and sold by Kriya, Inc. Kriya have discontinued support for Neon, and have released all the source code into the public domain, retaining only the ownership of the name Neon.
Mops implemented by: Michael Hore
Able assistance from: Doug Hoffman
Greg Haverkamp
Xan Gregg
Documentation updated: Version 2.6, June 1995
Documentation formatted by: Craig Treleaven
Part I
Introduction and Tutorial Printing this document This document is in Microsoft Word Version 5.1 format and uses the fonts Times, Courier, and Helvetica, only. It is formatted using the Laserwriter 7 driver for US Letter paper, portrait orientation, with fractional widths enabled. If you want to print any other way, you will probably need to repaginate and regenerate the table of contents and table of predefined classes and methods. See below.
Almost every paragraph in this document is formatted using a Word style. Formatting is consistent throughout and can be reformatted in moments this way.
Viewing on-line Of course, you can read the whole manual on-screen. Word’s FindÉ command can help to locate items of interest. One other technique is useful but not well known. Use the Outline View and click the “2” in the ruler at the top of the screen. Word will then show the Lessons and the sub-headings within the lessons. Whichever line is at the top of the window in outline view will become the line at the top of the window when you switch back to Normal View. By scrolling in Outline View, you can quickly find the section of interest and position the window for reading in Normal View.
Two-sided printing As shipped, this document is formattted for 2-sided printing to save paper. If you haven’t printed two-sided documents with your printer before, you might want to practise with the first few pages before sending the whole thing. On most printers, you need to use Word’s option to print first the odd numbered pages (in the PrintÉ dialog), reload the paper and then print the even numbered pages.
Single-sided printing If you don’t want to bother with two-sided printing, use the Document dialog and make the Gutter margin zero. If you adjust the Left and Right margins so the printable width is still 6.5 inches, the page breaks should stay in the same places. Blank pages may pop out here and there as all Lessons start on an odd-numbered page.
A4 Paper If you select A4 paper in the Page SetupÉ dialog, the page breaks will change. Regenerate the table of contents, as below. As far as I can tell, the paragraph styles all do the right thing and ajust to the paper width. Well, all except one: the header on odd-numbered pages will extend a quarter inch into the margin because the tab stop is at 6.5 inches. Redefine the Header style to set it to 6.25, if you feel the need.
Table of Contents Use the Table of ContentsÉ dialog to collect headings from level 1 to level 2 for the Table of Contents. Figure captions have Heading 5 style, but I didn’t see a reason to create a table of figures.
Introduction 1
Before you start 1
Backup 2
Using an editor 2
Mops—an object-oriented language 3
Private data 5
A threaded language 5
The Mops dictionary 6
Developing stand-alone applications 6
What your Mops system contains 6
The Bomb box 7
Internet and Web info for Mops 7
Lesson 1 9
How to start up Mops 9
The Mops window 10
The ENTER key 10
Lesson 2 13
More about the stack 13
Arithmetic and the stack 15
Lesson 3 17
Stack notation 17
Mastering postfix notation 19
Lesson 4 21
Mops and OOP 21
Methods and Inheritance 21
Objects and Messages 22
Lesson 5 27
Mapping class-object relationships 27
Defining a class 27
Lesson 6 31
Objects and their messages 31
Summary 33
Lesson 7 35
Modifying a Mops program 35
Lesson 8 37
Predefined classes—an introduction 37
Data structure classes 38
Other predefined classes 39
Lesson 9 41
Defining new Mops words 41
The return stack 42
Named input parameters 42
Local variables 43
Lesson 10 45
Additional math 45
Displaying text 45
Explicit stack manipulations 46
Lesson 11 49
How Mops makes decisions 49
Two alternatives 50
Truths, falsehoods, and comparisons 50
Nested decisions 52
Logical operators 53
The CASE decision 53
Lesson 12 55
Loops 55
Definite loops 55
Nested loops 57
LEAVE 57
Indefinite loops 58
EXIT 59
Lesson 13 61
Mops' fixed-point arithmetic 61
Decimal, hex, and binary arithmetic 62
Signed and unsigned numbers 63
One last set of numbers—ASCII 64
Lesson 14 65
Global constants and values 65
Lesson 15 67
Building a sine table 67
How the sine table works 70
Lines 1-5 70
Line 8 70
Line 11 70
Line 13 70
Line 15 71
Line 16 71
Lines 18-34 71
Lines 36-40 72
Lines 46-66 72
What happens on the stack 73
Lines 71 - 76 75
Lesson 16 77
Building a turtle graphics program 77
Line 3 79
Line 5 79
Lines 7 - 23 79
Lines 25 - 26 80
Lines 28 - 60 80
Lines 62 - 98 82
Lines 100 - 129 82
Lines 131 - 136 83
Experimenting with Turtle 83
Lesson 17 85
Create a mini-Logo language 85
Designing the language 85
Implementing a Logo-like language 86
Lesson 18 89
Inside grDemo 89
Views 90
Positioning views 90
Drawing views—the DRAW: method 93
Lesson 19 95
Windows 95
The grWind class 96
dWind 96
Controls 97
GrDemo scroll bars 98
Scroll bar actions 98
Lesson 20 101
Menus 101
Running the program 102
In summary 103
Lesson 21 105
Installing an application 105
Where to go from here 109
|