Index: m3/pm3/database/src/index.html diff -c /dev/null m3/pm3/database/src/index.html:1.1.1.1 *** /dev/null Tue Feb 10 23:28:18 1998 --- m3/pm3/database/src/index.html Sat Jan 31 14:47:09 1998 *************** *** 0 **** --- 1,33 ---- +
+Database and persistent storage related libraries and applications. +
+ A persistent stable object logs all updating method calls and stores + checkpoints of the current state from time to time. The current state + may be recovered by reading the last checkpoint and replaying the log + since the last checkpoint. + +
+ A persistent object may be derived automatically from an existing object type + simply by identifying the selected object type in the m3makefile. +
2D and 3D graphical animation libraries and applications. +
An interface to Display Postscript for platforms supporting it. +
FormsVBT is a high level library to develop graphical user interfaces. + The user interface description is developed separately from the application, + using formsedit, and connected at run time through symbolic names. +
Small graphical games to demonstrate graphical libraries. +
General purpose graphical libraries from low level X11 access to + high level widgets and 3D graphics. +
+ Mark S. Manasse, Greg Nelson +
+ December 1991 +
+
+ Systems Research Center+
+
+
+
+
+
+
+
+
+
+
+
+
+ This is a reference manual for Trestle, a Modula-3 toolkit for the X + window system. Trestle is a collection of interfaces structured + around a central abstract type: a "virtual bitmap terminal" or VBT, + which represents a share of the workstation's screen, keyboard, and + mouse---a thing comparable to the viewers, windows, or widgets of + other systems. +
+ Trestle is included in SRC Modula-3 version 2.0, which is available + via public ftp. +
+ Trestle includes a fairly standard set of interactors, including + menus, buttons, "container" classes that provide overlapping or tiled + subwindows, and "leaf" windows that display text or other data. This + reference manual also specifies the interfaces that allow you to + create your own window classes. Knowledge of X is not required. +
+ A Trestle window is an object whose behavior is determined by its + methods. For example, a window's response to a mouse click is + determined by calling its mouse method. This is fast becoming the + standard architecture for toolkits, but Trestle carries it further + than most. For example, you can change the way a Trestle window paints + by overriding its paint method; this is useful for sophisticated + effects like groupware. +
+ Trestle provides a novel strategy for writing applications that are + independent of the type of display screen they are running on. For + example, it is easy to write a Trestle application that can be moved + back and forth between a color display and a monochrome display where + the application will look good on both. + + Index: m3/pm3/graphics/gr-libs/ui/src/html/ack.html diff -c /dev/null m3/pm3/graphics/gr-libs/ui/src/html/ack.html:1.1 *** /dev/null Tue Feb 10 23:28:45 1998 --- m3/pm3/graphics/gr-libs/ui/src/html/ack.html Sat Jan 31 16:29:16 1998 *************** *** 0 **** --- 1,32 ---- +
+ "There are lots of interesting + problems in window systems", said Butler Lampson to Greg Nelson in + April, 1984; and he was right. Nelson was enticed into the design + meetings for the new window system for the Firefly multiprocessor at + SRC. In 1984 most of the discussions were about what came to be called + the event-time protocol, and besides Lampson and Nelson the main + participants were Mark R. Brown, Jim Horning, and Lyle Ramshaw. Mark + Brown and Greg Nelson wrote the first version of the VBT interface. +
+ Mark Manasse joined SRC in 1985, and he and Nelson finished the design + and implementation of the first version of Trestle (then called + Trellis), which they shipped for use at SRC on December 31st, 1985. +
+ Trestle evolved for five years, improving under feedback from the + projects that built upon it, notably Luca Cardelli's Dialog Editor, + Mark R. Brown's Ivy text editor, Marc H. Brown's FormsVBT system, + Patrick Chan's session manager Rooms, and a number of applications + built by Andrew Birrell. Bob Ayers's Facade system spurred the Trestle + team into performance work that otherwise might never have been + undertaken. +
+ In 1990 and 1991, Steve Glassman, Mark Manasse, and Greg + Nelson overhauled Trestle to make it into the portable Modula-3 X + toolkit described in this reference manual. We are grateful to the + Modula-3 export sites that used the alpha-test version of the system + released in January 1991; special thanks for the helpful feedback from + Dave Goldberg, Norman Ramsey, Jim Meehan, and Marc H. Brown. Finally, + we thank Patrick Chan, James Mason, and Jim Horning, who carefully + read the entire reference manual and made many helpful suggestions. Index: m3/pm3/graphics/gr-libs/ui/src/html/filters.html diff -c /dev/null m3/pm3/graphics/gr-libs/ui/src/html/filters.html:1.2 *** /dev/null Tue Feb 10 23:28:45 1998 --- m3/pm3/graphics/gr-libs/ui/src/html/filters.html Tue Feb 10 22:27:50 1998 *************** *** 0 **** --- 1,21 ---- + +
++ This report is a programmer's reference manual for Trestle, a Modula-3 + window system toolkit. +
+ Trestle has been implemented over two + underlying window systems: X [XSpec] + and the native Firefly [Firefly] window system + developed at SRC. Other implementations are possible, but at + present the only widely available implementation is Trestle-on-X. +
+ To use Trestle-on-X, you need a Modula-3 compiler and an X server for + your system. The Trestle code is an application library layered on top + of Xlib, the standard X client library. Trestle applications obey X's + ICCCM protocol for cooperating with the window manager and other + applications, so you can use your favorite window manager and mix + Trestle applications freely with other X applications. +
+ The reference + manual is self-contained but non-tutorial; you would do well to read + the Trestle Tutorial first [TTut] + (Chapter 7). + We assume you are familiar with Modula-3 [M3a] + [M3b] [M3c] . +
+ The Trestle abstraction. A + Trestle.T is a connection to a window system. The window system is + assumed to have a keyboard, a pointing device, and one or more display + screens. For example, in Trestle-on-X, a Trestle.T is implemented by a + connection to an X server. +
+ Each screen is a raster display, whose + image is stored in a frame buffer containing a rectangular array of + pixels. Changing the contents of a frame buffer is called painting , + since it changes the image displayed to the user. The different + screens can be of different types (e.g., color or black and white). +
+ Trestle imposes an hv-coordinate system on each display screen, in + which the h coordinate increases from left to right and the v + coordinate increases from top to bottom. The Trestle interface allows + you to determine the number of screens and also their types, + dimensions, and the positions of their coordinate origins. +
+ We will + call the pointing device the mouse, although it might be a stylus or + other instrument. The mouse generally has one or more buttons that the + user can click down and up. +
+ The system displays a cursor , a small + arrow or other image that points at some pixel of some screen. By + moving the mouse the user can move the cursor around the screen or + from one screen to another. Applications can change the shape of the + cursor to convey information to the user. +
+ The complete Trestle + interface is described in Section 3. +
+ The VBT abstraction. The key abstraction in Trestle is the "virtual + bitmap terminal" or VBT. A VBT represents + a share of the keyboard, + mouse, and displays. VBTs are comparable to the windows, widgets, and + viewers of other systems. +
+ An application is generally organized as a + tree of VBTs, with the root VBT representing the top-level + application window. The internal nodes are called split VBTs or + parent VBTs: they divide their + screens between one or more child VBTs + according to some layout depending on the class of split. At the + leaves of the tree are VBTs that contain no subwindows. +
+ A typical application consists of a number of leaf VBTs whose + behavior is specific to that application, together with some more leaf + VBTs that provide buttons, scrollbars, and other "interactors", all + held together by a tree of splits that define the geometric layout. A + split with only one child is called a filter . For example, a + BorderedVBT is a filter that adds a border around the child's + screen. A split that can have more than one child is called a proper + split. For example, an HVSplit + is a split in which the children are + laid out horizontally or vertically. +
+ Sections 4, 5, and 6 describe + Trestle's built-in proper splits, filters, and leaves. +
+ To obtain a + share of a Trestle display, an application creates a VBT and + "installs" it with the procedure Trestle.Install, which allocates + some portion of some display to the VBT, within which the application + can paint. The VBT is said to be installed + and is called a top-level window. + The size and position of top-level windows depends on the + arguments to Trestle.Install and on the whim of the window manager. +
+ A VBT imposes an hv-coordinate system on its screen. + A top-level VBT's + coordinate system need not be the same as the coordinate system of the + screen on which it is installed. The translation between the two + coordinate systems can be determined through the Trestle.ScreenOf + procedure. +
+ In a split VBT, the translation between the parent and + child coordinate systems depends on the class of the split. Trestle + provides one filter (TranslateVBT) whose sole purpose is to position + the child coordinate system origin at the northwest corner of the + child's domain, since this is convenient for some applications. All + the other built-in splits make the child coordinate system agree with + the parent coordinate system, since this is usually the most + convenient. +
+ Information flows through a VBT in two + directions. Painting commands travel from the leaves of the tree + towards the root. Events like mouse clicks and cursor positions travel + from the root towards the leaves. A VBT is an object with methods for + handling events; to deliver an event to a VBT, the system invokes the + appropriate method. The VBT interface in Section 2 specifies the + event-handling methods and the painting procedures. +
+ The screen of a + VBT is forgetful; + that is, its contents can be lost at any time, at + which point the system activates its repaint method, which is expected + to repaint what has been lost. Similarly, the height, width, and + coordinate origin of a VBT's screen can change at any time, in which + case the system activates its reshape method. Finally, the type of the + pixels in a VBT's screen can change (e.g., from color to monochrome), + in which case the system activates its rescreen method. These events + reflect the fact that the user of the window system can expose + portions of a top-level window, reshape top-level windows, and move + top-level windows from one display to another. +
+ Selections and event-time. From the user's point of view, a selection + is a highlighted occurrence of text or other data that can be made in + a window via some gesture, such as sweeping with the mouse. Selections + are supported to make it easy for users to cut and paste text and + other data between windows. A particular selection is always in at + most one window at a time, namely the "owner" of the selection. If a + selection is in no window at all, its owner is NIL. +
+ From the programmer's point of view, the selection owner is a + VBT-valued + variable shared between all applications. The procedure + VBT.Acquire is used to acquire a selection. Whenever a + VBT acquires a + selection, the previous owner is notified, so that it can take down + any highlighting or other feedback. Any VBT can own a selection, not + just a top-level window. +
+ The procedures VBT.Read and VBT.Write are + used to read or write the value of the selection. Calls to Read and + Write are implemented by locating the selection owner (which could be + in the same address space as the caller to Read or Write, + or in a + different address space) and activating its read or write + method, + which is responsible for doing the work. The selection values + communicated by Read and Write can be of any type + that can be pickled + (see Section 3.6 of Systems Programming with Modula-3 + [SPwM3] ); in + particular, they can be of type TEXT. +
+ The VBT to which user + keystrokes are directed is called the keyboard focus. Some window + managers define the focus to be the window containing the cursor; + other window managers move the focus in response to mouse + clicks. Trestle applications work with either kind of window manager. +
+ Trestle classifies the keyboard focus as a selection, since it is a + global VBT-valued variable that can be acquired and released. If you + want to receive keystrokes, you must acquire the focus. If this + succeeds, you should provide some feedback to the user, for example by + displaying a blinking caret. (Even if the window manager is + identifying the top-level window containing the focus, you should + still let the user know which subwindow contains the focus.) When you + are notified that you have lost the focus, you should take down the + feedback. +
+ It is also possible to send any selection owner a + "miscellaneous code", which will be delivered by activating the misc + method in the owner. For example, the way that Trestle notifies a + window that it no longer owns a selection is by sending it a + miscellaneous code of type Lost. Miscellaneous codes are also used + for other purposes; for example, to notify windows that they have been + deleted. +
+ The event-time protocol. There are many potential race conditions + involving selec- tions. For example, suppose that the user clicks in + window A , expecting it to acquire the keyboard focus. But window A is + slow; perhaps it is paging or blocked in a call to a server that is + being debugged; and does not respond. So the user clicks in another + window B , which acquires the keyboard focus, and types away. A few + minutes later, window A comes to life and grabs the keyboard + focus. Suddenly and unexpectedly the user's typing is redirected to A + instead of B . Similar race conditions can occur with selections other + than the keyboard focus; for example, you select a file name, then + activate a delete command by clicking, then wonder how long you must + wait before it is safe to make another selection. +
+ Trestle uses the + event-time protocol to deal with these race conditions. This means + that Trestle keeps track of the current event time, which is the + timestamp of the last keystroke, mouseclick, or miscellaneous code + that has been delivered to any VBT. Attempts to read, write, or + acquire a selection must be accompanied by a timestamp, and if this + timestamp does not agree with the current event time, the attempt + fails. This guarantees that only VBTs that are responding to the + user's latest action can access the selections. +
+ When Trestle + activates a window's method to deliver it an event, it generally waits + for the method to return before it delivers any events to any other + windows. This gives the window a fair chance to use the time stamp in + the event to access the selections. However, if the method takes an + unreasonably long time; more than a few seconds; Trestle may give up on + the window and start delivering events to other windows anyway. +
+ As a consequence, if you must do a long-running computation in response to + a user event, then you should fork the computation in a separate + thread and return from the method promptly, to avoid delaying the + user, who may want to click in another window. You should also do any + operations that require accessing the selections from the main thread + before the method returns, since an event-time operation in the forked + thread will fail if the user has continued typing or clicking during + the forked computation. +
+ The geometry interfaces. The interfaces Axis, Point, + Rect, Region, + Trapezoid, and Path are explained in Section 8. In brief, + Axis.T.Hor and Axis.T.Ver name the horizontal and vertical coordinate + axes; a Point.T (or simply a point ) is a pair of integers + representing a point in the plane; a Rect.T is a rectangle of points + whose sides are parallel to the coordinate axes; a Region.T is an + arbitrary set of points represented as a sorted array of rectangles; a + Trapezoid.T is a set of points bounded by two horizontal lines and two + lines with arbitrary slopes; and a Path.T is a path in the plane + represented by a sequence of straight and curved segments. +
+ Resources. A pixmap is a rectangular array of pixels. + A bitmap is a + pixmap in which the pixels are one bit deep. For example, a large + pixmap could represent a photographic image; a small bitmap could + represent a cursor shape. Trestle also uses a pixmap to represent the + infinite texture that results from tiling the plane with translations + of the pixmap. Thus whether a pixmap represents an infinite texture or + a bounded image depends only on the context in which it is used. +
+ A font is a typeface suitable for painting text. +
+ A painting operation + is an operation code for changing the values of pixels in the frame + buffer of a display screen. +
+ Pixmaps, cursor shapes, fonts, and + painting operations are collectively called resources. Resources come + in both screen-independent and screen-dependent forms. A + screen-independent resource varies with the screentype to produce a + similar effect on all types of screens. For example, two important + screen-independent painting operations are PaintOp.Fg and PaintOp.Bg, + which set pixels to a screen's foreground and background colors. In + contrast, a screen-dependent resource is useful only on a particular + screentype. If it is used on a VBT with the wrong type of screen, the + system won't crash, but the effect will be non-deterministic; a + screen-dependent painting operation that blackens a pixel on a + black-and-white screen might set a 24-bit pixel to chartreuse on a + true-color screen. +
+ Screen-independent resources are convenient, but + screen-dependent resources are sometimes necessary for exploiting the + capabilities of specific display hardware. +
+ The screen-independent resource types are called Pixmap.T, + Cursor.T, Font.T, and PaintOp.T. + The interfaces where these types are defined + also provide procedures for generating useful resources. For + example, PaintOp.FromRGB will produce a screen-independent painting + operation that sets a pixel to a particular color; Font.FromName will + produce a screen-independent font given the name of the typeface. +
+ The + corresponding screen-dependent resources are ScrnPixmap.T , + ScrnCursor.T, ScrnFont.T, and ScrnPaintOp.T. + The interfaces where these + types are defined also specify the representations of the raw values; + the layout of pixmaps in memory, the attributes of fonts, and similar + details that all sane people prefer to avoid. +
+ Converting a + screen-independent resource into the corresponding screen-dependent + resource for a particular type of screen is called resolving the + resource. The Palette interface will give you a screen-independent + resource if you give it a closure for resolving the resource. You can + therefore use the Palette interface to construct your own + screen-independent resources. For example, you could produce a + (PaintOp.T, Font.T) + pair that produces red Times Roman text on a + color display and black italic text on a black-and-white display; or a + Pixmap.T that selects between a low and a high resolution bitmap + depending on the screen resolution. +
+ The closure for resolving the + resource will be invoked automatically when a top-level window moves + to a new screentype for the first time. The closure will be passed an + argument of type ScreenType.T, which represents a type of display + screen. A ScreenType.T determines the depth of the screen's pixels + (e.g., one or eight), the method for associating a color with a pixel + value (e.g., color-mapped or true-color), the set of allowed + operations on its pixels, and the repositories for screen-dependent + fonts, cursors, and pixmaps that can be used on the screen. +
+ Implementing your own splits. Most applications can be built by using + Trestle's built-in splits and leaves, together with one or more leaf + VBTs specific to the application. If you are programming a more + sophisticated application, you may want to augment the built-in splits + with some of your own. Section 9 introduces the interfaces that allow + you to do this. +
+ To implement a leaf VBT, you only have to supply + methods to handle the events that flow down the tree (from the root to + the leaves). To implement a split VBT, you also have to supply + methods to handle the information that flows up the tree, such as + painting commands or commands to change the cursor shape. The VBTClass + interface declares these methods and presents their specifications. +
+ Very few splits override the method for painting, since the default + behavior, which is to clip to the child's domain and relay the + painting to the parent, is usually what is desired. But some splits do + override this method: for example, the ZSplit, whose child windows + are allowed to overlap one another, has a paint method that clips its + children's painting to the visible parts of their domains. And the top + level window has a painting method that translates VBT painting + commands into X painting commands and relays them to the X server. The + interfaces Batch, BatchUtil, and PaintPrivate + reveal the details + necessary to override painting methods. +
+ The remainder of the reference manual consists of complete Modula-3 + interfaces printed in typewriter font and interspersed with commentary + printed in roman font. Some of the commentary is in the form of + "pseudo-Modula-3" program fragments, which are also printed in + typewriter font. +
+ The Trestle release that accompanies SRC Modula-3 + version 2.0 contains several interfaces that are not documented in + this reference manual. For example, the VTextVBT interface provides + editable text VBTs and the TrestleAux interface allows you to set + window manager parameters and do strange things to top-level + windows. The specifications for these interfaces are directly in the + Modula-3 interface files. +
Index: m3/pm3/graphics/gr-libs/ui/src/html/leafs.html diff -c /dev/null m3/pm3/graphics/gr-libs/ui/src/html/leafs.html:1.2 *** /dev/null Tue Feb 10 23:28:45 1998 --- m3/pm3/graphics/gr-libs/ui/src/html/leafs.html Tue Feb 10 22:27:50 1998 *************** *** 0 **** --- 1,15 ---- + +
++
The lectern system may be used to view and index documents only available + in geometrical form (Postscript or bitmap). +
This simple shared graphics editor is a good example of + network and stable objects usage. It enables simultaneous editing + of a board by several users. +
2D and 3D graphics libraries and applications. +
+ +
+ +
Jerome Collin implemented the fast + integrated backend for Linux ELF with + position independent code and debugging support. + +
Louis-Dominique Dubeau reorganized the compiler and templates to + obtained a simplified single process m3build-m3-quake. + +
+ Tony Hosking, Purdue University, (hosking@cs.purdue.edu), ported the + incremental collector and stack based exceptions to Solaris. He is + working on Persistent Modula-3. + +
Blair McIntyre brought several bug fixes and a new version of the + Pickle library (Blair MacIntyre). + +
Richard Watts ported SRC Modula-3 to NT386 using the gnu-win32 linker, + obviating the need for the MS Visual C++ compiler/linker. + +
Peter Klein (pk@i3.informatik.rwth-aachen.de) + produced a Modula-3 version of the TXL program parsing and + analysis tool, and a Modula-2 to Modula-3 converter. + +
John Podstra developed CVSsup. + +
The M3COCO parser generator was contributed by Ollie Stephens. + +
This section was written at DEC SRC and we presumably is + Bill Kalsow (Critical Mass, kalsow@cmass.com), Eric Muller, + Allan Heydon (heydon@src.dec.com), and + Marc Najork (najork@src.dec.com). + +
Many people contributed to SRC Modula-3, and we would like to thank them. + Below is a partial list of the contributors. + +
+ We use the garbage collector developed by Joel Bartlett + (DEC-WRL). It has been modified to support incremental and + generational collection by John DeTreville + (jdd@src.dec.com, DEC SRC). + +
+ John Dillon (DEC SRC) provided the original C version of thread + switching. + +
+ Mark R. Brown and Greg Nelson (DEC SRC, gnelson@src.dec.com) + designed the readers and writers interfaces. + +
+ Jorge Stolfi (University of Campinas, Brazil, + stolfi@dcc.unicamp.br), + and Stephen Harrison (DEC-WSE) + were very patient alpha-testers. They gave us invaluable bug reports + and also translated some DEC SRC Modula-2+ modules to Modula-3. + +
+ J'erome Chailloux (ILOG) developed the X interfaces while + visiting DEC SRC. We also had numerous discussions about the evolution + of SRC Modula-3. + +
+ The ``gatekeepers'' (DEC-WRL), in particular Paul Vixie, helped with + the distribution of SRC Modula-3. + +
+ David Goldberg (XEROX PARC) ported SRC Modula-3 to the SPARC + machines. + +
+ Ray Lischner ported the system to the Apollo machines. + +
+ Richard Orgass (IBM Rochester) and Roger Hoover (IBM) + ported the system to the IBM machines. + +
+ Piet van Oostrum (Utrecht University) ported the system to the + HP series 9000/300 computers running HP/UX 7.0. + +
+ Pat Lashley (KLA Instruments) contributed the lexer for pps. + +
+ R'egis Crelier (ETH) designed and implemented the pickles + modules while he was a summer intern at SRC. + +
+ Mick Jordan (Sun, mick.jordan@eng.sun.com) provided the AST + toolkit and helped with m3build. + +
+ Stephen Harrison (DEC SRC) wrote the quake interpreter. + +
+ Norman Ramsey (Princeton University) has pushed the system into + obscure corners and found many bugs there. + +
+ R.J. Stroud and Dick Snow (University of Newcastle upon + Tyne) provided the Encore Multimax port. + +
+ Dave Nichols (Xerox PARC) fixed and improved the pretty printer. + +
+ Greg Nelson and Mark Manasse (DEC SRC, msm@src.dec.com) + designed and implemented the Trestle window system. + +
+ Sam Harbison (Tartan, Texas Instruments, harbison@micro.ti.com) + contributed the FieldList interface and is the author of a popular + book on Modula-3. + +
+ Steven Pemberton (CWI) wrote the enquire program and made + it available to the community. + +
+ The vbtkit software has been designed and implemented by a large + number of people at SRC: Andrew Birrell + (birrell@src.dec.com, also involved in the Network objects), + Ken Brooks, + Marc H. Brown (mhb@src.dec.com), + Mark R. Brown, Pat Chan, + Luca Cardelli (luca@src.dec.com, also behind Obliq and several + other packages), John DeTreville, Steve Glassman, + Mark Manasse, Jim Meehan + (jmeehan@mv.us.adobe.com), Greg Nelson, + Jorge Stolfi, Mary-Claire van Leunen. + +
+ FormsVBT is due to Jim Meehan and Marc H. Brown (DEC SRC). + +
+ Peter Klein (RWTH Aachen) contributed a tool to help convert + Modula-2 to Modula-3 programs. He is also responsible for + establishing the first FTP mirror site. + +
+ James J. Walker (GTE Laboratories) ported the system to the + HPPA machines. + +
+ Thomas Brupbacher (ETH Zuerich) ported the system to the + SUN386 machines. + +
+ Dennis Brueni (brueni@csgrad.cs.vt.edu) ported the system + to the OKI machines. + +
+ Dave Detlefs (DEC SRC) wrote the Modula-3 mode for gnuemacs. + David Goldberg (XEROC PARC) wrote the m3tags program. + +
+ Jim Horning (horning@intertrust.com, horning@acm.org, + http://www.intertrust.com/star/horning/), + Paul McJones (DEC SRC, mcjones@src.dec.com) + and Greg Nelson (DEC SRC) + edited, designed, polished and in some cases implemented the + "Interface police" + interfaces. + +
+ Allan Heydon (DEC SRC, heydon@src.dec.com) + implemented the Fmt and Lex + interfaces and contributed the Web description of Modula-3 linking. + +
+ Michel Dagenais (Ecole Polytechnique de Montreal, + michel.dagenais@polymtl.ca) + ported the system to Linux. + +
+ Olaf Wagner ported the system to pcs running FreeBSD 1.1.5 and + FreeBSD 2.0. + +
+ Eric Veach (Stanford) ported the system to MIPS boxes running Irix 5.2. + +
+ Michael Isard (DEC SRC) implemented the Intel x86 code generator + and Windows/NT dynamic loader. + +
+ Carsten Weich (Institut fuer Informatik Universitaet Klagenfurt, + weich@ifi.uni-klu.ac.at) + implemented the stable objects package and the associated stub generator. + +
+ Chuck Thacker (DEC SRC) wrote the original version of Sil. + Bill Kalsow converted it to Modula-3. + +
+ Thanks also to all the people who used SRC Modula-3 and reported bugs. + +
+ The various ports would have been impossible without the work of a + number of people, who kindly made their modifications available. + However, most of the bugs you may find in these ports were introduced + during the final integration of these modifications and we are to be + blamed for them. + +
+ Susan Owicki (Stanford University, owicki@mojave.stanford.edu), + and Edward Wobber, (DEC SRC, wobber@src.dec.com), Network objects. + +
+ Laszlo Boeszoermenyi, Universitaet Klagenfurt, Austria, + (laszlo@ifi.uni-klu.ac.at), PC port (m3pc), Programming in style book. + +
+ Klaus Preschern, Universitaet Klagenfurt, Austria, + (preschern@ifi.uni-klu.ac.at), PC port (m3pc). + +
+ Robert Ayers, Adobe, (ayers@Mv.Us.Adobe.Com), the Display Postscript to + Modula-3 interface. + +
+ David N. Gray, Lucid Inc., Menlo Park, (gray@Lucid.Com), + interface between the Lucid environment and the M3 compiler. + +
Rick Hudson, University of Massachusetts at Amherst, + (hudson@cs.umass.edu), Lex and Yacc files for parsing Modula-3. + +
+ Bert Laverman, Groningen University, (laverman@cs.rug.nl), HPPA support. + +
Roland Mittermeir, Universitaet Klagenfurt, Austria, + (mittermeir@ifi.uni-klu.ac.at), Programming in style book. + +
+ Eliot Moss, University Of Massachusetts At Amherst, (moss@Cs.Umass.Edu), + Modula-3 garbage collection and persistency. + +
+ Farshad Nayeri, Critical Mass, (nayeri@cmass.com), + comercial Modula-3 support. + + + Index: m3/pm3/intro/src/bib.html diff -c /dev/null m3/pm3/intro/src/bib.html:1.3 *** /dev/null Tue Feb 10 23:29:04 1998 --- m3/pm3/intro/src/bib.html Tue Feb 10 22:41:03 1998 *************** *** 0 **** --- 1,786 ---- + +
++ Copyright (C) 1994, Digital Equipment Corporation + +
Here is a complete list of books, papers and articles related to + Modula-3. A more concise bibliography + organized by topic and containing pointers back to this page is also + available. An important fraction of this documentation is already + included in the individual packages to which they apply. + +
Please send comments and/or additions to + m3-request@src.dec.com. + +
+ This report describes a theoretical treatment of the semantics of objects. +
+ It's available via anonymous FTP from gatekeeper.dec.com in + + pub/DEC/SRC/research-reports/SRC-095.ps.Z. + +
+ This report describes an algorithm used as the basis for SRC Modula-3 + garbage collector. +
+ It's available on paper, by sending a mail to + WRL-Techreports@decwrl.dec.com (send help as the subject). + +
+ It's available via anonymous FTP from gatekeeper.dec.com in + + pub/DEC/SRC/research-reports/SRC-020.ps.Z. A revised + version of this paper also appears as Chapter 5 of Systems Programming with Modula-3. + +
+ It's available via anonymous FTP from gatekeeper.dec.com in + + pub/DEC/SRC/research-reports/SRC-035.ps.Z. A revised + version also appears as Chapter 4 of Systems + Programming with Modula-3. + +
+ This report describes a fault-tolerant and efficient garbage + collection algorithm for distributed systems. It is the algorithm used + to garbage collect Network Objects. +
+ It's available via anonymous FTP from gatekeeper.dec.com in + + pub/DEC/SRC/research-reports/SRC-116.ps.Z. + +
+ This report describes the design and implementation of a network + objects system, which allows you to write programs that communicate + over a network, while hiding the messy details of network programming. + Network objects provide functionality similar to remote procedure call (RPC), + but they are more general and easier to use. The system is implemented + in Modula-3. +
+ It's available via anonymous FTP from gatekeeper.dec.com in + + pub/DEC/SRC/research-reports/SRC-115.ps.Z. + +
+ +
+ This book is in German, but it is in the process of being translated + to English. It is an introductory programming text that uses Modula-3 + for its examples. The authors say, "The main concern of the book is to + give a clean and comprehensive introduction to programming for + beginners of a computer science study. We start with more traditional + programming concepts and move toward advanced topics such as + object-oriented programming, parallel & concurrent programming, + exception handling, and persistent data techniques. The book also + presents a large number of complete examples written in Modula-3." + +
+ This article describes the teaching and research efforts centered + around Modula-3 at the University of Klagenfurt in Austria. + +
+ +
+ It's available via anonymous FTP from gatekeeper.dec.com in + + pub/DEC/SRC/research-reports/SRC-076a.ps.Z. +
+ +
+ It's available via anonymous FTP from gatekeeper.dec.com in + + pub/DEC/SRC/research-reports/SRC-075.ps.Z. Also in + Visual Languages '91, October 1991. +
+ +
+ It's available via anonymous FTP from gatekeeper.dec.com in + + pub/DEC/SRC/research-reports/SRC-098.ps.Z. +
+ +
+ It's available via anonymous FTP from gatekeeper.dec.com in + + pub/DEC/SRC/research-reports/SRC-126.ps.Z. +
+ +
+ This report is the working definition of the VBTkit toolkit. VBTkit + is a collection of widgets for building graphical user interfaces in + Modula-3. See the FormsVBT Reference Manual + below, which describes a system for easily composing these widgets. +
+ It's available in the vbtkit archive of the SRC Modula-3 + distribution. A draft version is available via anonymous FTP from + gatekeeper.dec.com in + pub/DEC/Modula-3/contrib/vbtkit.25Mar93.ps.Z. +
+ +
+ This report is the working definition of the FormsVBT toolkit. + FormsVBT is a system for constructing graphical user interfaces + (GUI's) in Modula-3. +
+ It's available in the formsvbt archive of the SRC Modula-3 + distribution. A draft version is available + via anonymous FTP from gatekeeper.dec.com in + pub/DEC/Modula-3/contrib/formsvbt.25Mar93.ps.Z + and + + pub/DEC/Modula-3/contrib/formsvbt.AppC.26Mar93.ps.Z. +
+ +
+ This report shows how to use objects in a real program. Also + defines the de facto standard input/output functions. These + interfaces give an especially good example of partially + opaque types. A revised version of this report also appears as Chapter + 6 of Systems Programming with Modula-3. +
+ +
+ The report contains the original definition of the language, + superseded by Research Report 52. +
+ +
+ +
+ This report is the definition of the Modula-3 language. + It is now only available in hardcopy. The address for + orders is below. The complete language definition, + Chapter 2 of Systems Programming with + Modula-3, is also available + on-line. +
+ +
+ This article consists of Chapters 2 and 3 of SPwM3. + There is an on-line version. +
+ +
+ A draft of a book describing "the latest object-oriented techniques for + developing large interactive distributed applications". The focus is on + the Modula-3 libraries and Network Objects, but the first two chapters + give an introduction to object-oriented programming in general, and + the object methodologies of C++ and Obliq in particular. +
+ +
+ This article motivates and describes an optimizer for Modula-3 + programs based on whole-program analysis. An optimizer that looks at + an entire program can do better than one that uses only the + information imported when compiling a single module. Preliminary + results are promising: on benchmark programs, up to 50% of method + invocations can be converted to direct calls. The optimizer is itself + written in Modula-3. +
+ +
+ This paper shows how the overhead introduced by Modula-3's opaque + types can be reduced at link time. The optimizations described in the + paper are shown to be effective: they reduce the total number of + instructions by up to 14% and convert as many as 79% of indirect calls + to direct calls. +
+ +
+ This thesis describes mld, a retargetable, optimizing linker, + for the MIPS, SPARC, and Intel 486 architectures. The linker optimizes + away some of the costs of late binding. In particular, mld's + optimizations permit efficient implementation of Modula-3's + module-encapsulation and data-abstraction features. The thesis + presents the results of applying mld's simple optimization + techniques to several Modula-3 programs and reports their execution + times on the MIPS and Intel 486 architectures. +
+ +
+ This article describes how Modula-3's partial revelations promote + encapsulation and code reuse. The article is one of five on + "object-oriented programming" contained in the same issue (the other + four languages are C++, Ada 95, S, and Cobol '97). +
+ +
+ This article describes the Modula-3 treatment of floating-point values. +
+ +
+ This page describes the authors' experience installing Modula-3 on a + PC and using the language to implement a concurrent breadth-first + search algorithm. The authors were trying to install + M3forDOS, an implementation of Modula-3 that runs + on DOS PC's. They found this installation to be quite + difficult. They eventually ended up using a version of + SRC + Modula-3 that had already been installed on a Unix box at their site. +
+ +
+ This article is a survey of the Modula-3 language. It gives a brief + history of the language and describes the language's major features, + including modules, exceptions, objects, threads and other support for + concurrent programming, safety, and garbage collection. It also + discusses the basis for some of the more contentious language design + decisions. +
+ +
+ This article is a survey of the Modula-3 language. +
+ +
+ A complete Modula-3 textbook covering the full + language, with examples and exercises. Includes a + style manual and a user's guide for SRC Modula-3. +
+ The first edition of the book contains many typos. A + list + of errata is available on-line for anonymous FTP (in TeX, + compressed PostScript, or DVI format) from gatekeeper.dec.com + in the directory pub/DEC/Modula-3/errata/. +
+ +
+ Available from i41s10.ira.uka.de [129.13.13.110] by anonymous ftp + in directory pub/m3s + as jspp93.ps + or jspp93.ps.gz. +
+ +
+ Available from Universitatsverlag Ulm GmbH or from i41s10.ira.uka.de + [129.13.13.110] by anonymous ftp in directory pub/m3s + as jmlc94.ps + or jmlc94.ps.gz. +
+ +
+ The paper evaluates Oberon, Modula-3, Sather, and Self in the context + of object-oriented programming. While each of these programming + languages provide support for classes with inheritance, dynamic + dispatch, code reuse, and information hiding, they do so in very + different ways and with varying levels of efficiency and simplicity. A + single application was coded in each language and the experience + gained forms the foundation on which the subjective critique is based. + By comparing the actual run-times of the various implementations it is + also possible to present an objective analysis of the efficiency of + the languages. Furthermore, by coding the application using both + explicit dynamic dispatch and static method binding, it is possible to + evaluate the cost of dynamic dispatch in each language. The + application was also coded in C++, thereby providing a well-known + baseline against which the execution times can be compared. +
+ +
+ This report describes Juno-2, a constraint-based drawing editor + implemented in Modula-3. For more information, see the + Juno-2 Home Page. +
+ It's available via anonymous FTP from gatekeeper.dec.com in + + pub/DEC/SRC/research-reports/SRC-131a.ps.Z. +
+ +
+ Juno-2 is a + constraint-based drawing program. This article describes how Modula-3's + FormsVBT, VBTkit, and Trestle libraries were used to implement the + Juno-2 user interface. +
+ +
+ +
+ This report is a description of the SRC standard Modula-3 library interfaces. + It's an essential reference for every Modula-3 programmer! +
+ It's available via anonymous FTP from gatekeeper.dec.com in + + pub/DEC/SRC/research-reports/SRC-113.ps.Z. +
+ +
+ Describes the extensions made by the SPIN group at the University of + Washington to the Modula-3 language for use in their SPIN extensible + operating system. +
+ +
+ It's available via anonymous FTP from ftp.informatik.rwth-aachen.de + in /pub/reports/1994/94-16.ps.gz. +
+ +
+ +
+ This report is the working definition of the Trestle toolkit for + doing graphics in Modula-3. +
+ +
+ This report is a tutorial introduction to the Trestle toolkit. +
+ +
+ +
+ A happy user promotes SRC Modula-3. The article begins: +
++ +Despite its length and buzzword density, the subtitle above is one + the shortest phrases that characterize the virtues of SRC Modula-3. + The language designers' stated goal of "consolidation, not innovation" + is a modest understatement for their wise, elegant, and inventive + combination of features that are greatly needed by the modern + programmer. +
+ The sources of a simple client and server that use network objects. A + gzipped tar archive of the sources and web page is also available. +
+ +
+ This book is the definitive language reference. It includes the + language reference manual and papers on the I/O library, + threads, and the Trestle window system. It is also known as "SPwM3". +
+ Here is its table of contents: + +
+ +
+ This article describes the rationale for the way object types are
+ initialized in Modula-3. Modula-3 doesn't have type
+ constructors, but you can specify default values for object
+ fields in the type definition. The article also describes the
+ init method convention.
+
+ +
+ +
+ Sedgewick's classic text on algorithms. The examples are in Modula-3. +
+ +
+ An on-line reference and tutorial, available in three formats: HTML, + Texinfo source, and GNU Info files. All three formats are available as a + gzipped tar file as well. Similar tutorials are available from: + + Concordia University, + + University of Kent at Canterbury + +
+ +
+ Describes the experiences of the SPIN group at the University of + Washington using Modula-3 to build a high performance extensible + operating system. Debunks some of the myths surrounding Modula-3 by + arguing that the SRC reference implementation introduces + inefficiencies that are not imposed by the Modula-3 language itself. +
+ +
+ This brief article announces Photon, a commercially supported + development environment based on SRC Modula-3. The first official + release is scheduled for the first quarter of 1996. The first target + platform is Linux PC's. Photon is a product of + Critical Mass, Inc.. +
+ +
+ An on-line introduction to the Trestle window system. This tutorial + was written to conform with SRC Modula-3 version 2.11. Some of + the interfaces called in this tutorial are obsolete. +
+ A gzip'ed tar archive + of the entire tutorial is available. +
+ +
+ +
+ It's available via anonymous FTP from ftp.gte.com in + /pub/m3/linux-journal.html. + +
+ +
+ You can order SRC Research Reports and videotapes + on-line + through the World-Wide Web. All reports and videotapes are free. +
+ + You can also order reports and videos by contacting: +
+ + SRC Report Distribution+ +
+ Digital Equipment Corporation
+ 130 Lytton Avenue
+ Palo Alto, CA 94301-1044
++ src-report@src.dec.com +
+ Last modified on Fri Jan 30 09:44:22 EDT 1998 by michel.dagenais@polymtl.ca + modified on Thu May 2 19:44:22 PDT 1996 by heydon + modified on Mon Dec 19 10:23:41 PST 1994 by kalsow + modified on Wed Feb 12 12:48:44 PST 1992 by muller ++ + + + Index: m3/pm3/intro/src/concise-bib.html diff -c /dev/null m3/pm3/intro/src/concise-bib.html:1.2 *** /dev/null Tue Feb 10 23:29:04 1998 --- m3/pm3/intro/src/concise-bib.html Tue Feb 10 22:41:03 1998 *************** *** 0 **** --- 1,166 ---- + + +
The complete annotated Modula-3 + bibliography now has over 50 entries. This page is an attempt at a + more concise list of essential Modula-3 references organized + by topic. The links on this page are pointers to the annotated + bibliography. Please send comments and/or additions to m3-request@src.dec.com. + +
+ Last modified on Thu May 2 19:58:17 PDT 1996 by heydon ++ + + Index: m3/pm3/intro/src/contacts.html diff -c /dev/null m3/pm3/intro/src/contacts.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:04 1998 --- m3/pm3/intro/src/contacts.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,13 ---- + +
The prime site for any Modula-3 related discussion is the Usenet + newsgroup comp.lang.modula3. + Bug reports are welcome on this newsgroup as most distributions have + a large code base in common. + +
Specific requests and questions concerning PM3 may be directed to + Michel Dagenais + + \ No newline at end of file Index: m3/pm3/intro/src/content.html diff -c /dev/null m3/pm3/intro/src/content.html:1.3 *** /dev/null Tue Feb 10 23:29:04 1998 --- m3/pm3/intro/src/content.html Tue Feb 10 22:41:03 1998 *************** *** 0 **** --- 1,88 ---- +
++ The PM3 distribution contains over 130 programs and libraries split by + topic along a hierarchical tree. + +
New users will typically want to read the documentation approximately + in the following order. + +
The Modula-3 release of Ecole Polytechnique de Montreal (PM3) contains + numerous packages from several sources, all freely redistributable. + Each package describes its detailed licensing terms. Our interpretation + of these terms, without any specific legal value, is exposed below. + +
+ The bulk of the distribution originates from DEC SRC and allows + free modification and redistribution, provided that you do not + hold DEC liable for anything related to SRC Modula-3 and that + you pay any fee incurred because of claims of damage arising + from your possession or use or inability to use the software. + By passing along this copyright with any redistribution, you prevent the + situation where someone else would sue DEC and you would be required to + indemnify DEC for such action. + +
+ A few packages or portions of packages are copyrighted by other industrial + research laboratories from Olivetti (m3tk), Xerox (regex), + and Sun Microsystems (m3tk). They may be freely modified and redistributed + provided that the copyright notice is preserved and that you do not assume + any liability on their part. + +
+ A few programs are available under the GNU GPL. These may be freely + redistributed provided that you make the modified source code available. + A few libraries are available under the GNU LGPL. These may be + freely redistributed provided that you make the modified library source + code available and allow relinking with a newer version of the library. + +
+ Our understanding of all the copyrights involved in PM3 is that you can + safely distribute any program or library developed with PM3 provided that you + pass along the copyrights, the source code of the PM3 libraries used + (at least for the LPGL libraries), and the relinkable binaries for + the rest (if you are using any LGPL libraries). + \ No newline at end of file Index: m3/pm3/intro/src/dupl.txt diff -c /dev/null m3/pm3/intro/src/dupl.txt:1.1.1.1 *** /dev/null Tue Feb 10 23:29:04 1998 --- m3/pm3/intro/src/dupl.txt Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,115 ---- + # List of units with the same name along with the word count output + # for the differences. Small numbers indicate small differences + # + diff m3tk/src/misc/TextExtras.i3 http/src/TextExtras.i3 0 0 0 + diff m3tk/src/misc/TextExtras.i3 webvbt/src/TextExtras.i3 0 0 0 + diff m3tk/src/misc/TextExtras.m3 http/src/TextExtras.m3 13 77 481 + diff m3tk/src/misc/TextExtras.m3 webvbt/src/TextExtras.m3 13 77 481 + # Identical except the m3tk version is a bit older; simplifications + # were brought to the newer version. + # + diff netobj/src/netobjrt/AtomPkl.i3 sgml/src/sgmlc/AtomPkl.i3 0 0 0 + diff netobj/src/netobjrt/AtomPkl.m3 sgml/src/sgmlc/AtomPkl.m3 0 0 0 + # To share. + # + diff realgeometry/src/RealInterval.m3 fisheye/src/RealInterval.m3 199 937 5289 + diff realgeometry/src/RealPoint.m3 fisheye/src/RealPoint.m3 584 2514 14063 + diff realgeometry/src/RealInterval.i3 fisheye/src/RealInterval.i3 205 1341 7581 + diff realgeometry/src/RealRect.i3 fisheye/src/RealRect.i3 379 2358 14606 + diff realgeometry/src/RealRect.m3 fisheye/src/RealRect.m3 690 3630 21669 + diff realgeometry/src/RealPoint.i3 fisheye/src/RealPoint.i3 274 1599 9420 + # Both sets have a common origin. In fisheye, everything raises an + # exception. However it is not handled anywhere. Converting fisheye should + # be OK. + # + diff m3browser/src/TCPPeer.i3 tcpextras/src/TCPPeer.i3 0 0 0 + diff m3browser/src/TCPPeer.m3 tcpextras/src/POSIX/TCPPeer.m3 15 82 502 + # Almost identical. Check which one to retain. + # + diff buildlectern/src/OSUtils.i3 zeus/src/OSUtils.i3 83 547 3348 + diff buildlectern/src/OSUtils.i3 postcard/src/OSUtils.i3 164 1124 7139 + diff buildlectern/src/OSUtils.i3 webcard/src/OSUtils.i3 164 1124 7139 + diff buildlectern/src/OSUtils.m3 zeus/src/OSUtils.m3 99 413 3124 + diff buildlectern/src/OSUtils.m3 postcard/src/OSUtils.m3 339 1331 9789 + diff buildlectern/src/OSUtils.m3 webcard/src/OSUtils.m3 337 1317 9718 + # All different, except for webcard/postcard. Check however if these + # functions could be put in a library. + # + diff m3tools/src/M3ID.i3 m3middle/src/M3ID.i3 55 384 2154 + diff m3tools/src/M3ID.m3 m3middle/src/M3ID.m3 560 2979 18651 + # Different. However along with m3browser/src/ID, a lot is shared with Atoms. + # + diff fours/src/Buf.i3 m3markup/src/Buf.i3 19 135 714 + diff fours/src/Buf.m3 m3markup/src/Buf.m3 74 319 1852 + # Fairly similar, could be shared. Pretty small, used to optimize. + # This is also the case for Wx.T instead of Wr.T. Check the performance + # difference and decide, perhaps. + # + diff m3markup/src/MarkUp.i3 m3tohtml/src/MarkUp.i3 18 128 772 + diff m3markup/src/MarkUp.m3 m3tohtml/src/MarkUp.m3 186 898 5469 + diff m3markup/src/M3MarkUp.m3 m3tohtml/src/M3MarkUp.m3 1165 5301 37835 + diff m3markup/src/M3MarkUp.i3 m3tohtml/src/M3MarkUp.i3 16 71 417 + # Same except that one uses Wx instead of Wr. Is the performance difference + # worth it. + # + diff images/src/Images.m3 webvbt/src/Images.m3 359 1521 11391 + diff images/src/Images.i3 webvbt/src/Images.i3 182 1322 8246 + # Different things with images. + # + diff lecterntohtml/src/HTML.m3 webvbt/src/HTML.m3 441 1734 12520 + diff lecterntohtml/src/HTML.i3 webvbt/src/HTML.i3 167 803 5066 + # Look quite different. + # + diff fisheye/src/GraphVBT.m3 mgkit/src/GraphVBT.m3 5697 23300 199456 + diff fisheye/src/GraphVBT.i3 mgkit/src/GraphVBT.i3 949 6055 39187 + # Different things with graphs. + # + diff netobj/src/netobjrt/Protocol.i3 stubgen/src/Protocol.i3 113 770 5001 + # Different. + # + diff fours/src/Config.i3 columns/src/Config.i3 66 379 2379 + diff fours/src/Config.i3 postcard/src/Config.i3 99 502 3465 + diff fours/src/Config.i3 webcard/src/Config.i3 99 502 3465 + diff fours/src/Config.m3 columns/src/Config.m3 372 2008 13591 + diff fours/src/Config.m3 postcard/src/Config.m3 929 4419 34933 + diff fours/src/Config.m3 webcard/src/Config.m3 927 4405 34827 + # Different. + # + diff stablegen/src/FRefRefTbl.m3 stubgen/src/FRefRefTbl.m3 0 0 0 + diff stablegen/src/Type.i3 stubgen/src/Type.i3 66 457 2442 + diff stablegen/src/ValueProc.i3 stubgen/src/ValueProc.i3 0 0 0 + diff stablegen/src/Type.m3 m3front/src/types/Type.m3 1154 5657 38688 + diff stablegen/src/Type.m3 stubgen/src/Type.m3 416 2242 16409 + diff stablegen/src/AstToType.i3 stubgen/src/AstToType.i3 38 216 1332 + diff stablegen/src/Value.m3 stubgen/src/Value.m3 0 0 0 + diff stablegen/src/AstToType.m3 stubgen/src/AstToType.m3 952 3890 39952 + diff stablegen/src/TypeNames.i3 stubgen/src/TypeNames.i3 15 109 631 + diff stablegen/src/Value.i3 m3front/src/values/Value.i3 110 609 3574 + diff stablegen/src/Value.i3 stubgen/src/Value.i3 0 0 0 + diff stablegen/src/FRefRefTbl.i3 stubgen/src/FRefRefTbl.i3 0 0 0 + diff stablegen/src/TypeNames.m3 stubgen/src/TypeNames.m3 108 520 3811 + diff stablegen/src/Value.m3 m3front/src/values/Value.m3 499 2186 13908 + # Similar but different except for one or two trivial files which are + # identical. + # + diff webcard/src/PostcardMain.m3 postcard/src/PostcardMain.m3 79 323 2586 + diff webcard/src/BuiltInDisplay.i3 postcard/src/BuiltInDisplay.i3 0 0 0 + diff webcard/src/BuiltInDisplay.m3 postcard/src/BuiltInDisplay.m3 425 1719 13521 + diff webcard/src/NI.i3 postcard/src/NI.i3 0 0 0 + diff webcard/src/NI.m3 postcard/src/NI.m3 0 0 0 + diff webcard/src/Closure.i3 postcard/src/Closure.i3 19 103 646 + diff webcard/src/FastMenu.i3 postcard/src/FastMenu.i3 0 0 0 + diff webcard/src/FastMenu.m3 postcard/src/FastMenu.m3 0 0 0 + diff webcard/src/BuiltInCompose.i3 postcard/src/BuiltInCompose.i3 0 0 0 + diff webcard/src/BuiltInCompose.m3 postcard/src/BuiltInCompose.m3 9 53 343 + diff webcard/src/UnixMail.m3 postcard/src/UnixMail.m3 8 40 292 + diff webcard/src/MiscUtils.m3 postcard/src/MiscUtils.m3 0 0 0 + diff webcard/src/UnixMail.i3 postcard/src/UnixMail.i3 0 0 0 + diff webcard/src/UtimeExtra.i3 postcard/src/UtimeExtra.i3 0 0 0 + diff webcard/src/Rescreen.m3 postcard/src/Rescreen.m3 0 0 0 + diff webcard/src/MailUtilities.i3 postcard/src/MailUtilities.i3 0 0 0 + diff webcard/src/MailUtilities.m3 postcard/src/MailUtilities.m3 0 0 0 + diff webcard/src/Rescreen.i3 postcard/src/Rescreen.i3 0 0 0 + diff webcard/src/MiscUtils.i3 postcard/src/MiscUtils.i3 0 0 0 + # Webcard is vastly inspired from postcard. Perhaps one replaces the + # other or sharing could be done. Index: m3/pm3/intro/src/history.html diff -c /dev/null m3/pm3/intro/src/history.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:04 1998 --- m3/pm3/intro/src/history.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,71 ---- +
++ The Modula-3 distribution of Ecole Polytechnique de Montreal is directly + based on SRC Modula-3 release 3.6, which appeared in early 1996. + +
+ Version 1.0 was the first public release of SRC Modula-3. It contained the + compiler, runtime and a few tools. The compiler generated intermediate C code + and was only tested on VAX Ultrix 3.1. Subsequent 1.x releases were ported + to several platforms and the libraries reorganized. + +
+ Version 2.0 implements the twelve language changes proposed after the initial + trial period. The compiler and code generator were rearranged and improved. + With subsequent 2.x releases, several new platforms were supported and + significant new packages appeared (FormsVBT, Zeus...). + +
+ Version 3.0 is the first public release of the gcc based native code + generator m3cc, Modula-3 aware debugger m3gdb, and smart recompilation + system m3build. The standard library was cleaned up after a close + review by the interface police. A Windows NT port appeared as well as + new significant packages such as Network objects and Obliq. + Subsequent 3.x releases brought bug fixes, more platforms supported, + speed tuning, and several new packages such as Stable Objects and Anim3D. + +
+ With release 3.6, in early 1996, DEC SRC Modula-3 reached a mature state. + Bill Kalsow, responsible for the compiler, left DEC SRC around that time + and later joined Critical Mass, a commercial Modula-3 vendor. Since then, + a number of advanced Modula-3 projects at DEC SRC continued in areas such + as 3D animation, static verification, constraint based geometrical editor, + and distributed + applications. In many other areas, including the compiler and base libraries, + few updates were made at DEC SRC. Moreover, these updates are available + separately from the release and must be integrated manually. + +
+ At the same time, several contributions appeared from Modula-3 programmers + around the world and included several bug fixes, enhancements, and + new libraries or tools such as a more platform independent version + of Pickle, an integrated code generator for Linux ELF, + a simplified single process version of m3build-m3-quake, + a port of SRC Modula-3 to NT386 using gnu-win32, and several new + packages such as CVSsup, M3COCO, and M3 TXL. + +
+ After consultations with several key academic Modula-3 programmers with + similar needs, including Peter Klein, Blair McIntyre, and Richard Watts, + it was decided to create a new distribution based on SRC Modula-3. + The new distribution is under CVS version control and is + accessible to remote maintainers. + +
+ The first public release of PM3 included SRC release 3.6 with all patches + applied, a fast integrated Linux ELF code generator, a simplified + m3build-m3-quake with accordingly simplified templates for platform + customization, m3cc and m3gdb based on newer versions of gcc and gdb, + full platform support for NT386GNU through gnu-win32, + a simplified bootstrap and build process, a directory hierarchy + to organize the 130+ packages, SGML/HTML based documentation, + and an automated release procedure to produce updated sources, bootstraps + and binaries every week. + + \ No newline at end of file Index: m3/pm3/intro/src/index.html diff -c /dev/null m3/pm3/intro/src/index.html:1.2 *** /dev/null Tue Feb 10 23:29:04 1998 --- m3/pm3/intro/src/index.html Tue Feb 10 22:41:03 1998 *************** *** 0 **** --- 1,68 ---- +
+This free distribution integrates the excellent SRC Modula-3 development + environment with a number of local enhancements as well as numerous + outside contributions. Key features include an SGML/HTML based documentation + system, easier bootstrap and build, improved Linux support (faster compiler + and better debugging support), and NT 386 support through the gnu win32 + version of gcc. +
This distribution was assembled at Ecole Polytechnique de Montreal to + satisfy internal teaching and research needs as well as to serve + academic and industrial externel needs, along the lines of cooperation on + which the internet was built. This free and rapidly evolving Modula-3 + distribution is directly based on the excellent DEC SRC Modula-3 development + environment. It contains several enhancements produced by Modula-3 programmers + from around the world. + +
Each package group, package or file has information about its authors + and copyright. Documentation files were often contributed separately + by different authors and possibly under a different copyright. Thus, + the author mentioned in the documentation may or may not have contributed to + the code in the corresponding package. Similarly, the copyright mentioned + in the documentation applies to the documentation alone. The source files + may come under a different copyright. + +
The current PM3 release is under the responsability of Louis-Dominique + Dubeau (ldd@step.polymtl.ca) and Michel Dagenais (michel.dagenais@polymtl.ca). + In the coming months, several groups and individuals are expected + to join this effort and take responsability for various parts of the + package hierarchy. + +
The latest version of PM3 may be obtained from m3.polymtl.ca by + WWW or + (FTP). + +
A binary distribution of PM3 contains executable programs, libraries, + and run time data files (scripts, bitmaps, document type definitions...). + It comes in a tar compressed file and may be untarred from the root + directory. As explained below, you need to set appropriately the PATH + environment variable, and possibly the LD_LIBRARY_PATH environment + variable on some of the platforms supporting shared libraries. +
+ In the examples below, TARGET refers to the platform name and + should be replaced by LINUXELF, SPARC, SOLgnu... depending on your + target platform, and version refers to the PM3 version. +
+ The PATH environment variable must contain the directory where the + executable programs reside, typically /usr/local/pm3-1.1/bin. + On platforms with shared libraries (dynamically linked), the dynamic linker + must find the shared libraries along its path. Typically, the LD_LIBRARY_PATH + environment variable will need to include + /usr/local/pm3-1.1/lib/m3/TARGET. + For some platforms (LINUXELF, SPARC, SOLgnu), the shared libraries paths + are specified at link time and LD_LIBRARY_PATH need not contain + anything, if the shared libraries are at the location specified at link time. +
+ Some programs require data files at run time. The locations for these files may + be specified as a command line option for the program. Default locations + use the values specified in the m3config library. These values reflect + the compiler configuration templates at the time m3config was compiled. + For the compiler itself (m3build and m3ship), a more elaborate scheme is + used to find the templates. A command line option may be set + (-T path), the M3TEMPLATES environment variable may be + specified, and the m3config library values serve as default location. + Failing that, the PATH environment variable is used to locate + m3build and the templates are assume to be reachable from there + using the relative path ../lib/m3/pkg/m3config/src. Because of this, + the compiler finds automatically the templates in most cases, and the + installation may look like: +
+ cassis> cd
+ cassis>ftp m3.polymtl.ca
+ ftp> binary
+ ftp> cd pub/m3/binaries/TARGET
+ ftp> ls
+ ftp> cd version
+ ftp> get usr.tgz
+ ftp> quit
+ cassis> cd /
+ cassis> tar xpfz ~/usr.tgz
+ cassis> rm ~/usr.tgz
+ cassis> setenv PATH /usr/local/version/bin:${PATH}
+ cassis> setenv LD_LIBRARY_PATH \
+ > /usr/local/version/lib/m3/TARGET:${LD_LIBRARY_PATH}
+ cassis>
+
+ + In rare cases, (e.g. if the system libraries are at an unusual location), + you may need to modify the templates in order to reflect your system + configuration. This is achieved by examining the content + of /usr/local/pm3-1.1/lib/m3/pkg/m3config/src/COMMON and + overriding the improper variables and functions in the + platform specific template + /usr/local/pm3-1.1/lib/m3/pkg/m3config/src/TARGET. + +
+ For a source only distribution, you need a compatible version of m3build and + m3ship already installed. The PATH and LD_LIBRARY_PATH environment + variables also need to be set properly as explained in the previous section. + You may then customize the compiler configuration files in m3config/src, + select the packages to compile in src/m3makefile, + and then proceed with the compilation and installation + (m3build -DRECURSIVE). + +
+ cassis> cd
+ cassis>ftp m3.polymtl.ca
+ ftp> binary
+ ftp> cd pub/m3/pkg
+ ftp> ls
+ ftp> get version.tgz
+ ftp> quit
+ cassis> tar xpfz version.tgz
+ cassis> rm version.tgz
+ cassis> setenv PATH /usr/local/version/bin:${PATH}
+ cassis> setenv LD_LIBRARY_PATH \
+ > /usr/local/version/lib/m3/TARGET:${LD_LIBRARY_PATH}
+ cassis> cd version
+ cassis> m3build -DRECURSIVE
+
+
+ + The bootstrap for a platform contains the assembly source for all the files + comprising m3build and m3ship, and suitable makefiles. + The PATH and LD_LIBRARY_PATH environment variables need to be set properly as + in the previous sections. You may then customize the top level bootstrap + makefile Makefile if needed, customize + the compiler configuration files in m3config/src, + select the packages to compile in src/m3makefile, + and then proceed with the compilation and installation (make). + +
+ cassis> cd
+ cassis>ftp m3.polymtl.ca
+ ftp> binary
+ ftp> cd /pub/m3/pkg
+ ftp> ls
+ ftp> get version.tgz
+ ftp> cd /pub/m3/bootstrap/TARGET
+ ftp> get version.tgz boot.tgz
+ ftp> quit
+ cassis> tar xpfz version.tgz
+ cassis> tar xpfz boot.tgz
+ cassis> rm version.tgz boot.tgz
+ cassis> setenv PATH /usr/local/version/bin:${PATH}
+ cassis> setenv LD_LIBRARY_PATH \
+ > /usr/local/version/lib/m3/TARGET:${LD_LIBRARY_PATH}
+ cassis> cd version
+ cassis> make
+
+
+
+
+
+
+
Index: m3/pm3/intro/src/logo.gif
Index: m3/pm3/intro/src/m3makefile
diff -c /dev/null m3/pm3/intro/src/m3makefile:1.2
*** /dev/null Tue Feb 10 23:29:05 1998
--- m3/pm3/intro/src/m3makefile Tue Feb 10 22:41:03 1998
***************
*** 0 ****
--- 1,17 ----
+
+ import("m3doc")
+ HtmlFile("ack")
+ HtmlFile("bib")
+ HtmlFile("concise-bib")
+ HtmlFile("contacts")
+ HtmlFile("content")
+ HtmlFile("copyright")
+ HtmlFile("history")
+ HtmlFile("index")
+ HtmlFile("install")
+ HtmlFile("platforms")
+ HtmlFile("todo")
+
+ include_dir("questions")
+
+ OtherPackage("intro")
Index: m3/pm3/intro/src/platforms.html
diff -c /dev/null m3/pm3/intro/src/platforms.html:1.2
*** /dev/null Tue Feb 10 23:29:05 1998
--- m3/pm3/intro/src/platforms.html Tue Feb 10 22:41:03 1998
***************
*** 0 ****
--- 1,111 ----
+
+ + +
+ PM3 has been ported to several platforms. Bootstraps for the following + platforms are currently produced regularly. + +
The following platforms are still active but bootstraps could not be + built lately, mostly because of problems in the gcc based backend. + +
The following platforms have not been active lately. + +
+ In order to port PM3 to a new platform, the following steps are required. + The differences in PM3 between different POSIX platforms are relatively small + and a new port may often be achieved in a matter of a few days or less. + New entries in tables, and new directories, + are obtained by copying the corresponding portions from + an existing similar platform and making a few modifications. + It is assumed that the new platform already fits in 32 or 64 bits, + and POSIX or WIN32; if not, additional work will be required. + +
+ The following items are planned for PM3. Items are listed by + decreasing order of likelyhood of being implemented in the near future. + Help on these items is most appreciated! + +
+ Here is an unordered list of small and large tasks that should be done, + which used to be kept on Bill Kalsow's desk and whiteboard. But, + since it seems to grow rather than shrink over time, here it + is. If you want to work on any of these tasks, go for it. +
+ Copyright (C) 1992, 1996, Digital Equipment Corporation. All rights reserved.
+ See the COPYRIGHT for a full description.
+
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + + Index: m3/pm3/intro/src/questions/.ghindex.html diff -c /dev/null m3/pm3/intro/src/questions/.ghindex.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:05 1998 --- m3/pm3/intro/src/questions/.ghindex.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,101 ---- + +
++ +
+
+ Glimpse HTTP Search (In string, use ";" for AND and "," for OR between keywords)
+
+ Calling Modula-3 from C is tricky because M3 has a more elaborate run-time + environment. The simplest solution is to make the main program M3 and then + call C via EXTERNAL routines. Calling back into M3 is then relatively + straightforward. +
+ Here's an example. It calls the C code to lodge the identity of the M3 + procedure to be called back which avoids having to know the actual name used + by the linker. +
+ First a little M3 module to be called from C (M3code), then a C module called + by the M3 main and calling the M3 module (Ccode), and finally the main + program (Main): +
+ (* M3code.i3 *)
+
+ INTERFACE M3code;
+ IMPORT Ctypes;
+ PROCEDURE put (a: Ctypes.char_star);
+ END M3code.
+
+ (* M3code.m3 *)
+
+ UNSAFE MODULE M3code;
+ IMPORT Ctypes, IO, M3toC;
+
+ PROCEDURE put (a: Ctypes.char_star) =
+ BEGIN
+ IO.Put (M3toC.StoT (a) & "\n");
+ END put;
+
+ BEGIN
+ END M3code.
+
+ (* Ccode.i3 *)
+
+ <*EXTERNAL*> INTERFACE Ccode;
+ IMPORT Ctypes;
+ PROCEDURE set (p: PROCEDURE (a: Ctypes.char_star));
+ PROCEDURE act (a: Ctypes.char_star);
+ END Ccode.
+
+ /* Ccode.c */
+
+ typedef void (*PROC)();
+ static PROC action;
+
+ void set (p)
+ PROC p;
+ {
+ action = p; /* register the M3 procedure */
+ }
+
+ void act (a)
+ char *a;
+ {
+ action (a); /* call the M3 procedure */
+ };
+
+ (* Main.m3 *)
+
+ UNSAFE MODULE Main;
+
+ IMPORT Ccode, M3code, M3toC;
+
+ BEGIN
+ Ccode.set (M3code.put);
+ Ccode.act (M3toC.TtoS ("Hello world"));
+ END Main.
+
+ (* m3makefile *)
+
+ import(libm3)
+
+ interface ("Ccode")
+ c_source ("Ccode")
+ module ("M3code")
+ implementation("Main")
+ program("mixed")
+
+
+
+
Index: m3/pm3/intro/src/questions/ESChecking.html
diff -c /dev/null m3/pm3/intro/src/questions/ESChecking.html:1.1.1.1
*** /dev/null Tue Feb 10 23:29:05 1998
--- m3/pm3/intro/src/questions/ESChecking.html Sat Jan 31 14:47:15 1998
***************
*** 0 ****
--- 1,12 ----
+ + The Trestle (ui library) interfaces contain Locking level pragmas. + The base interfaces (libm3 library) contain SPEC pragmas. These are + not processed by the compiler. Instead the Extended Static Checker, + currently under development at DEC SRC, will report on problems + detected based on the program content and the information specified in + these pragmas + [ESC]. + The Extended Static Checker is not yet available, it may be some time in the + future. Index: m3/pm3/intro/src/questions/bookstore.html diff -c /dev/null m3/pm3/intro/src/questions/bookstore.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:05 1998 --- m3/pm3/intro/src/questions/bookstore.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,10 ---- +
+ If you cannot find some of the Modula-3 books at your favorite bookstore, + here are bookstores connected to the net known to carry them: + UCI Bookstore , + Roswell Electronic Computer Bookstore + (rjames@fox.nstn.ns.ca) +
+ Index: m3/pm3/intro/src/questions/compare.html diff -c /dev/null m3/pm3/intro/src/questions/compare.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:05 1998 --- m3/pm3/intro/src/questions/compare.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,24 ---- +
+ From: laszlo@post.ifi.uni-klu.ac.at (Laszlo BOESZOERMENYI) +
+ A Comparison of Modula-3 and Oberon-2 + by myself in + Structured Programming 1993, 14:15-22 +
+ From: nayeri@gte.com +
+ Robert Henderson, Benjamin Zorn, + A Comparison of Object-Oriented Programming in Four Modern Languages, + Department of Computer Science, University of Colorado, Boulder, Colorado, + Technical Report CU-CS-641-93. +
+ The paper evaluates Oberon, Modula-3, Sather, and Self in the + context of object-oriented programming. While each of these + programming languages provide support for classes with inheritance, + dynamic dispatch, code reuse, and information hiding, they do so in + very different ways and with varying levels of efficiency and simplicity. + A single application was coded in each language and the experience + gained forms the foundation on which the subjective critique is based. +
Index: m3/pm3/intro/src/questions/contrib.html diff -c /dev/null m3/pm3/intro/src/questions/contrib.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:05 1998 --- m3/pm3/intro/src/questions/contrib.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,17 ---- + +
+Contributions are most welcome. The primary contact to offer + contributions is comp.lang.modula3. + +
+ + The Ecole Polytechnique de Montréal Modula-3 distribution + is the most regularly updated and may be a good place to submit your + contribution. + + Index: m3/pm3/intro/src/questions/copyObject.html diff -c /dev/null m3/pm3/intro/src/questions/copyObject.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:05 1998 --- m3/pm3/intro/src/questions/copyObject.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,38 ---- +
++ Deep copies are easily performed using Pickles. An object graph is + Pickled to a text writer into a TEXT. Then, a copy is created by + unpickling a new object graph from a text reader created from the + TEXT. +
+ Shallow copies are less often needed but may be performed with the + following procedure: + +
+ PROCEDURE Duplicate (r: REFANY): REFANY = + VAR + tc := TYPECODE (r); + n_dims : INTEGER; + res : REFANY; + shape : RTHeapRep.ArrayShape; + BEGIN + IF (r = NIL) THEN RETURN NIL END; + + (* allocate a new object of the same type (and shape) as the old one *) + RTHeapRep.UnsafeGetShape (r, n_dims, shape); + IF (n_dims <= 0) + THEN res := RTAllocator.NewTraced (tc); + ELSE res := RTAllocator.NewTracedArray (tc, SUBARRAY(shape^, 0, n_dims)); + END; + + (* copy the old data into the new object *) + RTMisc.Copy (RTHeap.GetDataAdr (r), RTHeap.GetDataAdr (res), + RTHeap.GetDataSize (r)); + + RETURN res; + END Duplicate; ++ Index: m3/pm3/intro/src/questions/cpp.html diff -c /dev/null m3/pm3/intro/src/questions/cpp.html:1.2 *** /dev/null Tue Feb 10 23:29:05 1998 --- m3/pm3/intro/src/questions/cpp.html Sat Jan 31 15:48:43 1998 *************** *** 0 **** --- 1,34 ---- +
+ There is no problem to call C++ functions declared as + extern C. You must use a C++ aware linker (e.g. the C++ compiler). + A complete example of M3 calling C++ objects, which in turn call + M3 callbacks, is available in + the sgml library. +
+ On some platforms, a call to get the static variables constructors called may + be required: +
+ From: gwyant@cloyd.East.Sun.COM (Geoffrey Wyant - Sun Microsystems Labs BOS) +
+ You must use your C++ compiler as the linker, rather than /bin/cc + or /bin/ld. +
+ You need to call the function '_main'. The easiest way to do this + is to have the following set of interfaces and implementations: +
+
+ INTERFACE CXXMain; + <*EXTERN "_main"*> CxxMain; + END CXXMain; + + MODULE CXXMain; + BEGIN + CxxMain(); + END;+
+ and then import CXXMain into your M3 main module. This will + ensure that the C++ function _main gets called. +
+ Index: m3/pm3/intro/src/questions/debug.html diff -c /dev/null m3/pm3/intro/src/questions/debug.html:1.2 *** /dev/null Tue Feb 10 23:29:05 1998 --- m3/pm3/intro/src/questions/debug.html Sat Jan 31 15:48:43 1998 *************** *** 0 **** --- 1,8 ---- +
+ The garbage collector on some platforms uses the SEGV (segmentation + violation) signal to detect modified portions of the dynamically + allocated space. It is possible to disable this feature or to inform + the debugger to let these signals propagate. See the + m3gdb documentation. Index: m3/pm3/intro/src/questions/flush.html diff -c /dev/null m3/pm3/intro/src/questions/flush.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:05 1998 --- m3/pm3/intro/src/questions/flush.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,10 ---- +
+ Modula-3 Writers are buffered. Thus, you need to issue a Wr.Flush when + the output should appear immediately, for instance to prompt the user + for some input. Since this can become annoying, libraries in other languages + sometimes offer the option of unbuffered writes. In Modula-3, an equivalent + behavior is obtained with AutoFlushWr which gets a background thread to + flush a writer at a specified interval. +
Index: m3/pm3/intro/src/questions/implementations.html diff -c /dev/null m3/pm3/intro/src/questions/implementations.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:05 1998 --- m3/pm3/intro/src/questions/implementations.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,24 ---- + +
++ All implementations are based on + + DEC SRC Modula-3. + Critical Mass + offers an improved version with commercial support. It features incremental + garbage collection on NT, and a few additional packages like + ODBC database access. + Ecole Polytechnique de Montréal has an + updated distribution. + It features integrated documentation, weekly updates, pre-compiled + binaries for several platforms, and debugging support on NT. +
+ Special versions have been developed for OS/2 and DOS and are available + on the Polymtl site. + + Index: m3/pm3/intro/src/questions/interfaces.html diff -c /dev/null m3/pm3/intro/src/questions/interfaces.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:05 1998 --- m3/pm3/intro/src/questions/interfaces.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,46 ---- + +
++ Allan Heydon on comp.lang.modula3, May 4th 1993: + +
+ Modula-3 provides two separate mechanisms for data-hiding: one for + hiding details about how interfaces are implemented, and the other + for hiding details about how objects are implemented. + +
+ The first data-hiding mechanism is realized by the distinction between + interfaces and modules. Clients can only import interfaces, so the + names declared in the modules implementing those interfaces are hidden + from clients. Note that this mechanism has only two levels; a name + is either declared in an interface, or it isn't. If a name is only + declared in a module, it can't be used by a client. + +
+ The second data-hiding mechanism is realized by opaque types and + revelations. A Modula-3 interface may declare an object type to be + opaque, in which case only a subset of the fields and methods of + that object are revealed to clients importing the interface. Furthermore, + the Modula-3 revelation mechanism allows a designer to reveal successively + more fields and methods of an object in a series of interfaces. The + fields and methods visible to a client then depends on which interfaces + the client imports. + +
+ The latter mechanism is quite flexible. As opposed to the interface/module + data-hiding mechanism, opaque types allow you to define an arbitrary + number of levels at which more and more information about the implementation + of your object is revealed. + +
+ See Sections 2.2.10, 2.4.6, and 2.4.7 of "Systems Programming with + Modula-3" for more information about opaque types and about partial + and complete revelations. + + + Index: m3/pm3/intro/src/questions/m3doc.html diff -c /dev/null m3/pm3/intro/src/questions/m3doc.html:1.2 *** /dev/null Tue Feb 10 23:29:05 1998 --- m3/pm3/intro/src/questions/m3doc.html Sat Jan 31 15:48:43 1998 *************** *** 0 **** --- 1,31 ---- + +
++ A concise bibliography and a more + complete bibliography describe Modula-3 + related books, technical reports, and papers. + The definition of Modula-3 is contained in: + "System Programming with Modula-3" + also known as SPwM3. + Sam Harbison has written a more tutorial book titled + Modula3. + +
+ Three main Web servers contain Modula-3 related information: + www.m3.org, + + DEC SRC Modula-3 home page, + and + Ecole Polytechnique de Montré + Modula-3 home page. + +
The Usenet newsgroup comp.lang.modula3 is the official meeting place + for Modula-3 related discussions. + + + Index: m3/pm3/intro/src/questions/m3makefile diff -c /dev/null m3/pm3/intro/src/questions/m3makefile:1.1 *** /dev/null Tue Feb 10 23:29:05 1998 --- m3/pm3/intro/src/questions/m3makefile Sat Jan 31 15:28:00 1998 *************** *** 0 **** --- 1,31 ---- + HtmlFile("CcallM3") + HtmlFile("ESChecking") + HtmlFile("bookstore") + HtmlFile("compare") + HtmlFile("contrib") + HtmlFile("copyObject") + HtmlFile("cpp") + HtmlFile("debug") + HtmlFile("flush") + HtmlFile("implementations") + HtmlFile("interfaces") + HtmlFile("m3doc") + HtmlFile("m3superset") + HtmlFile("make") + HtmlFile("missing") + HtmlFile("new") + HtmlFile("noconnect") + HtmlFile("opaque") + HtmlFile("openwin") + HtmlFile("ptf") + HtmlFile("questions") + HtmlFile("raw-io") + HtmlFile("size") + HtmlFile("srcm3") + HtmlFile("support") + HtmlFile("uppercase") + HtmlFile("varconst") + HtmlFile("vtalarm") + HtmlFile("whatism3") + HtmlFile("whereused") + HtmlFile("xnotfound") Index: m3/pm3/intro/src/questions/m3superset.html diff -c /dev/null m3/pm3/intro/src/questions/m3superset.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:05 1998 --- m3/pm3/intro/src/questions/m3superset.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,6 ---- +
+ No; valid Modula-2 programs are not valid Modula-3 programs. However, + there is a tool to help convert Modula-2 programs to Modula-3. +
Index: m3/pm3/intro/src/questions/make.html diff -c /dev/null m3/pm3/intro/src/questions/make.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:05 1998 --- m3/pm3/intro/src/questions/make.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,11 ---- +
+ The Modula-3 compiler m3 does a much finer grained dependency analysis than + possible with make. For this reason, a very flexible front end, m3build, + reads the program description files, m3makefile, and generates the commands + required to compile and link Modula-3 programs and libraries. The m3makefile + content is documented in the m3build documentation. Calling the m3 compiler + directly is difficult and thus not recommended, especially on PM3 where + it is now merged with m3build. +
Index: m3/pm3/intro/src/questions/missing.html diff -c /dev/null m3/pm3/intro/src/questions/missing.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:05 1998 --- m3/pm3/intro/src/questions/missing.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,8 ---- +
+ The standard library, libm3, is not included by default. You need in your + m3makefiles to import("libm3") or to import a library which imports libm3. + Otherwise, messages about run time procedures such as RTHooks not being + available are produced. +
Index: m3/pm3/intro/src/questions/new.html diff -c /dev/null m3/pm3/intro/src/questions/new.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:05 1998 --- m3/pm3/intro/src/questions/new.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,495 ---- +
+ No, this turns out to be quite a thorny problem. I think + the best thing I can do is by attaching to this message the + dialog that went on during the "beta test" of the new library interfaces + (SRC Research Report 113, "Some Useful Modula-3 Interfaces). The + parties are Xerox PARC's David Goldberg, Hans Boehm, Alan Demers, + and David Nichols, and SRC's John DeTreville, who designed and implemented + the garbage collector in SRC Modula-3. The dialog covers many of + the issues, and apparently ends when the participants run out of + steam. +
+ Paul McJones + mcjones@src.dec.com + (editor of SRC 113) + +
+ David Goldberg: ... there is one system problem that is not currently + handled, namely running out of memory. I would very, very much + like to see this handled in RTAllocator. One approach was + suggested by Roy Levin a while back: Have a RegisterNoMemory(proc) + routine that causes proc() to be called when memory is gone (or + very low). Example of use: in the 'Solitaire' program, the 'Hint' + button generates a tree of possible moves. If this tree gets very + big and consumes all memory, the RegisterNoMemory proc could + abandon the search down the current branch, NIL-out that branch, + and ask for a garbage collection. Currently what happens is that + Solitaire crashes if you bug 'Hint' and memory is low. +
+ Interface Police: Ok, make a concrete proposal and we'll talk. How + low should memory be before the runtime complains? Before or + after a collection? Is it ok to call your procedure from inside + a runtime critical section (after all, you're probably in the + middle of a NEW)? Are multiple notification procedures allowed + to be registered? Shouldn't a routine that consumes arbitrary + amounts of memory be coded to poll the allocator to ask how much + memory is available? +
+ Hans Boehm/Alan Demers/David Goldberg/David Nichols: + We believe that programs wishing to handle allocation failures + will be able to do so with high (but not perfect) reliability if + the interface provides two features: versions of the + RTAllocator.New routines that report if the allocation is not + possible (either by returning NIL or raising an exception), and a + way to register a callback when memory is low. Both features are + necessary. Here are two typical scenarios: +
+
+ Unfortunately, there is a race condition since another thread + could run and do an allocation between the time the faulting + NEW returns and all references to the search tree are NIL'ed. + This can be mimimized by adding some slop to the safety net. + +
+ However, the editor will also want to register a callback proc + to guard against NEW()s in other parts of the program that + can't be satisfied. If the callback is passed the size of the + memory allocation that can't be satisfied, the callback will + be able to pick between two strategies. If there is a 'safety + net' which is larger than the block to be allocated, the + callback can free it and set a "low on memory" flag, with the + editor cleaning up properly later. If the safety net is not + big enough, the callback itself can attempt an emergency save + before crashing. +
+ Here's a specific proposal that embodies these ideas. We're not + wedded to the details. Note that RTCollector.LimitRelative is not + essential: it just lifts some of the functionality currently in + RTHeapPolicy. +
+
+ PROCEDURE LimitAbsolute(n: CARDINAL); + + (* Don't let the heap grow beyond n bytes. The collector/allocator + should observe this in all heap growth decisions. *) + + [Comment from Hans: I don't think there is a way to write + programs that are reasonable citizens on a shared system without + some such facility.] + + PROCEDURE LimitRelative(x: REAL); + + (* Advisory. Try to keep the heap size at roughly x times the + amount of live data. (For ref counting it affects only the + backup collector for cycles.) *) + + [Comments from Hans: The performance of all collectors with + which I am familiar depends crucially on such a parameter. Thus + it might as well be exposed in some portable interface. (The + allocator should of course use less memory if it gains no time + advantage from using more.) The "amount of live data" is, of + course, implementation defined, as are the minimum values of x + that have any chance of being observed.] ++ +
+ EXCEPTION OutOfMemory; + + TYPE + CallBackObj = OBJECT notify(bytes: CARDINAL) END; + + PROCEDURE RegisterHeapFullCallback(obj: CallBackObj); + + (* Add obj.notify to the list of procs to be called if an + allocation request is about to fail, either because of lack + of memory, or due to violation of an + RTCollector.LimitAbsolute imposed limit. The notify method + will be called with an argument specifying the size in bytes + of the allocate call that triggered the callback. The notify + method may not allocate or acquire locks, or call any + procedures that do. It may be invoked synchronously with any + combination of locks held. (Should there be a way to delete + a registered callback?). If a garbage collection after this + callback fails to reclaim enough memory to allocate the + requested object, an exception will be raised if the + allocation was through RTAllocator. Otherwise a checked + runtime error will result. The notify proc is not called + when memory fails from an RTAllocator.New call (these + failures can be caught by the user). + + Typical actions by notify would include one of the following: + + 1) Clearing pointers to reduce the amount of accessible memory. + 2) Calling RTCollector.LimitAbsolute with a larger limit. + *) ++ +
+ Might want to consider adding: +
+
+ PROCEDURE GetLimitAbsolute(): CARDINAL; + (* Return the current absolute heap limit *) ++
+ The usefulness of RTCollector.LimitAbsolute in the callback + would be increased if there was a way to tell if this actually + freed up any more memory. One approach would be to change + CallBackObj to +
+
+ TYPE + CallBackObj = OBJECT + notify(bytes: CARDINAL; retry: BOOLEAN): BOOLEAN + END; ++
+ and change the action of RegisterHeapFullCallback to: +
+
+ (* If a garbage collection after all callbacks have been + executed fails to reclaim enough memory to allocate the + requested object, then any notify() procs that returned TRUE + will be called again with retry := TRUE. Otherwise an + exception will be raised if the allocation was through + RTAllocator, or else a checked runtime error will result. *) ++
+ Thus, if you wanted to first try and get more memory in the + callback by calling RTCollector.LimitAbsolute, you could return + TRUE and wait for a callback with retry = TRUE. If this second + callback occurs, you will need to clear some pointers to free up + memory. Or another variation: add +
+
+ PROCEDURE GetTotalBytesAllocated(): CARDINAL; + (* Returns the total number of bytes allocated since the program + begin. A CARDINAL may not be big enough, perhaps this should + be a LONGREAL? *) ++
+ Then the retry argument to the notify method can be eliminated, + since a call is a retry only if GetTotalBytesAllocated() shows + no additional allocations since the last callback. +
+ + John DeTreville: When I read your March proposal for handling running + out of memory on the traced heap, I didn't quite see how to + implement the details you gave. I've been iterating to create + mechanisms that are simpler and more implementable, and I've now + arrived at quite a simple interface. +
+ In particular, I now believe that (almost) all the functionality + you ask for is already provided by the current interface. I say + "almost" because there's a few status calls to be added, and + because some of the current mechanisms are clunky, but I believe I + can tell a convincing story. Note that these mechanisms are or + would be in SRC-specific interfaces (currently called + RTAllocatorSRC, RTCollectorSRC, and RTHeapRep); I don't think we + understand them well enough to put them into the public IP + interfaces. +
+ Let's first distinguish VM limits from application-imposed limits. + The amount of VM available to the application is a hard limit, + although not one that can easily be predicted. In the current SRC + M3 implementation, both the allocator and the collector allocate + VM from the kernel when necessary. If the collector tries to + allocate VM and fails, the program must crash: there is no way to + reestablish the necessary invariants to let it continue. +
+ I propose treating VM exhaustion as a checked runtime error, in + the allocator and in the collector. The goal is then to establish + and maintain an application-imposed limit that is uniformly + stricter than the VM limit, whatever that may be. +
+ You propose a mechanism to allow calls to the New* procedures to + fail if they would exceed the application-imposed limit. Of + course, only a small part of the code would take advantage of this + facility. This code could equally well query the heap to + determine the current size, and compare it against the limit; if + the program can also predict the size of the object to be + allocated, it can decide whether or not to proceed. +
+ This approach requires some collector-dependent code in the + application, but I doubt that it would be very much. It also + allows possible race conditions, but I believe they're not much + worse in practice than in the original proposal. +
+ You also propose a mechanism to notify the program whenever the + limit is about to be exceeded. It's quite complicated to get such + immediate notification. First, the procedures notified can't + acquire locks or call most procedures in other modules. Second, + it requires a new collection to run synchronously after the + procedures to see if enough space has been freed and whether some + of the procedures must be called again; this causes an + interruption of service. +
+ Here's a different proposal, which might not allow space bounds as + tight as in the original proposal, but which seems simpler. We + would add a mechanism for an application thread to wait for the + next collection to finish. This mechanism could replace the + current mechanisms for registering and unregistering synchronous + monitors, which have numerous complex and poorly documented + constraints on what actions they can perform. +
+ Each time through, the thread could compare the amount of space + still reachable to the application-imposed limit, and either free + some data before the next collection (the ability to hold locks + would be handy here) or increase "gcRatio" to make the collector + work harder and keep the total heap size under control, or both. +
+ There is still the danger that the application could allocate so + rapidly that this asynchronous thread might not be able to keep + up, but otherwise asynchronous actions seem a lot more reasonable + than synchronous. +
+ This is one approach, and there are others. What's nice about + this design is that it requires almost no changes to the + interface, only better status reporting and a replacement of the + mechanisms for registering and unregistering synchronous + collection monitors. Maybe you could even work around the current + lack of these facilities. Let me know what you think. +
+ Hans: One quick comment, without having thought much about the + rest: +
+ "This code could equally well query the heap to determine the + current size, and compare it against the limit; if the program + can also predict the size of the object to be allocated, it + can decide whether or not to proceed." +
+ Is this really true? Since the collector can't move some objects, + there are presumably fragmentation issues. Am I guaranteed to be + able to allocate 1 MB if the current heap size is 1 MB below the + limit? This is certainly false in PCR, and I'm not sure how you + could guarantee it without remapping pages. +
+ John: Hans Boehm notes that I was wrong about the client of New* + being able to predict whether an allocation would succeed or fail, + because of likely page-level fragmentation. This needs to be + fixed in my proposal. +
+ To expand on my earlier message, let me outline a completely + different approach for handling heap overflow, that perhaps has + more in common with the original PARC proposal, but which seems + far too complex and unwieldy to me. This complexity is why I + tried to work out a simpler approach, even at the cost of + providing fewer guarantees. +
+ We start by imagining that we want to be able to continue to run + even if we exhaust VM. First, this means that we can never + allocate VM from inside the collector. The implication is that + whenever we allocate VM in the allocator, we allocate enough extra + to tide us over through the next collection, no matter how much of + the heap it retains. This suggests that we will significantly + overallocate VM. For example, with a stop-and-copy collector and + gcRatio set to 1, a program with a stably-sized reachable set + currently requires 3 times as much space as the reachable set, but + the "failsafe gc" would require 4 times. +
+ (Doing even this well depends crucially upon the SRC + implementation detail that the current collector never copies + objects bigger than one page, but leaves them in place. + Otherwise, the possibility of fragmentation would make it much + more difficult to determine how much memory to leave free for the + collector, and in what sizes of runs of pages. It will also take + some work to avoid off-by-one errors in predicting how much memory + a collection could take.) +
+ Of course, if the client decreases gcRatio, or switches from + sort-and-copy collection to concurrent collection, that would + require allocating more VM, to ensure that the collector cannot + run out of VM. That means that these operations can also fail, + just like allocator operations. +
+ Only some programs will want to be able to back off when they + reach VM limits. Others won't mind getting a checked runtime + error; in return, they will require less VM. Therefore, we need + procedures to switch back and forth between these two modes. + Again, attempting to switch to failsafe mode can fail. +
+ The collector currently allocates its own space on the traced heap + during collections, which will have to be moved to the untraced + heap if we are to predict how much traced heap a collection can + use. Note that in general, once VM is exhausted, allocations on + the untraced heap may start to fail, and so programs will probably + die very quickly once VM is exhausted. But let's move on. +
+ In addition to the VM limit, we also want an application-imposed + limit on heap size. The allocator and collector will guarantee + that the heap size will never exceed this limit. Again, we will + overallocate VM in the allocator to avoid exceeding the limit in + the collector. Again, setting the limit may fail. +
+ So what happens when a NEW fails, or a New*, or switching to + concurrent collection, or setting the application-imposed limit, + or whatever? This happens whenever performing the operation would + exceed the application-imposed limit, or when attempts to allocate + enough extra VM fail. +
+ Some of these can signal an error, and the client can chose to do + something else instead. In some cases, such as setting gcRatio, + it might make sense for the failing operation to tell the client + how close to the impossible value would be possible. +
+ NEW, though, should not signal an error; this would require + massive changes in all existing modules that would not be add + value to most clients. In this case, I can't think of anything + much better than the original proposal. Before attempting to + allocate the object, the collector will try to free up some + storage. First, it can perform a collection, or finish the + current one. If that doesn't do it, it can call one or more + procedures registered by the application to drop links to some + storage, or to change collector parameters. If that doesn't do + it, we can perform another collection. And so on and so on, until + the procedures say to give up. +
+ Note that these collections must be synchronous, since no + allocations may be possible until this mechanism completes, and + the collections will therefore cause interruptions of service. + Note also that the procedures cannot acquire locks, cannot + allocate storage, cannot call thread primitives, and so on, and + therefore cannot call into most libraries; they are essentially + restricted to reading and writing data structures whose + implementations they know, and changing collector parameters. + This seems excessively restrictive, but also unavoidable in this + approach. +
+ In short, this seems like a lot of extra mechanism to add to the + allocator and collector, that doesn't seem to do quite what you + want; it gives you strict limits, but at a cost. My proposal of + this morning is at least much simpler, although it can give looser + limits. +
+ John, continuing: Thinking a little more about the problem of running + out of storage in the untraced heap, it seems that the only + reasonable thing to do is to merge the implementation of the + untraced heap with the traced heap. This was, untraced NEWs that + fail can be handled exactly the same way as traced NEWs, with a + synchronous cleanup routine that frees enough VM to proceed, or + resets parameters. +
+ This means that the allocator and collector cannot use the + untraced heap, but must either use a static amount of storage + which they could overflow, or must allocate enough extra in + response to client applications that they cannot possibly run out + of space. The potential space overhead for maximum-sized stacks, + for example, is huge. +
+ The more this proposal is fleshed out, it more it seems that doing + a good job of recovering from heap overflows is quite tricky, + which is why I suggest a lower-tech approach for now. +
+ Hans: I just went over the last few messages in this thread again. I + think the bottom line is, as you say: +
+ It's hard to implement an out-of-memory call-back on top of the + current collector. Given the current collector, a collector + call-back that allows polling is probably the best you can + reasonably do, and should certainly be provided. +
+ The remaining question, which also seems to be motivated by other + concerns here, is: To what extent are you tied to this collector + design? The problem here seems to be mainly caused by copying old + generation objects, since you could perhaps bound the size of the + young generation? My suspicion, based unfortunately only on + anecdotes, is that this is not a good idea anyway, since it uses + too much space, and is also fairly expensive in copying cost. + (PARCPlace seems to have arrived at the same conclusion, so + there's probably at least one other supporter of this position. + Some recent complaints here about space usage of Modula-3 programs + also point a bit in this direction.) +
+ Do you agree? If so, should the interface be designed ignoring + current constraints, and should we initially accept a partial + implementation? +
+ John: It's been a while, so let me recap where we are, or at least + where I am. +
+ We've been discussing mechanisms for Modula-3 programs to manage + their memory better. In particular, we have proposed ways that + programs could bound the heap size and recover from heap overflow. +
+ I think this topic is complicated enough, and new enough, that we + shouldn't try to get it into the current set of portable + interfaces. The Interface Police concur. +
+ We've floated two broad (families of) proposals for attacking this + problem: +
+
+ I think that the first is achievable. Adapting the current SRC Modula-3 + (allocator and) collector to allow such guarantees would take a + month or so. The principal problem is that the current collector + tries to maximize space/time performance, and giving such + guarantees will probably require extra memory to be set aside that + will never be used. The collector would have two modes: with or + without guarantees. Most programs would run without guarantees. +
+ I also think that a usable version of the second is possible with almost + no change to the current collector. The programmer would have to + do more work, and wouldn't get any strong guarantees, but this + approach should work for many programs. +
+ We've also been discussing a third family of proposals, that seem + to combine the worst features of the first and second: they require + significant changes to the current collector, but son't give very + strong guarantees. These seem much less interesting to me. +
+ Here's two pieces of opinion. +
+ First, I propose that we work out the details of #2, and you use + it for a couple of programs. Get some experience with it. This + could help inform a heavier-weight solution. +
+ Second, I wonder whether any of these solutions is a good + candidate for a portable interface. It's one thing not to be + strictly incompatible with a given collector strategy, but quite + another to be easy to plug into an existing collector. Modula-3 + currently doesn't require very much from its collector; making + these proposals standard would significantly increase the + requirements on a Modula-3 implementor. +
+ Index: m3/pm3/intro/src/questions/noconnect.html diff -c /dev/null m3/pm3/intro/src/questions/noconnect.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:05 1998 --- m3/pm3/intro/src/questions/noconnect.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,14 ---- +
+ Graphical applications (based on Trestle/X Windows) raise the + TrestleComm.Failure exception when the DISPLAY environment variable is + incorrect or the X server is refusing the connection. They raise + MachineIDPosix.Failure if the network configuration files are + incorrectly set up, especially on LINUX; /etc/hosts must contain at + least a loopback address (127.0.0.1) and the /etc/rc scripts an + appropriate ifconfig command (/etc/ifconfig lo 127.0.0.1; /etc/route + add 127.0.0.1). Applications with Network Objects may also raise + exceptions or consume all the CPU time available when the network + configuration files are incorrect. +
Index: m3/pm3/intro/src/questions/opaque.html diff -c /dev/null m3/pm3/intro/src/questions/opaque.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:05 1998 --- m3/pm3/intro/src/questions/opaque.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,108 ---- +
+ Allan Heydon writes: +
+ These two keywords are necessary because of two quite different + features of the language. REVEAL is necessary because Modula-3 has + opaque types and partial revelations. BRANDED is necessary because the + Modula-3 type system uses structural equivalence instead of name + equivalence. +
+ In Modula-3, the concrete structure of a type can be hidden from + clients in an interface. A common idiom is: +
+
+ INTERFACE I; + + TYPE + T <: TPublic; + TPublic = OBJECT + (* fields *) + METHODS + (* methods *) + END; + + END I.+
+ The line "T <: TPublic" introduces the type "I.T" as an opaque subtype + of the type "I.TPublic". It does not reveal any of the other details + of the concrete structure of "I.T" to clients. Hence, "I.T" is said to + be an opaque type. Put another way, the structure of "I.T" is + only partially revealed to clients. +
+ In addition, it is possible to reveal more of "I.T"'s structure in + other interfaces, like this: +
+
+ INTERFACE IRep; + + IMPORT I; + + TYPE + TPrivate = I.TPublic OBJECT + (* more fields *) + METHODS + (* more methods *) + END; + + REVEAL + I.T <: TPrivate; + + END IRep.+
+ This interface declares a type "IRep.TPrivate" that is a subtype of + "I.TPublic". It also asserts that "I.T" is also a subtype of + "IRep.TPrivate". A client that imports only the interface "I" has + access only to the fields and methods in "I.TPublic" when accessing an + object of type "I.T", but a client that imports both "I" and "IRep" + also has access to the fields and methods in "IRep.TPrivate" when + accessing an object of type "I.T". +
+ The "REVEAL" statement in this module simply asserts a subtype + relation. Unlike type declarations, revelations introduce no new + names. Hence, we could not have used the "TYPE" keyword in this case + because the type "I.T" has already been declared once (albeit + opaquely) in interface "I". +
+ Every opaque type must have a complete revelation. A complete + revelation has the form: +
+
+ REVEAL + T = TConcrete;+
+ The revelation specifies that "TConcrete" is the concrete type for the + opaque type "T". +
+ The Modula-3 type system uses structural equivalence instead of name + equivalence. This means that two types are equal iff they have the + same structure. One consequence of this rule is that two types you + might intend to be distinct may actually be equal. This can have + unintended effects on the run-time behavior of your program. For + example, if both types that you expect to be distinct are actually + structurally equivalent and the two types guard two arms of a TYPECASE + statement, the arm for the second type will never be taken. +
+ If you want to avoid accidental equalities between two types, you can + brand one (or both) of them with the BRANDED keyword. A branded type + is equivalent to no other type, even if it is structurally equivalent + to some other type. In essence, the BRANDED keyword adds a bit of + virtual structure to the type that guarantees it will be distinct from + every other type. +
+ The Modula-3 syntax allows you to supply a text constant as a name for + the brand. If you don't supply an explicit brand, the compiler will + make one up; however, the implicit brand invented by the compiler is + not guaranteed to be chosen deterministically. Hence, explicit brands + are useful if you are communicating types from one process to another + and if you want to be sure that the branded type written by one + process matches the branded type read in by the other. +
+ Any two opaque types in a program must be distinct. Otherwise, it + would be too easy for clients to accidentally trip over type + collisions like the TYPECASE example mentioned above. To enforce the + restriction that all opaque types are distinct, the language requires + that the type "TConcrete" in the complete revelation above must be a + branded type. +
Index: m3/pm3/intro/src/questions/openwin.html diff -c /dev/null m3/pm3/intro/src/questions/openwin.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:05 1998 --- m3/pm3/intro/src/questions/openwin.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,15 ---- +
+ Mark Manasse says: +
+ I think that the OpenWindows release should be enough (no need to + get the MIT X release), although there are a few things in Trestle + that trigger devastating bugs in OpenWindows. But the only library + we depend on is Xlib, R4 or later. +
+ The main thing I know that crashes OW 2.0 is the code where we call + GrabKey specifying AnyKey. You can either loop over all of the + keys, or you can just comment out the call; programs won't run exactly + the same, but you probably won't notice the difference. +
Index: m3/pm3/intro/src/questions/ptf.html diff -c /dev/null m3/pm3/intro/src/questions/ptf.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:05 1998 --- m3/pm3/intro/src/questions/ptf.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,21 ---- +
+ Prime Time Freeware (PTF) includes Modula-3. PTF is + a set of two ISO-9660 CDroms filled with 3GB of freeware, issued + semi-annually. PTF is distributed via bookstores and + mail. You can reach PTF using: +
+
+ Email: ptf@cfcl.com + Fax: [1] (408) 738 2050 + Voice: [1] (408) 738 4832 + Mail: Prime Time Freeware + 415-112 N. Mary Ave., Suite 50 + Sunnyvale, CA 94086 + USA+ +
+ Many Linux CDroms include a copy of the FTP site tsx-11.mit.edu which + has Linux binaries for Modula-3. + Index: m3/pm3/intro/src/questions/questions.html diff -c /dev/null m3/pm3/intro/src/questions/questions.html:1.2 *** /dev/null Tue Feb 10 23:29:06 1998 --- m3/pm3/intro/src/questions/questions.html Tue Feb 10 22:41:10 1998 *************** *** 0 **** --- 1,41 ---- + +
++
+ Characters typed on the keyboard are usually buffered. They + become visible to the reading program only when the buffer is + full or after, for example, a carriage return is received. + This is not specific to Modula-3. To access the characters as + they are typed, single character commands in a full screen + editor for example, the input reader must be configured properly. +
+ From: rrw1000@cus.cam.ac.uk (Richard Watts)
+
+
+ The POSIX way of doing it is to use tcsetattr(), and here is some + code that does it under Solaris 2.x (this was written for serial ports, + but the same thing applies) : +
+
+ PROCEDURE Open(port : CHAR; timeout : INTEGER := 30) : T RAISES {Error} =
+ VAR
+ term : TcPosix.termios;
+ file : TEXT;
+ fd : T;
+ rc : INTEGER;
+ BEGIN
+ (* Figure out which device we want to open : *)
+
+ CASE port OF
+ 'A' => file := "/dev/ttya";
+ | 'B' => file := "/dev/ttyb";
+ ELSE RAISE Error("Invalid port " & Fmt.Char(port) & " specified.\n");
+ END;
+
+ (* Open it. 700 is a good default mode for serial ports. *)
+ fd := Unix.open(M3toC.TtoS(file), Unix.O_RDWR
+ , 8_700);
+ IF fd = -1 THEN
+ RAISE Error("Open() on " & file & " failed.\n");
+ END;
+
+ (* Get the termios structure for it *)
+ rc := TcPosix.tcgetattr(fd, ADR(term));
+ IF rc # 0 THEN
+ EVAL Unix.close(fd);
+ RAISE Error("Couldn't get terminal attributes for " & file & ".\n");
+ END;
+
+ (* Modify the termios structure *)
+
+ (* The default baud rate is right, but we'd better set it anyway
+ in case someone left it set up wrong : *)
+ rc := TcPosix.cfsetospeed(ADR(term), TcPosix.B9600);
+
+ IF rc # 0 THEN
+ EVAL Unix.close(fd);
+ RAISE Error("Couldn't set output speed for " & file & "\n");
+ END;
+
+ rc := TcPosix.cfsetispeed(ADR(term), TcPosix.B9600);
+
+ IF rc # 0 THEN
+ EVAL Unix.close(fd);
+ RAISE Error("Couldn't set input speed for " & file & "\n");
+ END;
+
+ (* Modify the line discipline - reset ECHO and ICANON *)
+ term.c_lflag := Word.And( term.c_lflag,
+ Word.Not(
+ Word.Or(TcPosix.ICANON,
+ TcPosix.ECHO)));
+ term.c_cc[TcPosix.VMIN] := 0;
+ term.c_cc[TcPosix.VTIME] := 0; (* Set up timing right *)
+
+ (* Now reset the terminal attributes *)
+ rc := TcPosix.tcsetattr(fd, TcPosix.TCSANOW, ADR(term));
+
+ IF rc # 0 THEN
+ EVAL Unix.close(fd);
+ RAISE Error("Can't set attributes for " & file & "\n");
+ END;
+ RETURN fd;
+ END Open;
+
+ + (TcPosix.i3 is one of my interfaces, not libm3's, and I'll supply + it if you like, but it's just a wrapper to tcgetattr and friends. The + baud rate stuff shouldn't be necessary for terminals (or serial + ports..) ). You should be able to somehow get an Rd.T out of this, + I think, but it may involve a bit of hacking. + The University of Cambridge can't have these opinions even if it wants them. + + + Index: m3/pm3/intro/src/questions/size.html diff -c /dev/null m3/pm3/intro/src/questions/size.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:06 1998 --- m3/pm3/intro/src/questions/size.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,14 ---- +
+ Modula-3 programs are larger than C programs for the following reasons: +
+
Index: m3/pm3/intro/src/questions/srcm3.html diff -c /dev/null m3/pm3/intro/src/questions/srcm3.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:06 1998 --- m3/pm3/intro/src/questions/srcm3.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,53 ---- + +
++ SRC-Modula-3 + was built by the DEC Systems Research Center and is freely available and + redistributable, with source code. + In Europe it is also available from + ftp-i3.informatik.rwth-aachen.de in pub/Modula-3. + The most recent version is release 3.6 +
+ The DEC SRC Modula-3 contains the following: +
+
+ The compilation system provides for minimal recompilation. + Only those units that depend on the modified interface item + will be recompiled. +
+
+ All standard libraries are thread-friendly. + Modula-3 can readily link with existing C libraries; many libraries + including X11R4 and various UNIX libraries are available as + part of libm3. +
+ Critical Mass Corporation offers an integrated development environment + for Modula-3, Reactor, + as well as training and consulting services. +
+ Index: m3/pm3/intro/src/questions/uppercase.html diff -c /dev/null m3/pm3/intro/src/questions/uppercase.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:06 1998 --- m3/pm3/intro/src/questions/uppercase.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,10 ---- +
+ Some people prefer uppercase keywords others hate them. Another possibility + is to accept both forms for keywords. This topic has been discussed at length + and there is no solution that will completely satisfy everyone's tastes. + Fortunately this is a very minor issue and you can easily have lowercase + keywords automatically converted for you using an emacs macro package like + m3su . +
Index: m3/pm3/intro/src/questions/varconst.html diff -c /dev/null m3/pm3/intro/src/questions/varconst.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:06 1998 --- m3/pm3/intro/src/questions/varconst.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,58 ---- +
+ John Kominek (kominek@links.uwaterloo.ca) wrote: + Sprinkled throughout SRC m3 you'll find "constant" variables exported + in interfaces. For instance, +
+ VAR (*CONST*) Grain: LONGREAL; ++
+ where Grain is assigned during module initialization. + Instead, did the modula-3 designers consider doing this. +
+ READONLY Grain: LONGREAL; ++
+ Here the keyword permits only exporting modules to modify the + Grain variable. Is there a problem with this proposal? The READONLY + keyword is successfully used at procedure boundaries, so why not + also at interface boundaries? +
+ Bill Kalsow replies: +
+ A problem with this proposal is that any module can claim to export + the interface containing the variable, hence any module could modify + the variable. + Note that CONST says more than just READONLY. CONST implies that the + variable should not be modified by clients and that once it is + initialized, it won't be changed later by the implementation. + READONLY would only mean that clients should not modify the variable. + IMO, the "right" solution would have been to allow: +
+ INTERFACE Foo; + CONST x: T; + + MODULE Foo; + CONST x: T := <value>; ++
+ In the same way it checks revelations for opaque types, the compiler + could check that only one module provided a value for the constant. + But, this proposal doesn't quite hang together either. + Consider this example: +
+ CONST x: INTEGER; + VAR v: [0..x]; ++
+ The language definition says that "v"s definition is illegal if "x < 0" + because its type is "empty". The system could refuse to run the + program by delaying the check until it had seem the corresponding + implementation module. But, I think you'll agree that it could + quickly turn into a mess. + The most flexible handling of opacity I've seen is in Christian + Collberg's PhD Thesis, "Flexible Encapsulation". It was published Dec + 5, 1992 by the CS Dept at Lund University, Lund Sweden. If I remember + correctly, his system was capable of deferring all checks and + decisions imposed by opaque declarations until link time. Index: m3/pm3/intro/src/questions/vtalarm.html diff -c /dev/null m3/pm3/intro/src/questions/vtalarm.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:06 1998 --- m3/pm3/intro/src/questions/vtalarm.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,12 ---- +
+ The threads are implemented using the virtual timer interrupt. Normally, + the run time environment will catch the interrupt and determine if + thread switching is appropriate. However, if a new process is created with + fork, it will have the virtual timer activated and no interrupt handler + to receive it, resulting in a core dump. If you use the standard procedure + Process.Create to fork new processes, this will be handled automatically + for you. If you insist on using fork, you need to disable the timer, + fork and then reenable the timer. +
Index: m3/pm3/intro/src/questions/whatism3.html diff -c /dev/null m3/pm3/intro/src/questions/whatism3.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:06 1998 --- m3/pm3/intro/src/questions/whatism3.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,29 ---- + +
++ Modula-3 is a systems programming language that descends from Mesa, + Modula-2, Cedar, and Modula-2+. It also resembles its cousins + Object Pascal, Oberon, and Euclid. + +
The goal of Modula-3 is to be as simple and safe as it can be while + meeting the needs of modern systems programmers. Instead of + exploring new features, we studied the features of the Modula + family of languages that have proven themselves in practice and + tried to simplify them into a harmonious language. We found that + most of the successful features were aimed at one of two main + goals: greater robustness, and a simpler, more systematic type + system. + +
+ Modula-3 retains one of Modula-2's most successful features, the + provision for explicit interfaces between modules. It adds objects + and classes, exception handling, garbage collection, lightweight + processes (or threads), and the isolation of unsafe features. + + + Index: m3/pm3/intro/src/questions/whereused.html diff -c /dev/null m3/pm3/intro/src/questions/whereused.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:06 1998 --- m3/pm3/intro/src/questions/whereused.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,17 ---- + +
++ A number of programming teams selected Modula-3 for + industrial and research projects, and for teaching. It encourages good + programming practices and comes with excellent libraries for + distributed programming and graphical user interfaces. + A non exhaustive list is available at + [Modula-3 at Work]. + + + Index: m3/pm3/intro/src/questions/xnotfound.html diff -c /dev/null m3/pm3/intro/src/questions/xnotfound.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:06 1998 --- m3/pm3/intro/src/questions/xnotfound.html Sat Jan 31 14:47:15 1998 *************** *** 0 **** --- 1,11 ---- +
+ The position of X libraries is stored, for instance for + pre-compiled PM3 LINUXELF binaries, in the template file + m3config/src/LINUXELF as well as in X11/LINUXELF/.M3EXPORTS + (m3build/templates/LINUXELF, and X11R4/LINUXELF/.M3EXPORTS for + SRC-M3). + Thus you may want to edit these files if your X libraries are + located in an uncommon place. +
Index: m3/pm3/language/m3obliq/src/index.html diff -c /dev/null m3/pm3/language/m3obliq/src/index.html:1.2 *** /dev/null Tue Feb 10 23:29:14 1998 --- m3/pm3/language/m3obliq/src/index.html Tue Feb 10 22:56:00 1998 *************** *** 0 **** --- 1,79 ---- +
++ Libraries and interpreters for the Obliq language. + Obliq may be described as: + +
++Obliq is a small, statically scoped, untyped language. It is + object-oriented, higher-order, and distributed. State is + local to an address space, while computation can migrate + over the network. The distributed computation mechanism is + based on Modula-3 Network Objects. +
+ Quake is a simple, specialized + language drawing on elements of the C language, the + Bourne shell, and the C pre-processor. +
+ + Quake was designed to be a component of + m3build. + Building a complete, general-purpose language was not + one of the goals. M3build + reads a set of quake language templates that define some + operators, then executes an m3makefile in this context. The templates + define procedures to build lists of modules, libraries, and so on. + +
+ + Quake is designed to make it easy to assemble arrays and tables of + strings. The value space is strings, arrays of strings, and tables of + strings. An array is a list of elements, and a table is a set of + key/value pairs where the keys in a table are all distinct. +
+ +
+ + A string is a sequence (delimited by `"') of characters excluding + newline and double quote. Several special characters may be quoted + (with `\') as follows: +
+ new-line ignored + \\ \ + \n new-line + \r return + \t tab + \b backspace + \f formfeed + \" double quote ++
+ +
+ + An array is constructed using `[' and `]'. `[]' is the empty array, + `["a"]' is an array of the single string "a". Elements are separated by + `,'. Thus `["a", "b"]' is an array of two elements---the strings "a" + and "b". +
+ + Arrays are flattened whenever they are referenced. This means that + `["a", ["b", "c"]]' is converted the the array `["a", "b", "c"]'. This + means that an array can never be the element of another array. +
+ + Arrays are accessed by an integer index. `a[2]' is the third element of + the array a. The index expression may also be a string which will be + converted to an integer. The range of the index is checked at run-time. +
+ +
+ + A table is constructed using `{' and `}'. `{}' is the empty table. + Elements of a table are given as key/value pairs. An empty value may be + omitted. `{"a", "b"}' is a table containing two keys---the strings "a" + and "b". `{"p" : "q"}' is the constructor for a table with the single + key "p" whose value is the string "q". Missing values are returned as + "". +
+ + Tables are accessed using expressions of the form `s{"a"}'. This + evaluates to the value of the key "a" in the table s. +
+ +
+ + Names in quake start with an letter (`a'..`z', `A'..`Z') or an + underscore (`_'), followed by those characters, digits (`0'..`9'), + hyphens (`-'), or periods (`.'). +
+ + If the lookup for a name fails (it is undefined in any of the enclosing + scopes) it is installed in the current scope with an initial string + value of the text of the name. +
+ +
+ + C-style comments are supported (delimited by `/*' and `*/') and do not + nest. +
+ + Single-line comments are introduced with `%' and terminated with a new-line. +
+ +
+ + A Boolean value is represented as a string. The empty string is false, + and any other string is true. +
+ +
+ + An expression is: +
+ string: "baz"
+ name: foo
+ environment variable: $CPU_TYPE
+ array selector: array[5]
+ array constructor: ["a", "b"]
+ table selector: t{"a"}
+ table constructor: {"a" : "p", b}
+ function call: f(a, "b")
+ parentheses: a and (b or f(c))
+
+ + + Operators are all left-associative, precedence is decreases from top to + bottom in the following list. +
+ & string catenation (`"Hello, " & foo') + contains table inclusion (`s contains "a"') + not logical negation (`not a') + and logical conjunction (`c and not d') + or logical disjunction (`a or b') ++
+ + A note on string catenation. Operands of `&' are converted to strings + whenever required and possible. Arrays and tables are converted to + strings by catenating their elements (for tables, their keys) separated + by a single spaces. For example, the expression +
+ "a" & " " & ["b", "c"] ++
evaluates to the string "a b c". + +
+ + A statement is either an assignment, a procedure definition, a procedure + invocation, a conditional statement, or a loop. + +
+ Assign an expression (the string "bar") to the variable `foo' with +
+ foo = "bar" ++
+ + If `foo' already exists, and is an array, then +
+ foo += "baz" ++
extends the array to include a new final element; the string "baz". + + +
+ + Quake has a global name space, but local scopes are always introduced + when a procedure is called, and a `foreach' loop is executed. +
+ + Scopes are searched from innermost to outermost each time a name is + looked up. The outermost scope is always the global scope. +
+ + Assignments can be made local to the innermost scope by prefixing the + assignment statement with the keyword `local'. For example, +
+ local foo = "bog" ++
In which case the values of any other instances of `foo' in other scopes + are hidden. The previous value of `foo' is restored once the local scope + is released by exiting the procedure or `foreach' loop. +
+ + To protect a name in the current scope, use +
+ readonly dec = "digital" ++ +
+ + Procedures may be defined in the global scope only. Here is the + definition of a procedure `simple', taking two arguments bound to the + local names `prefix' and `suffix' in the procedure's local scope. +
+ proc simple(prefix, suffix) is + q = prefix & "." & suffix + end ++
+ The string `prefix & "." & suffix' is assigned to the global variable + `q'. +
+ + This procedure can then be invoked with +
+ simple("Hello", "m3")
+
+ + + Procedures can return values, in which case they become functions. For + example, +
+ proc combine(prefix, suffix) is + return prefix & "." & suffix + end ++
defines a function `combine' which catenates and returns the three + strings `prefix', ".", and `suffix'. Now the function `combine' can be + used in an expression, for example +
+ q = combine("Hello", "m3")
+
+ assigns the string "Hello.m3" to `q'. + +
+ + Values may be tested using the `if' statement. For example, +
+ if compiling + message = "compiling" + end ++
+ + If statements may have an else part, for example +
+ if not (ready or interested) + return + else + message = "congratulations" + end ++
returns from the current procedure if the test succeeds, otherwise + executes the assignment statement. + +
+ + `Foreach' statements iterate over the string values in an array or in a + table. For example, +
+ foreach file in [".login", ".profile", ".Xdefaults"]
+ write("Copying " & file & " to " & backup_dir & "0)
+ copy_file(file, backup_dir)
+ end
+
+ binds the name `file' to each of ".login", ".profile", and ".Xdefaults" + in turn in a local scope. This example assumes that the procedures + `copy_file', and the variable `backup_dir' have already been defined. +
+ + Here is a function `squeeze' to remove duplicates from an array +
+ proc squeeze(array) is
+ local t = {}
+
+ foreach i in array
+ t{i} = ""
+ end
+
+ return [t]
+ end
+
+ + +
+ + Here is a list of reserved words in quake: +
+ and contains else end foreach if in + is local not or proc readonly return ++ +
+ + Quake has a small collection of built-in procedures. Built-ins cannot + be redefined. The built-ins `write' and `exec' are variadic. + +
+ + Thus, `arglist("-F", really_huge_array)' + returns either the original array if it's not really all that huge, + or it creates a temporary file containing a list of the strings in + the array (one to a line) and returns the string "-Ftemp" where + `temp' is the name of the temporary file. + +
+ Output (from the `write' built-in procedure) may be temporarily + redirected as follows: +
+ > "foo.txt" in
+ write("Hello, world0)
+ end
+
+ The output of the calls to `write' is written to the file `foo.txt'. + +
+ Output may be appended to a file by using `>>' in place of `>'. + +
+ The special file names `_stdout' and `_stderr' are special and are bound + to the file descriptors corresponding to normal and error terminal + output respectively. + +
+ The default for output is the normal terminal stream. + +
+ + Quake does not garbage collect. Reckless copying of large arrays can + bloat the heap. + +
+ + + Stephen Harrison + (sharrison@broadvision.com). +
+ + + + + Index: m3/pm3/language/modula3/m3compiler/m3bootstrap/src/m3makefile diff -c m3/pm3/language/modula3/m3compiler/m3bootstrap/src/m3makefile:1.5 m3/pm3/language/modula3/m3compiler/m3bootstrap/src/m3makefile:1.6 *** m3/pm3/language/modula3/m3compiler/m3bootstrap/src/m3makefile:1.5 Tue Jan 27 15:25:35 1998 --- m3/pm3/language/modula3/m3compiler/m3bootstrap/src/m3makefile Tue Feb 10 22:56:19 1998 *************** *** 55,60 **** --- 55,66 ---- % Write the global bootstrap makefile readonly proc CreateMakefile(file,target,header,options) is + local exportrpath = "-DEXPORTRPATH=binaries/" & target + + if equal(target,"NT386GNU") + exportrpath = "-DEXPORTRPATH=binaries\\\\" & target + end + > file in write(header,CR,CR) *************** *** 69,75 **** write("exportpackages:", CR) write("\tboot-" & target & "/" & "m3build" & "/" & target & "/" & "m3build -T ../m3config/src -DRECURSIVE -DBOOTSTRAP=TRUE " & ! "-DEXPORTRPATH=binaries/" & target , CR, CR) write("boot:", CR) WriteMakefileLine("m3core",target,options) --- 75,81 ---- write("exportpackages:", CR) write("\tboot-" & target & "/" & "m3build" & "/" & target & "/" & "m3build -T ../m3config/src -DRECURSIVE -DBOOTSTRAP=TRUE " & ! exportrpath, CR, CR) write("boot:", CR) WriteMakefileLine("m3core",target,options) *************** *** 224,231 **** else write("option(\"optimization\",\"T\")",CR) end ! write("option(\"debuginfo\",\"\")",CR) write("HOST=\"" & host & "\"",CR) write("setDefault(\"\",\"\")",CR) write("BACKEND=[\"" & path() & SL & ".." & SL & host & SL & "pm3-" & target & SL & "m3cgc1-" & target & --- 230,238 ---- else write("option(\"optimization\",\"T\")",CR) end ! write("option(\"debuginfo\",\"" & BOOTDEBUG & "\")",CR) write("HOST=\"" & host & "\"",CR) + write("USE_M3DOC=\"\"",CR) write("setDefault(\"\",\"\")",CR) write("BACKEND=[\"" & path() & SL & ".." & SL & host & SL & "pm3-" & target & SL & "m3cgc1-" & target & *************** *** 240,245 **** --- 247,253 ---- % Build all the packages required for m3build and m3ship % to obtain a bootstrap m3build and m3ship. + BootstrapPkg("../../../../../text/sgmltools","m3doc",target,host) BootstrapPkg("../../../../../libs","m3core",target,host) BootstrapPkg("../../../../../libs","libm3",target,host) BootstrapPkg("../..","m3middle",target,host) *************** *** 251,256 **** --- 259,265 ---- BootstrapPkg("../../../../..","m3config",target,host) BootstrapPkg("../..","m3build",target,host) BootstrapPkg("../..","m3ship",target,host) + CleanPkg("m3doc",target) CleanPkg("m3core",target) CleanPkg("libm3",target) CleanPkg("m3middle",target) *************** *** 272,278 **** if equal(target,"NT386GNU") header = header & ! "EXTRALIBS=-lkernel32 -luser32 -lgdi32 -ladvapi32 -lnetapi32 -lm" & CR else header = header & "EXTRALIBS=-lm" & CR end --- 281,287 ---- if equal(target,"NT386GNU") header = header & ! "EXTRALIBS=-ladvapi32" & CR else header = header & "EXTRALIBS=-lm" & CR end *************** *** 299,304 **** --- 308,314 ---- % CACHE_CROSS_COMPILERS = lookup("CACHE_CROSS_COMPILERS","") + BOOTDEBUG = lookup("BOOTDEBUG","") if defined("BOOTTARGET") BootstrapTarget(BOOTTARGET) Index: m3/pm3/language/modula3/m3compiler/m3build/src/index.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3build/src/index.html:1.2 *** /dev/null Tue Feb 10 23:29:20 1998 --- m3/pm3/language/modula3/m3compiler/m3build/src/index.html Tue Feb 10 22:56:26 1998 *************** *** 0 **** --- 1,51 ---- + +
++ The Modula-3 compiler, m3build, contains a + quake + interpreter to process platform dependent templates and package + descriptions, m3makefile. It performs a much finer grained + dependency analysis than make, thus reducing + needless recompilation. + +
+ When SRC Modula-3 is configured and installed, several public + repositories are identified. In these web pages we refer to them with + the following short names: + +
+ Last modified on Thu Mar 7 18:08:53 PST 1996 by heydon + modified on Fri Jul 22 07:57:04 PDT 1994 by kalsow + modified on Wed May 19 11:36:32 PDT 1993 by mjordan + modified on Tue Oct 13 16:39:21 PDT 1992 by muller + modified on Tue Sep 22 08:36:57 PDT 1992 by mhb ++ + + Index: m3/pm3/language/modula3/m3compiler/m3build/src/m3makefile diff -c m3/pm3/language/modula3/m3compiler/m3build/src/m3makefile:1.6 m3/pm3/language/modula3/m3compiler/m3build/src/m3makefile:1.7 *** m3/pm3/language/modula3/m3compiler/m3build/src/m3makefile:1.6 Wed Dec 17 15:53:29 1997 --- m3/pm3/language/modula3/m3compiler/m3build/src/m3makefile Tue Feb 10 22:56:26 1998 *************** *** 8,17 **** --- 8,21 ---- import ("m3quake") import ("m3templates") import ("m3config") + import("m3doc") implementation ("Main") option("standalone","T") + + include_dir("html") + HtmlFile("index") Program ("m3build") Index: m3/pm3/language/modula3/m3compiler/m3build/src/html/build-generics.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3build/src/html/build-generics.html:1.2 *** /dev/null Tue Feb 10 23:29:20 1998 --- m3/pm3/language/modula3/m3compiler/m3build/src/html/build-generics.html Tue Feb 10 22:56:30 1998 *************** *** 0 **** --- 1,138 ---- + + +
+ + These procedures generate derived interfaces and modules for + instantiating generic interfaces and modules, respectively. +
+
+ build_generic_intf (nm, generic, args, vis)
+ Generate a derived interface named (in the file "nm.i3") that
+ instantiates the generic interface named "generic" with the
+ argument interfaces named in the list "args". The "vis" parameter
+ controls the visibility of the derived interface, and should
+ be one of the readonly constants VISIBLE or
+ HIDDEN.
+
+
+ build_generic_unsafe_intf (nm, generic, args, vis)
+ Like build_generic_intf, but the generated file
+ instantiates an UNSAFE INTERFACE.
+
+ + build_generic_impl (nm, generic, args) + Generate a derived module name "nm" (in the file "nm.m3") that + instantiates the generic module named "generic" with the + argument interfaces named in the list "args". +
+
+ build_generic_unsafe_impl (nm, generic, args)
+ Like build_generic_impl, but the generated file
+ instantiates an UNSAFE MODULE.
+
+ +
The above quake procedures are most commonly used in quake templates + associated with packages that export generic interfaces and + implementations. For example, consider the template file "list.tmpl", + which provides procedures for instantiating the generic "List" and + "ListSort" interfaces and modules. First, the procedures for + instantiating "List": + +
+ readonly proc _list (nm, elt, vis) is + local list = nm & "List" + build_generic_intf (list, "List", [elt], vis) + build_generic_impl (list, "List", [elt]) + end + + readonly proc List (nm, elt) is _list (nm, elt, VISIBLE) end + readonly proc list (nm, elt) is _list (nm, elt, HIDDEN) end ++ +
The last two procedures are meant to be used by clients. They come + in two forms: "List" instantiates a visible interface, and "list" + instantiates a hidden one. These two procedures take the name to be + used for the prefix of the instantiated files and the name of the + actual interface to use in the instantiation. Often, "nm" and "elt" + will be the same, but this design allows "nm" to be an abbreviated + form of the full interface name. For example, the standard lists are + instantiated by the following calls: + +
+ List ("Atom", "Atom")
+ List ("Int", "Integer")
+ List ("Ref", "Refany")
+ List ("Text", "Text")
+
+
+ After these calls, a client can IMPORT the interfaces
+ named AtomList, IntList,
+ RefList, and TextList. The m3makefile will
+ automatically generate the files named "AtomList.i3", "AtomList.m3",
+ "IntList.i3", IntList.m3", etc. in the derived directory. For example,
+ the contents of the file "IntList.i3" will be:
+
+
+ (* generated by m3build *) + INTERFACE IntList = List (Integer) END IntList. ++ +
The "list.tmpl" template also defines procedures for instantiating + the generic "ListSort" interface: + +
+ readonly proc _list_sort (nm, elt, vis) is + local list = nm & "List" + local listsort = nm & "ListSort" + build_generic_intf (listsort, "ListSort", [elt, list], vis) + build_generic_impl (listsort, "ListSort", [elt]) + end + + readonly proc List_sort (nm, elt) is _list_sort (nm, elt, VISIBLE) end + readonly proc list_sort (nm, elt) is _list_sort (nm, elt, HIDDEN) end ++ +
These procedures are similar to the ones above except that the
+ generic "ListSort" interface takes two parameters: the first is
+ the interface that defines the type T used as the list's
+ element type, and the second is the name of the List type
+ ranging over that type.
+
+
There are analogous calls in the list package's m3makefile for + instantiating standard instances of this type: + +
+ List_sort ("Atom", "Atom")
+ List_sort ("Int", "Integer")
+ List_sort ("Ref", "Refany")
+ List_sort ("Text", "Text")
+
+
+ This produces files named "AtomListSort.i3", "AtomListSort.m3", + "IntListSort.i3", "IntListSort.m3", etc. in the derived directory. + Here is the contents of the generated file "IntListSort.i3": + +
+ (* generated by m3build *) + INTERFACE IntListSort = ListSort (Integer, IntList) END IntListSort. ++ +
Several packages define new quake procedure for instantiating + generics, such as generic lists, queues, + sequences, and tables. To see how these are coded, look at the + ".tmpl" template files in the "src" directory of the relevant packages. +
+ +
+ Last modified on Mon Feb 12 17:08:02 PST 1996 by heydon ++ + + Index: m3/pm3/language/modula3/m3compiler/m3build/src/html/compiler.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3build/src/html/compiler.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:20 1998 --- m3/pm3/language/modula3/m3compiler/m3build/src/html/compiler.html Sat Jan 31 14:47:11 1998 *************** *** 0 **** --- 1,152 ---- + + +
+ + This section contains a brief introduction to the internal structure + of the compiler. This introduction is neither + comprehensive nor tutorial; it is merely intended as a stepping stone + for the courageous. +
+ + The compiler has undergone much evolution. It started as a project to + build a simple and easy to maintain compiler. Somewhere along the way + we decided to compile Modula-3. Much later we decided to generate C. + Now it generates native code directly. +
+ + The initial observation was that most compilers' data structures were + visible and complex. This situation makes it necessary to understand + a compiler in its entirety before attempting non-trivial enhancements + or bug fixes. By keeping most of the compiler's primary data + structures hidden behind opaque interfaces, we hoped to avoid this + pitfall. So far, bugs have been easy to find. During early + development, it was relatively easy to track the weekly language + changes. +
+ + The compiler is decomposed by language feature rather than the more + traditional compiler passes. We attempted to confine each language + feature to a single module. For example, the parsing, name binding, + type checking and code production for each statement is in its own + module. This separation means that only the CaseStmt module + needs to know what data structures exist to implement + CASE statements. + Other parts of the compiler need only know that the CASE + statement is a statement. This fact is captured by the object subtype + hierarchy. A CaseStmt.T is a subtype of a Stmt.T. +
+ + The main object types within the compiler are: values, statements, + expressions, and types. ``Values'' is a misnomer; ``bindings'' would + be better. This object class include anything that can be named: + modules, procedures, variables, exceptions, constants, types, + enumeration elements, record fields, methods, and procedure formals. + Statements include all of the Modula-3 statements. Expressions include + all the Modula-3 expression forms that have a special syntax. And + finally, types include the Modula-3 types. +
+ + The compiler retains the traditional separation + of input streams, scanner, symbol table, and output stream. +
+ + The compilation process retains the usual phases. Symbols are scanned + as needed by the parser. A recursive descent parser reads the entire + source and builds the internal syntax tree. All remaining passes + simply add decorations to this tree. The next phase binds all + identifiers to values in scopes. + Modula-3 allows arbitrary forward references so it is necessary + to accumulate all names within a scope before binding any identifiers + to values. The next phase divides the types into structurally + equivalent classes. This phase actually occurs in two steps. First, + the types are divided into classes such that each class will have a + unique C representation. Then, those classes are refined into what + Modula-3 defines as structurally equivalent types. After the types + have been partitioned, the entire tree is checked for type errors. + Finally, the IL is emitted. +
+ + The intermediate language is defined as a sequence of calls on an + M3CG.T object. In the compiler front end there is a thin + veneer interface, CG, that makes the actual calls. The veneer + converts between the bit-level addressing used in the front end + and the byte-level addressing used by the back ends. There are + several implementations of M3CG.T. The one that we + currently use is M3CG_Wr. It converts the stream of + calls into a parseable stream of ASCII characters. +
+ + The current back end is constructed as gcc front end. + It reads the M3CG output of the front end and produces + the tree structures needed by gcc's back end. +
+ + The front end is in the compiler package. + Within that package the following directories exist: +
+ builtinOps ABS, ADR, BITSIZE, ... + builtinTypes INTEGER, CHAR, REFANY, ... + builtinWord Word.And, Word.Or, ... + exprs +, -, [], ^, AND, OR, ... + main main program + misc scanner, symbol tables, ... + stmts :=, IF, TRY, WHILE, ... + types ARRAY, BITS FOR, RECORD, ... + values MODULE, PROCEDURE, VAR, ... ++
+ + The intermediate language is in the m3cg package. +
+ + The back end is in the m3cc package. The single file that + implements the M3CG reader is gcc/m3.c. +
+ +
+ SRC Modula-3 uses a special two-phase linker. + The first phase of the linker checks that all version stamps are + consistent. It then generates in m3main + declarations for the runtime type structures, + and initialization code for the collection of objects to be linked. + The second phases calls the host + system's linker to actually link the program. +
+ The information needed by the first phase is generated by the compiler + in a file ending in .m3x. + For every symbol X.Z exported or imported by a module, the + compiler generates a version stamp. + These stamps are used to ensure that + all modules linked into a single program agree on the type of X.Z. + The linker will refuse to link programs with inconsistent + version stamps. + +
+ SRC Modula-3 uses files with the following customizable suffixes: + +
+ + The following functions support building and installing + GNU emacs lisp code. +
+ + Gnuemacs(X) + exports source file X.el to /emacs. +
+ + CompiledGnuemacs(X) + exports the source file X.el and compiles and + exports the derived file X.elc to /emacs. +
+ +
+ Last modified on Thu Jan 4 11:07:55 PST 1996 by heydon + modified on Thu Jul 21 17:06:07 PDT 1994 by kalsow + modified on Thu Jan 7 18:40:57 PST 1993 by muller ++ + + + Index: m3/pm3/language/modula3/m3compiler/m3build/src/html/errors.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3build/src/html/errors.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:20 1998 --- m3/pm3/language/modula3/m3compiler/m3build/src/html/errors.html Sat Jan 31 14:47:11 1998 *************** *** 0 **** --- 1,25 ---- + + +
+ Errors encountered while processing the templates and m3makefiles + are immediately reported and stop m3build. + When processing the source files, (compiling to intermediate language, + translating to assembly, producing object code), if errors are encountered + they are reported and subsequent compilation phases for the offending file are + suppressed. The processing continues with the other files, + but the final link step is skipped. +
+ The compiler's error recovery is limited; it is often the case that errors + following the first one are bogus or redundant. + Error messages ending with a question mark are internal errors, and + probably represent compiler bugs. +
+ + + + Index: m3/pm3/language/modula3/m3compiler/m3build/src/html/example.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3build/src/html/example.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:20 1998 --- m3/pm3/language/modula3/m3compiler/m3build/src/html/example.html Sat Jan 31 14:47:11 1998 *************** *** 0 **** --- 1,87 ---- + +
++ + Here's a simple program composed of a main module, + an imported interface and its implementation. +
+ + To begin, create a fresh directory for the package and within that + directory, a directory for the source files: +
+ > mkdir hello + > cd hello + > mkdir src ++
+ + Create the following source files in the src directory: +
+ + In the file src/Main.m3: +
+ MODULE Main; + IMPORT A; + BEGIN + A.DoIt (); + END Main. ++
+ + In the file src/A.i3: +
+ INTERFACE A; + PROCEDURE DoIt (); + END A. ++
+ + In the file src/A.m3: +
+ MODULE A; + IMPORT Wr, Stdio; + + PROCEDURE DoIt () = + <*FATAL ANY*> + BEGIN + Wr.PutText (Stdio.stdout, "Hello world.\n"); + Wr.Close (Stdio.stdout); + END DoIt; + + BEGIN + END A. ++
+ + In the file src/m3makefile: +
+ import ("libm3")
+ implementation ("Main")
+ module ("A")
+ program ("foo")
+
+ + + Finally, from the package directory, hello, run + m3build. + If the compiler is installed correctly, + it will compile the three source files and link them with the + standard libraries. The derived files will be placed in a directory + that names the architecture. On a 80x86 Linux machine, + the directory is called LINUXELF. The executable program + will be named foo in the derived directory. + +
+ Last modified on Thu Jan 4 11:08:07 PST 1996 by heydon + modified on Tue Jan 3 07:38:22 PST 1995 by kalsow + modified on Thu Jan 7 18:40:57 PST 1993 by muller ++ + + + Index: m3/pm3/language/modula3/m3compiler/m3build/src/html/exports.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3build/src/html/exports.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:20 1998 --- m3/pm3/language/modula3/m3compiler/m3build/src/html/exports.html Sat Jan 31 14:47:11 1998 *************** *** 0 **** --- 1,72 ---- + + +
+ + These functions should be used to export files to the + public directories. +
+ + BinExport(X) + exports source file X to /bin. +
+ + BindExport(X) + exports derived file X to /bin. +
+ + DocExport(X) + exports source file X to /doc. +
+ + DocdExport(X) + exports derived file X to /doc. +
+ + EmacsExport(X) + exports source file X to /emacs. +
+ + EmacsdExport(X) + exports derived file X to /emacs. +
+ + HtmlExport(X) + exports source file X to /html. +
+ + LibExport(X) + exports source file X to /lib. +
+ + LibdExport(X) + exports derived file X to /lib. +
+ + ManExport(X,sec) + exports source file X.sec to section sec + of /man. +
+ + MandExport(X,sec) + exports derived file X.sec to section sec + of /man. +
+ + As mentioned earlier, + the actual paths bound to /bin, /lib, ... + depend on your installation's specific configuration. + +
+ Last modified on Thu Jan 4 11:07:54 PST 1996 by heydon + modified on Thu Jul 21 15:53:06 PDT 1994 by kalsow + modified on Thu Jan 7 18:40:57 PST 1993 by muller ++ + + + Index: m3/pm3/language/modula3/m3compiler/m3build/src/html/foreign.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3build/src/html/foreign.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:20 1998 --- m3/pm3/language/modula3/m3compiler/m3build/src/html/foreign.html Sat Jan 31 14:47:11 1998 *************** *** 0 **** --- 1,32 ---- + + +
+ + These procedures allow foreign objects and/or libraries to be included + in a Modula-3 program. +
+ + import_lib(X, P) + If P/libX.a is a library, includes -LP -lX + in the final link command. Otherwise, includes -lX + in the final link command. +
+ + import_obj(X) + Include X in the final link command. +
+ +
+ Last modified on Thu Jan 4 11:07:54 PST 1996 by heydon + modified on Mon Jun 20 14:51:17 PDT 1994 by kalsow + modified on Thu Jan 7 18:40:57 PST 1993 by muller ++ + + + Index: m3/pm3/language/modula3/m3compiler/m3build/src/html/generics.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3build/src/html/generics.html:1.2 *** /dev/null Tue Feb 10 23:29:20 1998 --- m3/pm3/language/modula3/m3compiler/m3build/src/html/generics.html Tue Feb 10 22:56:30 1998 *************** *** 0 **** --- 1,157 ---- + + +
+ + SRC Modula-3 includes both quake functions + you can use in your m3makefile for instantiating generics, and + basic type interfaces you can supply as + arguments to those functions. + +
Many of the packages that export generic interfaces and modules + also define m3build procedures that will instantiate + the generic source and add it to the list of Modula-3 sources + to be compiled. The instantiated interfaces and modules are created in + the build directory, so they won't clutter up your source directory. +
+ + array_sort(nm, elt) + instantiates the ArraySort generics to produce + nmArraySort.i3 and nmArraySort.m3 which implement + a sort for arrays of elt.T values. +
+ + Array_sort(nm, elt) + like array_sort, but also makes the interface available + to importers outside the current package. +
+ + list(nm, elt) + instantiates the List generics to produce + nmList.i3 and nmList.m3 which implement + linked lists of elt.T values. +
+ + List(nm, elt) + like list, but also makes the interface available + to importers outside the current package. +
+ + list_sort(nm, elt) + instantiates the ListSort generics to produce + nmListSort.i3 and nmListSort.m3 which implement + a sorting procedure for lists of elt.T values. This + procedure assumes that list(nm,elt) has been called. +
+ + List_sort(nm, elt) + like list_sort, but also makes the interface available + to importers outside the current package. +
+ + pqueue(nm, elt) + instantiates the PQueue generics to produce + nmPQ.i3 and nmPQ.m3 which implement + a priority queue of elt.T values. +
+ + Pqueue(nm, elt) + like pqueue, but also makes the interface available + to importers outside the current package. +
+ + sequence(nm, elt) + instantiates the Sequence generics to produce + nmSeq.i3, nmSeqRep.i3 and + nmSeq.m3 which implement + a sequence of elt.T values. +
+ + Sequence(nm, elt) + like sequence, but also makes the interfaces available + to importers outside the current package. +
+ + sorted_table(nm, key, value) + instantiates the SortedTable generics to produce + nmSortedTbl.i3 and nmSortedTbl.m3 which implement + a sorted table mapping from type key.T to value.T. +
+ + Sorted_table(nm, key, value) + like sorted_table, but also makes the interface available + to importers outside the current package. +
+ + table(nm, key, value) + instantiates the Table generics to produce + nmTbl.i3 and nmTbl.m3 which implement + a table mapping from type key.T to value.T. +
+ + Table(nm, key, value) + like table, but also makes the interface available + to importers outside the current package. +
+ +
Many generic interfaces, such as
+ Table
+ and
+ Sequence,
+ require one or more of their argument interfaces to have a certain
+ form. For example, the expect the principle type of the argument
+ interface to be named "T", and they expect the interface
+ to define certain constants and procedures. The basic Modula-3 library
+ defines the following interfaces for basic types that can be used as
+ arguments to such generics (each interface's principle type is shown
+ in parentheses):
+
+
TEXT)
+ Atom.T)
+ REFANY)
+ CHAR)
+ BOOLEAN)
+ INTEGER)
+ REAL)
+ LONGREAL)
+ But you aren't limited to these interfaces in your generic + instantiations. You can also supply your own interface as an argument + to a generic instantiation, so long as it meets all of the generic's + requirements. + +
+ Last modified on Wed Aug 21 14:23:18 PDT 1996 by heydon + modified on Thu Jun 1 08:18:55 PDT 1995 by kalsow + modified on Thu Jan 7 18:40:57 PST 1993 by muller ++ + + + Index: m3/pm3/language/modula3/m3compiler/m3build/src/html/hiding.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3build/src/html/hiding.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:20 1998 --- m3/pm3/language/modula3/m3compiler/m3build/src/html/hiding.html Sat Jan 31 14:47:11 1998 *************** *** 0 **** --- 1,51 ---- + + +
+ + The folowing procedures can be used in two ways. First to provide a + clearer indication of visibility than is given by the capitalization + convention (which exists partly to support old style m3makefiles). + Second, to change the visibility of imported components. + Generally, it's much better to convince the owners of the exporting + package to give their sources the correct visibility rather than + overriding their initial decision. +
+ + hide_interface(X) + sets the visibility of interface X.i3 to hidden. + +
+ + export_interface(X) + sets the visibility of interface X.i3 to visible. + +
+ + There are also variants that hide or export programs and generics, + hide_program, + hide_generic_interface, + hide_generic_implementation, + export_program, + export_generic_interface, + and + export_generic_implementation. +
+ + Hidden program are not copied to the /bin + directory, exported ones are. +
+ +
+ Last modified on Thu Jan 4 11:07:54 PST 1996 by heydon + modified on Thu Apr 21 16:49:58 PDT 1994 by kalsow + modified on Thu Jan 7 18:40:57 PST 1993 by muller ++ + + + Index: m3/pm3/language/modula3/m3compiler/m3build/src/html/imports.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3build/src/html/imports.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:20 1998 --- m3/pm3/language/modula3/m3compiler/m3build/src/html/imports.html Sat Jan 31 14:47:11 1998 *************** *** 0 **** --- 1,49 ---- + + +
+ + import(P) + The library and visible sources of package P are + available to satisfy IMPORT requests in the current + compilation. The imported sources are not recompiled. + +
+ + import_version(P, BuildDir) + Like import(P), but the library and visible sources of + package P are selected from building directory BuildDir + rather than the default building directory for the current platform. + +
+ + include_dir(D) + Recursively include the sources named in the m3makefile + in subdirectory D of the current directory. + +
+ + include_pkg(P) + Include the sources named in package P's + src/m3makefile. The location of P may be + overridden. +
+ + Import reflects the fact that programs are built from separately + compiled pieces, rather than being compiled as a whole. If we always + compiled from source, include would suffice. +
+ +
+ Last modified on Thu Jan 4 11:07:54 PST 1996 by heydon + modified on Thu Apr 21 16:47:18 PDT 1994 by kalsow + modified on Thu Jan 7 18:40:57 PST 1993 by muller ++ + + + Index: m3/pm3/language/modula3/m3compiler/m3build/src/html/m3buildsteps.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3build/src/html/m3buildsteps.html:1.2 *** /dev/null Tue Feb 10 23:29:20 1998 --- m3/pm3/language/modula3/m3compiler/m3build/src/html/m3buildsteps.html Tue Feb 10 22:56:31 1998 *************** *** 0 **** --- 1,88 ---- + + +
+ When m3build is invoqued, it initializes the quake interpreter + with values for BUILD_DIR (defaults to the platform name unless + specified on the command line), PACKAGE (the name of the current + directory), and PACKAGE_DIR (the full path of the current directory). + The build_target is also defined as _build_target. + It defaults to all (_all), and clean is the other + typical value. +
+ The second step is to find and interpret the platform dependent template, + specified in BUILD_DIR. + The template directory may be specified on the command line, + in the M3TEMPLATES environment variable, and defaults to + m3config/src within the directory specified in PKG_USE + when m3build was compiled. As a last resort, directory + ../lib/m3/pkg/m3config/src is searched relative to the directory + where the m3build executable may be found. +
+ The next step is to insert all the definitions, + and to interpret all the files, specified as command + line options. +
+ At this point, a number of quake variables are extracted by the compiler + before the processing of the m3makefile starts. The host + and target in these descriptions refer to platform types and + differ only when cross compiling. + +
+ The m3makefile is then processed, and the list of sources built, + until the ending Library(), Program(), or + OtherPackage() quake function is encountered. + At this point, the before_do_m3_hook() quake function is + called to set things up before the compilation proceeds. + More quake variables are then extracted by m3build. + +
The compilation then proceeds and m3build calls back a number of + template defined quake procedures for various platform dependent tasks: + +
+ In all cases, m3build creates or updates the files + .M3EXPORTS (exported files), .M3IMPTAB (location of all imported files), + .M3SHIP (files to ship with m3ship), and .M3WEB (information for + the browser m3browser). With the all default + build_target, the actual compilation is performed. With the clean + build_target, the list of derived files (which would have been created + by the compilation) is used to clean the build directory. + + Index: m3/pm3/language/modula3/m3compiler/m3build/src/html/m3makefile diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3build/src/html/m3makefile:1.1.1.1 *** /dev/null Tue Feb 10 23:29:20 1998 --- m3/pm3/language/modula3/m3compiler/m3build/src/html/m3makefile Sat Jan 31 14:47:11 1998 *************** *** 0 **** --- 1,25 ---- + HtmlFile("build-generics") + HtmlFile("compiler") + HtmlFile("emacs") + HtmlFile("errors") + HtmlFile("example") + HtmlFile("exports") + HtmlFile("foreign") + HtmlFile("generics") + HtmlFile("hiding") + HtmlFile("imports") + HtmlFile("m3buildsteps") + HtmlFile("m3makefile") + HtmlFile("m3options") + HtmlFile("machine") + HtmlFile("manpage") + HtmlFile("misc") + HtmlFile("netobj") + HtmlFile("options") + HtmlFile("overrides") + HtmlFile("packages") + HtmlFile("profiling") + HtmlFile("progs") + HtmlFile("resources") + HtmlFile("sources") + HtmlFile("zeus") Index: m3/pm3/language/modula3/m3compiler/m3build/src/html/m3makefile.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3build/src/html/m3makefile.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:20 1998 --- m3/pm3/language/modula3/m3compiler/m3build/src/html/m3makefile.html Sat Jan 31 14:47:11 1998 *************** *** 0 **** --- 1,39 ---- + +
++ The procedures defined by m3build that are available in all + m3makefiles fit into + the following categories: +
+ + The more specialized procedures are: +
+ + option(name,value) + sets the option name to the specified value. + An empty string is the boolean FALSE value. A non empty + string, typically "T", represents the boolean TRUE value. +
+ + Important: For the specified compiler options to take effect, your + option lines must preceed any program or + library directives in the m3makefile. + +
The recognized options are: + +
Other options are available for compilation debugging and performance + analysis, or for internal use. These options are not for the + casual user. + +
+ + m3build contains some built-in support for machine and + operating system dependencies. The package structure makes provision + for separate build directories for different machine and operating + system combinations. The default behaviour of m3build is to + generate the compiled object files, libaries and programs in the build + directory corresponding to the machine and operating system on which + m3build is executing. +
+ + The following set of variables exist to allow m3makefiles to be + parameterised by machine and operating system. + +
+ + The net effect of the above allows a single package to build a family + of architectural variants, in different build sub-directories, where + each variant uses the same set of m3makefiles, parameterized by + the above variables. If this degree of flexibility is insufficient, + then the extra variation must be specified in a separate package, + which can use include_pkg to access the shared sources. + + + + Index: m3/pm3/language/modula3/m3compiler/m3build/src/html/manpage.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3build/src/html/manpage.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:21 1998 --- m3/pm3/language/modula3/m3compiler/m3build/src/html/manpage.html Sat Jan 31 14:47:11 1998 *************** *** 0 **** --- 1,40 ---- + +
++ + The following calls format and install man pages. +
+ + manPage(name,sec) + formats man page name.sec. +
+ + ManPage(name,sec) + is like manPage, but also exports the man page to section + sec of /man. +
+ + ManExport(X,s) + exports source file X.s to section s of /man + without further formatting. +
+ + MandExport(X,s) + export derived file X.s to section s of /man + without further formatting. +
+ +
+ Last modified on Thu Jan 4 11:07:52 PST 1996 by heydon + modified on Thu Jul 21 16:28:04 PDT 1994 by kalsow + modified on Thu Jan 7 18:40:57 PST 1993 by muller ++ + + + Index: m3/pm3/language/modula3/m3compiler/m3build/src/html/misc.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3build/src/html/misc.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:21 1998 --- m3/pm3/language/modula3/m3compiler/m3build/src/html/misc.html Sat Jan 31 14:47:11 1998 *************** *** 0 **** --- 1,48 ---- + + +
+ + The declarations in this section are typically only needed by + specialised applications, for example the Modula-3 compiler or + other quake templates. +
+ + source(X) + declares that X contains non-compilable source. +
+ + derived_interface(X,V) + adds the derived interface X.i3 to the list of + files to be compiled. V must be either VISIBLE + or HIDDEN to indicate whether the interface should be + available to importers outside this package. +
+ + derived_implementation(X) + adds the derived module X.m3 to the list of + files to be compiled. +
+ + derived_c(X) + adds the derived C code X.c to the list of + files to be compiled. +
+ + derived_h(X) + adds the derived include file X.h to the list of + include files available to the compiler. +
+ +
+ Last modified on Mon Feb 12 11:35:36 PST 1996 by heydon + modified on Thu Jul 21 16:57:42 PDT 1994 by kalsow + modified on Thu Jan 7 18:40:57 PST 1993 by muller ++ + + Index: m3/pm3/language/modula3/m3compiler/m3build/src/html/netobj.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3build/src/html/netobj.html:1.2 *** /dev/null Tue Feb 10 23:29:21 1998 --- m3/pm3/language/modula3/m3compiler/m3build/src/html/netobj.html Tue Feb 10 22:56:31 1998 *************** *** 0 **** --- 1,33 ---- + + +
+ + The following procedures are used to build programs using + network objects. +
+ + netobj(X,T) + runs the network objects stub generator on the interface X.i3 + to produce the network object glue needed to manipulate objects + of type X.T. The resulting source files are included + in the current build. +
+ + Netobj(X,T) + Like netobj, but also exports the resulting interface. +
+ +
+ Last modified on Thu Jan 4 11:07:52 PST 1996 by heydon + modified on Thu Jul 21 16:51:11 PDT 1994 by kalsow + modified on Thu Jan 7 18:40:57 PST 1993 by muller ++ + + + Index: m3/pm3/language/modula3/m3compiler/m3build/src/html/options.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3build/src/html/options.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:21 1998 --- m3/pm3/language/modula3/m3compiler/m3build/src/html/options.html Sat Jan 31 14:47:11 1998 *************** *** 0 **** --- 1,53 ---- + + +
+ The syntax for invoking m3build, within a package directory, is +
+ m3build [options] [target ...] ++
+ If no target is specified, all is assumed. It causes the + specified program or library to be built. The only other + target that is supported in all + m3makefiles is clean + which removes any derived files created by m3build all. +
+ + The following options are interpreted by m3build. + +
+ + override(P, D) + Use the version of package P in directory D/P + instead of the one in /pkg/P. While D must + be an absolute path, a relative path RD may be used with + the path_of function as override(P, path_of(RD)). + +
+ + override alters the behaviour of the include_pkg and + import procedures, and must be executed prior to any such calls + to have an effect. +
+ + To help ensure that the public repositories are consistent, + m3ship will refuse to install any package built using overrides. +
+ + When the -O option is specified, m3build looks for a file + named m3overrides in the src directory and, if one + exists, executes it immediately prior to executing m3makefile. + By keeping all override calls in an m3overrides file + and not in an m3makefile, you can build both private and public + versions of packages without editting any files. +
+ + The overrides in effect when a package was built are automatically + carried forward into importers of the package, so there is no need to + restate the complete set of overrides at every level, only of those + packages that are directly imported into a given package. +
+ + + + + Index: m3/pm3/language/modula3/m3compiler/m3build/src/html/packages.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3build/src/html/packages.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:21 1998 --- m3/pm3/language/modula3/m3compiler/m3build/src/html/packages.html Sat Jan 31 14:47:11 1998 *************** *** 0 **** --- 1,71 ---- + +
++ PM3 is distributed as a set of packages. Each package + is contained in a single directory, named after the package, + which conforms to a standard structure. + The top level directory should contain + a src subdirectory containing Modula-3 source + files. The compiler, m3build, + also creates a derived platform directory for each platform on + which the package + is built. Besides the src and platforms subdirectories, + a package may contain other packages to form a package hierarchy. + These other packages are often tutorials or tests related to the + containing package. + +
+ There are three primary types of packages: program, library, and other. + An other package contains + a collection of sources, often documentation; it builds nothing. + A program package constructs a single executable program by compiling + and linking the contents of a set of source packages. + Similarly, a library package constructs a + single library from a set of source packages. +
+ + The m3makefile, that describes the package, resides in the + src subdirectory of the package. Although it is common for all the + Modula-3 sources to also reside in the src directory, they may be + distributed in a more complex directory structure rooted at src. +
+ The m3makefile for a source package simply lists the pieces of + source that are to be included in programs or libraries that include the + source package. It ends with a single OtherPackage() invocation. +
+ The m3makefile for a program package names the sources + needed to build the program, and the packages that it uses to + satisfy its imports. It ends with a + single program() or Program() invocation. + See the example. +
+ The m3makefile for a library package names the sources to be + included in the library, and the packages that it uses to + satisfy its imports. It ends with a single + library() or Library() invocation. +
+ + Note that as in a program, all the imports of a package must be + satisfied. If a package A builds a library and any of the objects in + that library import interfaces from another library package B, then + import(B) must be specified in A's m3makefile. + +
+ A package, once compiled with m3build, may have its + exported (visible) files installed in a + package repository with m3ship. + By default, m3ship installs packages in the public + repository (e.g. /usr/local/lib/m3/pkg). + Note that on some systems, you must have special privileges to install + public packages. +
+ + + + Index: m3/pm3/language/modula3/m3compiler/m3build/src/html/profiling.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3build/src/html/profiling.html:1.2 *** /dev/null Tue Feb 10 23:29:21 1998 --- m3/pm3/language/modula3/m3compiler/m3build/src/html/profiling.html Tue Feb 10 22:56:31 1998 *************** *** 0 **** --- 1,87 ---- + +
+On most Unix systems, the programs prof(1), gprof(1), and + analyze_coverage(1) can be used to profile your Modula-3 program's + performance or to analyze which source lines of your program have been + executed. However, in order to use these tools, you must compile your + program with certain compiler options. + +
To profile your program for use with prof(1) or gprof(1), add + the following compiler option to your + m3makefile: + +
+ option("profiling","T")
+
+
+ This will cause your program to be compiled and linked for profiling. + If you have + already built your program without profiling, and you want to turn + profiling on, delete the object files and executable program + and rebuild. +
+ When you run your program, a file named "mon.out" (for prof(1)) or + "gmon.out" (for gprof(1)) will be created. To view the profile, run + the prof(1) or gprof(1) program using the command-line: + +
+ prof prog mon.out + gprof prog gmon.out ++ +
where prog is the filename of your program's binary. + +
To determine how many times each source line and procedure of your + Modula-3 program were exececuted on a particular run, you need to + compile it to be used with the analyze_coverage(1) tool. To do + this, add the following compiler option + to your m3makefile: + +
+ option("coverage","T")
+
+
+ Coverage data will be available only for those modules that have been + compiled with this option, so if you want coverage analysis for all + your sources and you have just turned this option on, you will need to + delete your derived directory and recompile everything. To produce the + coverage data, you must also link your program with this option. + +
Once you've compiled your program for coverage analysis, just run it. + By default, this will produce a file named "coverage.out" in the + current directory (you can set the environment variable + COVERAGE_DATABASE to the name of a different file if you + prefer). This file is the coverage database. The coverage information + is accumulated in this file from run to run, so if you want to + see what your program does on a single run, you should delete the + coverage database file before running your program. For the same + reason, the profiling data file is rather large; furthermore, as it is + augmented by each execution of the program, you may want to compress + it from time to time (see analyze_coverage(1) for more + details). +
+ Once you've run your program, you can use the analyze_coverage(1) tool + to show you what's in the coverage database. For this tool to work, + you must point it to the directories containing your source files. You + can do this by setting the COVERAGE_PATH environment + variable, or by supplying the "-S" option to analyze_coverage(1). + Again, see the analyze_coverage(1) man page for details. +
+ Note that because of the extensive data collection performed by this mode of + profiling, the execution time of the program can be significantly larger when + it is enabled; thus, simultaneous time profiling can produce erroneous + results. + + + + Index: m3/pm3/language/modula3/m3compiler/m3build/src/html/progs.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3build/src/html/progs.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:21 1998 --- m3/pm3/language/modula3/m3compiler/m3build/src/html/progs.html Sat Jan 31 14:47:11 1998 *************** *** 0 **** --- 1,36 ---- + +
++ +
+ + The following procedures support the inclusion of arbitrary data, + known as a resource, in a program. +
+ + resource(file) + is shorthand for resource_named(file,file). +
+ + resource_named(rd,file) + declares that file is a resource file. It will be + accessible via the reader rd if a bundle is built. +
+ + bundle(m) + declares that the module m is to be built as a bundle + of the files specified by the prior calls to resource and + resource_named. +
+ + For a description of how to access resources from your running + program, see the + Bundle + and + Rsrc + interfaces. +
+ + + + Index: m3/pm3/language/modula3/m3compiler/m3build/src/html/sources.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3build/src/html/sources.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:21 1998 --- m3/pm3/language/modula3/m3compiler/m3build/src/html/sources.html Sat Jan 31 14:47:11 1998 *************** *** 0 **** --- 1,97 ---- + +
++ + The most primitive declarations in an m3makefile are those that + identify source files. They can be Modula-3, C or assembler files. A + source file has three attributes: a package, the subdirectory within + the package where the declaration occurs, and a visibility. The + visibility has two values, visible and hidden. + When a package A + imports a package B, only the visible sources in B are available to + compilations that occur in A. By default all sources are visible. + However, it is possible to explicitly control the visibility of + Modula-3 interfaces. +
+ + Source files are named relative to the m3makefile that mentions them. +
+ + The following calls define source files: +
+ + interface(X) declares that the file X.i3 contains an interface. +
+ + implementation(X) declares that the file X.m3 contains a module. +
+ + module(X) declares both the interface X.i3 and the module X.m3. +
+ + generic_interface(X) declares that the file X.ig contains + a generic interface. +
+ + generic_implementation(X) declares that the file X.mg + contains a generic module. +
+ + generic_module(X) declares both a generic interface and module. +
+ + h_source(X) declares that the file X.h contains a C include + file. +
+ + c_source(X) declares that the file X.c contains a C module. +
+ + s_source(X) declares that the file X.s contains an assembly + module. +
+ + pgm_source(X) declares that the file X contains compilable + source (e.g. .ic, .mc, .is or + .ms files). +
+ + With the exception of h_source, each of the procedures above + defines a hidden source file. + There are capitalized variants Interface, Module, + Generic_interface, Generic_implementation, and + Generic_module that identify their sources as visible. Remember, + only those interfaces that are marked as visible will be available to + importers of your library or package. +
+ + With the exception of generic_interface, + generic_implementation, and h_source, all other calls + add their argument to the set PGM_SOURCES. This set is + compiled by this invocation of m3build, either by the + Modula-3 compiler or the C compiler, as appropriate. +
+ + template(X) + declares that the file X.tmpl contains quake code + that is to be included in this build, and in all builds that import this + package. +
+ + The template call is used to extend the set of available + procedures. For example, the table package includes a template that + defines the table procedure which + instantiates the generic table module. See also the predefined + general-purpose procedures for instantiating + generics that you can use to define procedures in your own templates + for instantiating your own generic modules. +
+ + + + Index: m3/pm3/language/modula3/m3compiler/m3build/src/html/zeus.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3build/src/html/zeus.html:1.1.1.1 *** /dev/null Tue Feb 10 23:29:21 1998 --- m3/pm3/language/modula3/m3compiler/m3build/src/html/zeus.html Sat Jan 31 14:47:11 1998 *************** *** 0 **** --- 1,49 ---- + +
++ + The following procedures support building Zeus animations. +
+ + zume(X) + run the Zeus event processor m3zume on the source file X.evt + to produce Modula-3 sources and other resources needed to build an + animation. The resulting sources are included in any subsequent + compilation. +
+ + zume3D(X) + like zume but with the additional support for using + the 3D libraries. +
+ + oblume(X,O) + Like zume, runs the Zeus event processor on X.evt + and also bundles the source file O.obl which is assumed + to contain Obliq code. +
+ + oblume3D(X,O) + like oblume but with the additional support for using + the 3D libraries. +
+ + junozume(X,V) + Runs the Zeus event processor on X.evt to produce stubs + to connect to a Juno(1) animation server run with the -zeus + option. There can be at most one Juno view per Zeus animation. + V is the name of the view installed in the Zeus Views + menu. See the Juno(1) man page for a more complete + description of how to write a Juno animation view for + Zeus. See the README file in the junozeus package + for instructions on how to run an example view. +
+ + + + Index: m3/pm3/language/modula3/m3compiler/m3cc/src/m3makefile diff -c m3/pm3/language/modula3/m3compiler/m3cc/src/m3makefile:1.2 m3/pm3/language/modula3/m3compiler/m3cc/src/m3makefile:1.3 *** m3/pm3/language/modula3/m3compiler/m3cc/src/m3makefile:1.2 Fri Nov 21 13:14:42 1997 --- m3/pm3/language/modula3/m3compiler/m3cc/src/m3makefile Tue Feb 10 22:56:48 1998 *************** *** 50,77 **** % figure out where we're going to build the beast local build_dir = "." % let m3build set the build directory if not equal (M3CC_HOST, M3CC_TARGET) ! build_dir = "../" & BUILD_DIR & "-" & M3CC_TARGET ! end ! % make sure the derived directory exists ! if stale (build_dir, build_dir) ! ret = exec (["mkdir", build_dir]) end if not defined ("no_config") % configure the sources ! ret = exec (["../gcc/configure", M3CC_CONFIG, "--srcdir=../gcc", "--host=" & gnu_platform (M3CC_HOST), "--build=" & gnu_platform (M3CC_BUILD), ! "--target=" & gnu_platform (M3CC_TARGET)],[],build_dir) if not equal(ret,0) error("Failed to configure m3cc") end end % misc fixups & ship commands pgms = "m3cgc1" if equal (M3CC_HOST, M3CC_TARGET) ! LibdExport ("m3cgc1") if equal (M3CC_HOST, "DS3100") or equal (M3CC_HOST, "ALPHA_OSF") pgms = "m3cgc1 mips-tfile" LibdExport ("mips-tfile") --- 50,86 ---- % figure out where we're going to build the beast local build_dir = "." % let m3build set the build directory + if not equal (M3CC_HOST, M3CC_TARGET) ! build_dir = ".." & SL & BUILD_DIR & "-" & M3CC_TARGET ! if stale (build_dir, build_dir) ! ret = exec (["mkdir", build_dir]) ! end end if not defined ("no_config") % configure the sources ! local cmd = ["../gcc/configure", M3CC_CONFIG, "--srcdir=../gcc", "--host=" & gnu_platform (M3CC_HOST), "--build=" & gnu_platform (M3CC_BUILD), ! "--target=" & gnu_platform (M3CC_TARGET)] ! if equal(OS_TYPE,"WIN32") ! > tmpsh in ! write("#! /bin/sh",CR) ! write(cmd,CR) ! end ! ret = exec(["sh","tmpsh"],[],build_dir) ! else ! ret = exec(cmd,[],build_dir) ! end if not equal(ret,0) error("Failed to configure m3cc") end end % misc fixups & ship commands pgms = "m3cgc1" if equal (M3CC_HOST, M3CC_TARGET) ! LibdExport ("m3cgc1" & NAMING_CONVENTIONS[20]) if equal (M3CC_HOST, "DS3100") or equal (M3CC_HOST, "ALPHA_OSF") pgms = "m3cgc1 mips-tfile" LibdExport ("mips-tfile") Index: m3/pm3/language/modula3/m3compiler/m3export/src/dobinaries.sh diff -c m3/pm3/language/modula3/m3compiler/m3export/src/dobinaries.sh:1.1 m3/pm3/language/modula3/m3compiler/m3export/src/dobinaries.sh:1.2 *** m3/pm3/language/modula3/m3compiler/m3export/src/dobinaries.sh:1.1 Sat Jan 17 11:52:59 1998 --- m3/pm3/language/modula3/m3compiler/m3export/src/dobinaries.sh Tue Feb 10 22:56:55 1998 *************** *** 3,8 **** --- 3,9 ---- ARCH=`arch` OS=`uname -s` REV=`uname -r` + ZZP=`cat zzp` case ${ARCH}-${OS}-${REV} in i[3456789]86-Linux-*) *************** *** 72,80 **** open m3.polymtl.ca user ftp ${TARGET}@m3.polymtl.ca site group binaries ! site gpass `cat zzp` binary ! cd /pub/m3/binaries/${TARGET} put ${VERSION}.tgz put TODO DONE EOF --- 73,81 ---- open m3.polymtl.ca user ftp ${TARGET}@m3.polymtl.ca site group binaries ! site gpass ${ZZP} binary ! cd /tmp/pm3/binaries/${TARGET} put ${VERSION}.tgz put TODO DONE EOF *************** *** 83,91 **** open m3.polymtl.ca user ftp ${TARGET}@m3.polymtl.ca site group binaries ! site gpass `cat zzp` binary ! cd /pub/m3/binaries/${TARGET} put errs.tmp NOTDONE.errs put out.tmp NOTDONE.out EOF --- 84,92 ---- open m3.polymtl.ca user ftp ${TARGET}@m3.polymtl.ca site group binaries ! site gpass ${ZZP} binary ! cd /tmp/pm3/binaries/${TARGET} put errs.tmp NOTDONE.errs put out.tmp NOTDONE.out EOF Index: m3/pm3/language/modula3/m3compiler/m3export/src/m3makefile diff -c m3/pm3/language/modula3/m3compiler/m3export/src/m3makefile:1.4 m3/pm3/language/modula3/m3compiler/m3export/src/m3makefile:1.6 *** m3/pm3/language/modula3/m3compiler/m3export/src/m3makefile:1.4 Tue Jan 27 15:26:04 1998 --- m3/pm3/language/modula3/m3compiler/m3export/src/m3makefile Tue Feb 10 22:56:55 1998 *************** *** 204,209 **** --- 204,216 ---- CheckExec(["mv", EXPORT_TMP_BINARIES & "/" & TARGET & "/" & versionName, EXPORT_BINARIES & "/" & TARGET],[],"","export binaries failed") + + CheckExec(["rm", EXPORT_TMP_BOOTSTRAP & "/" & TARGET & "/" & "TODO"],[],"", + "remove TODO failed") + + local ret = Exec(["rm", EXPORT_ROOT & "/" & "pkgf" & "/" & "pm3"],[],"") + CheckExec(["ln","-s",EXPORT_SRC & "/" & versionName, + EXPORT_ROOT & "/" & "pkgf" & "/" & "pm3"],[],"","link in pkgf failed") end % *************** *** 336,344 **** write(versionName,CR) end end - - CheckExec(["rm", EXPORT_TMP_BOOTSTRAP & "/" & TARGET & "/" & "TODO"],[],"", - "remove TODO failed") RemovePreviousVersion() --- 343,348 ---- Index: m3/pm3/language/modula3/m3compiler/m3ship/src/index.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3ship/src/index.html:1.1.1.1 *** /dev/null Tue Feb 10 23:30:18 1998 --- m3/pm3/language/modula3/m3compiler/m3ship/src/index.html Sat Jan 31 14:47:12 1998 *************** *** 0 **** --- 1,57 ---- + +
++ + m3ship + will ship all the build directories (for different architectural + variants) that exist in the package. It will refuse to ship anything if + it finds a variant that was built with "overrides", unless the "-k" option + is given, in which case it will ship all the variants except those that + were built with overrides. +
+ + The syntax for invoking m3ship is +
+ m3ship [options] ++
+ + The following options are interpreted by m3ship. +
+ +
+ +
+ +
+ +
+ + + + Index: m3/pm3/language/modula3/m3compiler/m3ship/src/m3makefile diff -c m3/pm3/language/modula3/m3compiler/m3ship/src/m3makefile:1.4 m3/pm3/language/modula3/m3compiler/m3ship/src/m3makefile:1.5 *** m3/pm3/language/modula3/m3compiler/m3ship/src/m3makefile:1.4 Wed Dec 17 15:53:38 1997 --- m3/pm3/language/modula3/m3compiler/m3ship/src/m3makefile Tue Feb 10 22:57:02 1998 *************** *** 8,15 **** --- 8,18 ---- import ("m3quake") import ("m3templates") import ("m3config") + import("m3doc") implementation ("Main") + + HtmlFile("index") option("standalone","T") Index: m3/pm3/language/modula3/m3compiler/m3where/src/index.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/m3where/src/index.html:1.2 *** /dev/null Tue Feb 10 23:31:01 1998 --- m3/pm3/language/modula3/m3compiler/m3where/src/index.html Tue Feb 10 22:57:42 1998 *************** *** 0 **** --- 1,86 ---- + +
++ m3where + is a program that locates Modula-3 source files, relative to a + particular program or library package. By default it locates the given + units relative to the default build directory of the package that is + rooted at the current working directory. The -d option can be used + to specify the pathname of a particular package to be used to locate + the units. Sources that are hidden (not exported) by the + packages are not located unless option -h is set. + +
+ The syntax for invoking m3where is +
+ m3where [options] [units ...] ++ +
+ If no units are given, m3where enumerates all of the sources + associated with the package and those that it imports. Sources that are + hidden (not exported) are not shown unless option -h is set. + +
+ The units are specified as filenames of the form "Foo.xx", + where "xx" is one of the standard + Modula-3 file extensions (.i3, .m3, .ig, .mg...). + Wildcards are not supported. + +
+ Note that, in order for m3where to work, + m3build must have + been run at least once for the given package/build directory pair. + +
+ If the given units can be located, the full pathnames are output + to the standard output, otherwise an error message is output. + +
+ The following options are interpreted by m3where. + +
+ For example, +
+ m3where Pathname.i3 ++
would try to find the file Pathname.i3 from the + information in the build directory of the package rooted at the + current working directory. + +
And, +
+ m3where -b NT386GNU -d /proj/m3/pkg/libm3 PathnameWin32.m3 ++
would try to find the file PathnameWin32.m3 + using the information in the NT386GNU build directory of + the libm3 package. + + + + Index: m3/pm3/language/modula3/m3compiler/m3where/src/m3makefile diff -c m3/pm3/language/modula3/m3compiler/m3where/src/m3makefile:1.3 m3/pm3/language/modula3/m3compiler/m3where/src/m3makefile:1.4 *** m3/pm3/language/modula3/m3compiler/m3where/src/m3makefile:1.3 Fri Nov 28 09:23:59 1997 --- m3/pm3/language/modula3/m3compiler/m3where/src/m3makefile Tue Feb 10 22:57:42 1998 *************** *** 11,16 **** --- 11,19 ---- import ("m3config") implementation ("Main") + + HtmlFile("index") + Program ("m3where") Index: m3/pm3/language/modula3/m3compiler/src/gc.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/src/gc.html:1.2 *** /dev/null Tue Feb 10 23:31:01 1998 --- m3/pm3/language/modula3/m3compiler/src/gc.html Tue Feb 10 22:57:47 1998 *************** *** 0 **** --- 1,58 ---- + +
++ + A crucial fact for clients of the garbage collector to know is that + objects in the heap move. If all references to a traced heap object + are from other traced heap objects, the collector may move the + referent. Hence, it is a bad idea to hash pointer values. References + from the stack or untraced heap into the traced heap are never + modified. +
+ + The current collector is, by default, incremental and generational. + The interruptions of service should be very small, and the overall + performance should be better than with the previous collectors. +
+ + The use of VM protection is currently implemented only for the LINUXELF, + DS3100, SOLgnu, and SPARC architectures. On other architectures, + @M3novm is the default. +
+ + Note that the new optional background collection + thread is not on by default; this may change in the future. +
+ + When you debug a Modula-3 program with + m3gdb, + you will find it simplest to + run it with the @M3novm switch. +
+ + Because of the use of VM protection by the collector, + there are some additional constraints + on what programs may legally do. For example, you cannot pass an + address on the heap as an argument to sigvec(2). These restrictions + are documented in RTHeapDepC.c. + If they seem onerous, we might be able to eliminate some. + Note also that fork() and vfork() are now + relatively expensive operations, + since they cause the current collection to finish; + this situation may improve in a future release. +
+ +
+ Last modified on Thu Jan 4 11:08:06 PST 1996 by heydon + modified on Wed May 4 08:03:11 PDT 1994 by kalsow + modified on Thu Jan 7 18:40:57 PST 1993 by muller ++ + + + Index: m3/pm3/language/modula3/m3compiler/src/index.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/src/index.html:1.1.1.1 *** /dev/null Tue Feb 10 23:31:01 1998 --- m3/pm3/language/modula3/m3compiler/src/index.html Sat Jan 31 14:47:12 1998 *************** *** 0 **** --- 1,86 ---- + +
The DEC SRC compiler and supporting libraries. +
+ + Command line arguments given to Modula-3 programs are divided in two + groups. Runtime parameters are those that start with the characters + @M3. They are reserved for the Modula-3 runtime and are accessible + via the + + RTParams + interface. The others are + program arguments and are accessible via the + + Params + interface. +
+ + The following runtime parameters are recognized today; + others are simply ignored. +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ Last modified on Thu Jan 4 11:08:03 PST 1996 by heydon + modified on Thu Jun 1 08:16:06 PDT 1995 by kalsow + modified on Thu Jan 7 18:40:57 PST 1993 by muller ++ + + + Index: m3/pm3/language/modula3/m3compiler/src/m3makefile diff -c /dev/null m3/pm3/language/modula3/m3compiler/src/m3makefile:1.2 *** /dev/null Tue Feb 10 23:31:01 1998 --- m3/pm3/language/modula3/m3compiler/src/m3makefile Tue Feb 10 22:57:48 1998 *************** *** 0 **** --- 1,15 ---- + + import("m3doc") + + HtmlFile("index") + HtmlFile("gc") + HtmlFile("m3args") + HtmlFile("pragmas") + HtmlFile("restrictions") + HtmlFile("runtime") + HtmlFile("scheduler") + HtmlFile("signals") + + include_dir("linking") + + OtherPackage("m3compiler") Index: m3/pm3/language/modula3/m3compiler/src/pragmas.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/src/pragmas.html:1.2 *** /dev/null Tue Feb 10 23:31:02 1998 --- m3/pm3/language/modula3/m3compiler/src/pragmas.html Tue Feb 10 22:57:48 1998 *************** *** 0 **** --- 1,304 ---- + + +
+ + SRC Modula-3 recognizes the following pragmas: +
+ +
+ The pragma <*EXTERNAL N:L*> may precede an interface + or a procedure or variable declaration in an interface. It asserts + that the following entity is named ``N'' and implemented in language ``L'' + (or uses calling convention ``L''). + If ``N'' is omitted, the external name is the Modula-3 name. The default + and only recognized value for ``L'' are platform dependent. + The ``:'' is only + required when specifying ``L''. ``N'' and ``L'' may be + Modula-3 identifiers or string literals. +
+ On Unix platforms, the default and only recognized language is C. +
+ On Windows/NT, two calling standards are supported, + __cdecl and __stdcall. They are treated + as languages by the <*EXTERNAL*> pragma. + C and WINAPIV are aliases for __cdecl. + WINAPI, CALLBACK, APIENTRY, + APIPRIVATE, and PASCAL are + aliases for __stdcall. The default is C. +
+ The names of external procedures and variables are passed through + the back end unchanged. The types of external variables, the + types of formal parameters, the types of results, and the raises + clauses of external procedures are all assumed to be correct and + are not checked + against their external implementation. +
+ Beginning an interface with <*EXTERNAL*> declares all of the + procedures and variables in that interface external. +
+ For example: +
+ <*EXTERNAL*> INTERFACE OS; + VAR errno: INTEGER; + PROCEDURE exit (i: INTEGER); + END OS. ++
allows importers of OS to access the standard Unix symbols + errno and exit through the names OS.errno and + OS.exit respectively. +
+ Alternatively, the following interface provides access to + the same two symbols, but uses a more conventional Modula-3 name + for the procedure: +
+ INTERFACE OS; + <*EXTERNAL errno:C *> VAR errno: INTEGER; + <*EXTERNAL exit:C *> PROCEDURE Exit (i: INTEGER); + END OS. ++
+ If several variables are declared within a single <*EXTERNAL*> VAR + declaration, they are all assumed to be external. +
+ The external pragma may optionally specify a name different from the + Modula-3 name. + For example: +
+ INTERFACE Xt; + <*EXTERNAL "_XtCheckSubclassFlag" *> + PROCEDURE CheckSubclassFlag (...); + ... ++
defines a procedure named Xt.CheckSubclassFlag in Modula-3 + and named _XtCheckSubclassFlag in the generated C. + +
+ The pragma <*INLINE*> may precede a procedure + declaration. The pragma is allowed in interfaces and modules. + SRC Modula-3 parses but ignores this pragma. + +
+ For example: +
+ INTERFACE X; + <*INLINE*> PROCEDURE P (i: INTEGER); + <*INLINE*> PROCEDURE Q (); + END X. ++
declares X.P and X.Q to be inlined procedures. + +
+ The pragma <*ASSERT expr*> may appear anywhere a statement + may appear. It is a static error if ``expr'' is not of type BOOLEAN. + At runtime ``expr'' is evaluated. It is a checked + runtime error if the result is FALSE. +
+ Assertion checking can be disabled with the -a compiler + switch. + +
+ The pragma <*TRACE expr*> may appear at the end of any variable + or formal declaration. This pragma will generate tracing calls whenever + the declared variable is modified. +
+ The ``expr'' must evaluate to a procedure of two arguments. + The first argument is the name of the traced variable, a TEXT. + The second argument is the traced variable. + Note that any of the formal passing modes may be used with the + second argument. +
+ For example: +
+ MODULE M; + VAR x: Foo <*TRACE MyTrace.FooChanged*>; ++
will cause +
+ MyTrace.FooChanged ("M.x", x)
+
+ to be generated after each statement that modifies x. + Variable aliasing is not tracked, so +
+ WITH alias = x DO INC(alias) END ++
will not generate any tracing. +
+ + The pieces of Modula-3 grammar affected by <*TRACE expr*> are: +
+ VariableDecl = IdList (":" Type & ":=" Expr) V_TRACE.
+ Formal = [Mode] IdList (":" Type & ":=" ConstExpr) V_TRACE.
+ ForSt = FOR Id V_TRACE ":=" Expr TO Expr [BY Expr] DO S END.
+ Handler = QualId {"," QualId} ["(" Id V_TRACE ")"] "=>" S.
+ TCase = Type {"," Type} ["(" Id V_TRACE ")"] "=>" S.
+ Binding = Id V_TRACE "=" Expr.
+ V_TRACE = [ "<*" TRACE Expr "*>" ].
+
+ + + The pragma <*TRACE stmt-list*> may appear immediately after any + BEGIN. The specified ``stmt-list'' will be inserted after each + statement of the block started by the BEGIN. For example: +
+ BEGIN <* TRACE INC(cnt); MyTrace(cnt) *> + i := j; + j := i; + END; ++
will generate INC(cnt); MyTrace(cnt) after each of + the assignment statements. + +
+ + The pragma <*FATAL id-list*> may appear anywhere a + declaration may appear. It asserts that the exceptions named + in ``id-list'' may be raised, but unhandled in the containing scope. + If they are, it's fatal and the program should crash. Effectively, + the <*FATAL*> pragma disables a specific set of + ``potentially unhandled exception'' warnings. If ``id-list'' is ANY, + the pragma applies to all exceptions. The effects of the + <*FATAL*> pragma are limited to its containing scope --- + they cannot be imported from interfaces. +
+ + For example: +
+ EXCEPTION InternalError; + <*FATAL InternalError*> ++
at the top-level of a module M means that no warnings will be + generated for procedures in M that raise but don't list + InternalError in their RAISES clauses. +
+ + Similarly, +
+ PROCEDURE X() RAISES {} =
+ BEGIN
+ ...
+ <*FATAL ANY*> BEGIN
+ List.Walk (list, proc);
+ END;
+ ...
+ END X;
+
+ specifies that although X raises no exceptions and List.Walk + may, no warnings should be generated. + +
+ + The pragma <*UNUSED*> may precede any declaration. It asserts + that the entity in the following declaration is not used and no + warnings should be generated. +
+ + For example, the procedures that implement the default methods + for an object may not need all of the actual parameters: +
+ PROCEDURE DefaultClose (<*UNUSED*> wr: Wr.T) = + BEGIN (* do nothing *) END DefaultClose; ++ +
+ + The pragma <*OBSOLETE*> may precede any declaration + (e.g. <*OBSOLETE*> PROCEDURE P ();). A warning is emitted in + any module that references an obsolete symbol. This feature is used + to warn clients of an evolving interface that they are using + features that will disappear in the future. +
+ +
+ + The pragma <*NOWARN*> may appear anywhere. It prevents warning + messages from being issued for the line containing the pragma. It is + probably better to use this pragma in a few places and enable + all warnings with the -w1 switch than to ignore all warnings. +
+ +
+ + For the benefit of preprocessors that generate Modula-3 programs, the + compiler recognizes a <*LINE ... *> pragma, in two forms: +
+ <*LINE number filename *> + <*LINE number *> ++
where number is an integer literal and filename is a + text literal. + This pragma causes the compiler to believe, for purposes of error + messages and debugging, that the line number of the following source line is + number and that the current input file is filename. + If filename is omitted, it is assumed to be unchanged. + <*LINE ... *> may appear between any two Modula-3 tokens; it + applies to the source line following the line on which it appears. + Here's an example: <*LINE 32 "SourceLoc.nw" *>. + +
+ + The pragma <*PRAGMA id-list*> may appear anywhere. It notifies + the compiler that pragmas beginning with the identifiers in ``id-list'' + may occur in this compilation unit. Since the compiler is free to + ignore any pragma, the real effect of <*PRAGMA*> is to tell + the compiler that pragmas it doesn't implement are coming, but they + shouldn't cause ``unrecognized pragma'' warnings. + +
+ + Any of the ``languages'' allowed in the <*EXTERNAL*> + pragma may be used to indicate the calling convention associated + with a procedure or procedure type. The pragma must appear + immediately prior to the PROCEDURE keyword. + For example: +
+ TYPE WindowsCallBack = <*CALLBACK*> PROCEDURE (h: HANDLE); + + <*CALLBACK*> PROCEDURE Foo (h: HANDLE) = + BEGIN .... ++
declares a procedure and procedure type that use the Windows/NT + CALLBACK (i.e. __stdcall) calling convention. +
+ + The SRC Modula-3 compiler treats procedure types that are equal + except for their calling conventions as different types. + +
+ Last modified on Thu Jan 4 11:07:59 PST 1996 by heydon + modified on Wed Dec 21 14:47:24 PST 1994 by kalsow + modified on Thu Jan 7 18:40:57 PST 1993 by muller ++ + + + Index: m3/pm3/language/modula3/m3compiler/src/restrictions.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/src/restrictions.html:1.2 *** /dev/null Tue Feb 10 23:31:02 1998 --- m3/pm3/language/modula3/m3compiler/src/restrictions.html Tue Feb 10 22:57:48 1998 *************** *** 0 **** --- 1,106 ---- + + +
+ + With a few exceptions, SRC Modula-3 implements the + Modula-3 language definition. +
+ +
+ + SRC Modula-3 does not generate any special checking for integer arithmetic + overflow or underflow. You get whatever checking gcc gives you. + Depending on your machine, the + FloatMode interface may be used to control floating point exceptions. +
+ +
+ + Packed types are restricted. The compiler enforces the rule that every scalar + field (packed or unpacked) can be loaded by a simple ``load, shift, and mask'' + sequence on the machine. So, for example, its not possible to + have a 32-bit integer that crosses a 32-bit alignment boundary + on a machine which only supports aligned 32-bit loads. + +
+ + SRC Modula-3 does not reliably detect thread stack overflows. Stacks + are only checked for overflow on procedure entry. No checking is done + on external procedures. Thread stacks are allocated in fixed size + chunks. The required Thread + interface has been augmented with + the SizedClosure type to allow arbitrary sized stacks. The default + size can be adjusted with Thread.MinDefaultStackSize and + Thread.IncDefaultStackSize. + +
+ + On some platforms (ALPHA_OSF and DS3100), exceptions scopes + are delimited by tables of PCs and exceptions are dispatched by a + runtime routine that's able to unwind the stack. +
+ + On all other platforms, + SRC Modula-3 uses C's setjmp/longjmp mechanism to + unwind the stack when raising an exception. A problem can + occur: assignments may appear to be undone. + For example, consider +
+ TRY + i := 3; + P (); + EXCEPT E: + j := i; + END; ++
where P raises exception E. + The compiler generates a setjmp at the beginning of + the try statement. If the C compiler allocates variable i + to a register, the assignment of 3 may be lost during the + longjmp and branch that gets to the handler. + +
+ + The language definition says that if T is an object type + and m one of its methods, T.m denotes the procedure + value that implements that method and that this value is a constant. + In SRC Modula-3, T.m denotes the correct procedure constant, + but since the compiler generates runtime code to locate the method, + some uses of the constant that the C compiler must resolve at link + time will cause C errors. + For example, +
+ CONST P = T.m; BEGIN P (...) ... ++
will work, since no initialized C storage is allocated for P. + But the following generates initialized storage and will fail +
+ CONST X = ARRAY [0..2] OF Proc { T.m, ..};
+
+ + + Similarly, although Modula-3 allows it, the following cannot be + evaluated at compile time +
+ CONST X = (T.m = MyProcedure); ++ +
+ Last modified on Thu Jan 4 11:07:59 PST 1996 by heydon + modified on Thu Jun 1 08:16:29 PDT 1995 by kalsow + modified on Thu Jan 7 18:40:57 PST 1993 by muller ++ + + + Index: m3/pm3/language/modula3/m3compiler/src/runtime.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/src/runtime.html:1.2 *** /dev/null Tue Feb 10 23:31:02 1998 --- m3/pm3/language/modula3/m3compiler/src/runtime.html Tue Feb 10 22:57:48 1998 *************** *** 0 **** --- 1,93 ---- + + +
+ + This section contains a brief introduction to the internal structure + of the runtime system. This introduction is neither + comprehensive nor tutorial; it is merely intended as a stepping stone + for the courageous. +
+ + The runtime itself implements the + garbage collector, + Modula-3 startup code and a few miscellaneous functions. The runtime + exists in the libm3/src/runtime directory. +
+ + The allocator and + garbage collector + are based on Joel Bartlett's + ``mostly copying collector''. + Since that paper, we've made a few + modifications to support a growing heap and to use extra information + that the Modula-3 compiler generates. +
+ + On some platforms + (e.g. DS3100 and ALPHA_OSF) exceptions are + implemented by PC tables and a stack walker. + On all other platforms, exceptions are implemented with setjmp + and longjmp. The + jump buffers and scope descriptors are chained together to form a + stack. + The ThreadF + interface holds the head of the chain. + There is a distinct chain for each thread. When an exception is + raised, the chain is searched. If a handler for the exception is + found, the exception is allowed to unwind the stack, otherwise a + runtime error is signaled. To unwind the stack, a longjmp is + done to the first handler on the stack. It does whatever cleanup is + necessary and passes control on up the stack to the next handler until + the exception is actually handled. +
+ + Reference types are represented at runtime by a ``typecell''. Due to + separate compilation, opaque types and revelations, it is not possible + to fully initialize typecells at compile time. Typecell + initialization is finished at link time. A typecell contains a type's + typecode, a pointer to its parent typecell, the size of the types + referent and method list if any, the type's brand, the number of open + array dimensions, the type's fingerprint, and procedures to initialize + the typecell, initialize new instances of the type, print instances of + the type and trace the type for garbage collection. +
+ + At the beginning of the execution of the program, all global variables + are initialized, and the main bodies of the modules are invoked. The + table that lists the module to be initialized is + generated by the linker part of the driver. +
+ + Other parts of the runtime, such as threads, are actually implemented + in the base library. +
+ + On Unix, Thread switching + is implemented with setjmp and longjmp. + A timer interrupt (signal) + is used to cause preemptive thread + switching. The global variable + ThreadPosix.self + points to the + currently running thread. The integer + RT0u.inCritical + is used by the runtime to prevent thread switching during garbage + collection and other ``atomic'' runtime operations. +
+ + On Windows/NT, Modula-3 threads are implemented as Win32 kernel threads. + +
+ Last modified on Thu Jan 4 11:07:58 PST 1996 by heydon + modified on Thu Jun 1 08:16:58 PDT 1995 by kalsow + modified on Tue Feb 18 13:23:15 PST 1992 by muller ++ + + + Index: m3/pm3/language/modula3/m3compiler/src/scheduler.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/src/scheduler.html:1.1.1.1 *** /dev/null Tue Feb 10 23:31:02 1998 --- m3/pm3/language/modula3/m3compiler/src/scheduler.html Sat Jan 31 14:47:12 1998 *************** *** 0 **** --- 1,91 ---- + + +
+ + SRC Modula-3 has a flexible scheduling algorithm. + Here is a rough explanation of its behaviour. +
+ + All threads are kept in a circular list. This list is + modified only when new threads are created or when they exit; that + is, the relative order of threads in this list is never modified. +
+ + When the scheduler comes into action, the list of threads is scanned + starting with the thread following the one currently running, until + a thread that can execute is found: +
+ + If such a thread is found, it becomes active. +
+ + If no thread can execute, and there are no threads blocked in a + Thread.Pause + or a + SchedulerPosix.IOWait, + a deadlock situation is detected + and reported. Otherwise, a combination of the file descriptors sets + (OR of all the file descriptors sets) and timeouts (MIN of all the + timeouts) is formed, select(2) is called with those arguments + and the whole process of searching for an executable thread is redone. + This ensures that the Unix process does not consume CPU resources while + waiting. +
+ + The scheduler is activated when the running thread tries to acquire a + mutex which is locked, waits for a condition, calls + Thread.Pause + (or a similar procedure) with a future time, calls + SchedulerPosix.IOWait + (or a similar procedure) with a non-zero valued timeout and no files + are ready at the time of the call, or the time allocated to the thread + has expired (preemption). +
+ + Preemption is implemented using the Unix virtual interval timer. + SRC Modula-3 does not use the real time interval + timer nor the profiling interval timer for thread scheduling; these + are available to the program. +
+ + Because of the preemption implementation, Unix kernel calls + will block the process (i.e. the Unix process sleeps even though + some threads could run). However, + Thread.Pause + and + SchedulerPosix.IOWait + provide functional equivalents of + sigpause(2) and + select(2) that do not cause the process to block. +
+
+ Last modified on Thu Jan 4 11:07:58 PST 1996 by heydon + modified on Thu Jun 1 08:17:53 PDT 1995 by kalsow + modified on Thu Jan 7 18:40:57 PST 1993 by muller ++ + + + Index: m3/pm3/language/modula3/m3compiler/src/signals.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/src/signals.html:1.1.1.1 *** /dev/null Tue Feb 10 23:31:02 1998 --- m3/pm3/language/modula3/m3compiler/src/signals.html Sat Jan 31 14:47:12 1998 *************** *** 0 **** --- 1,56 ---- + + +
+ + On Unix the Modula-3 runtime catches seven signals: + SIGHUP, + SIGINT, + SIGTERM, + SIGQUIT, + SIGSEGV, + SIGPIPE, + and + SIGVTALRM. + Otherwise, the runtime leaves the default Unix signal handlers unaltered. +
+ + SIGHUP(``hang up''), SIGINT(``interrupt''), + and SIGTERM(``terminate'') all indicate that the + program is to stop. The Modula-3 runtime calls its usual + clean-up routines and exits. +
+ + SIGQUIT is like the above, except the runtime + prints the error message ``aborted'', and attempts + to crash with a ``core file''. +
+ + SIGSEGV indicates a ``segmentation violation'' and is often + signaled when a process dereferences NIL. + The runtime catches SIGSEGV, prints an error message, and attempts + to crash with a ``core file''. +
+ + SIGPIPE indicates a ``broken pipe''. The runtime ignores the + signal and when next accessed, any reader(writer) that was using the pipe + will raise Rd.Failure(Wr.Failure). +
+ + SIGVTALRM is the ``virtual timer alarm''. It is used to periodically + preempt the running thread. +
+ +
+ Last modified on Thu Jan 4 11:07:57 PST 1996 by heydon + modified on Fri Apr 22 11:45:04 PDT 1994 by kalsow + modified on Thu Jan 7 18:40:57 PST 1993 by muller ++ + + + Index: m3/pm3/language/modula3/m3compiler/src/linking/Example1.gif Index: m3/pm3/language/modula3/m3compiler/src/linking/Example2.gif Index: m3/pm3/language/modula3/m3compiler/src/linking/Example3.gif Index: m3/pm3/language/modula3/m3compiler/src/linking/Example4.gif Index: m3/pm3/language/modula3/m3compiler/src/linking/LinkingLibs.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/src/linking/LinkingLibs.html:1.1.1.1 *** /dev/null Tue Feb 10 23:31:02 1998 --- m3/pm3/language/modula3/m3compiler/src/linking/LinkingLibs.html Sat Jan 31 14:47:12 1998 *************** *** 0 **** --- 1,18 ---- + + +
+ + When you build a library package, no reachability graph is + constructed. The only requirement on a library package is that any + interface IMPORTed or EXPORTed by each of the library's root units + must either be a root, or a visible interface in some imported + package.
+ + + + Index: m3/pm3/language/modula3/m3compiler/src/linking/LinkingProgs.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/src/linking/LinkingProgs.html:1.1.1.1 *** /dev/null Tue Feb 10 23:31:02 1998 --- m3/pm3/language/modula3/m3compiler/src/linking/LinkingProgs.html Sat Jan 31 14:47:12 1998 *************** *** 0 **** --- 1,39 ---- + +
++ + When you build a program package or library package that imports one + or more library packages, the interfaces you IMPORT from within those + imported packages must be visible. However, there are other + requirements you must satisfy when building a program.
+ + The Modula-3 language definition defines a complete program to + be "a collection of modules and interfaces that contains every + interface imported or exported by any of its modules or interfaces, + and in which no procedure, module, or interface is multiply defined" + (Section 2.5, page 42). There are other requirements on a complete + program as well. For example, every declared procedure must have an + implementation, and every opaque type must have a concrete + revelation.
+ + When you build a program that imports library packages, not all of the + interfaces and modules in those libraries are necessarily included by + the linker. In fact, only those interfaces and modules that satisfy a + reachability requirement are linked into the final program.
+ +
+ + These examples were suggested by Umesh Maheshwari + (umesh@note.lcs.mit.edu). + +
Our first example consists of a program built from two packages: a + library package named LibPkg and a program package named + ProgPkg. +
+ The LibPkg package consists of three source files: "X.i3", + "Y.i3", and "Y.m3".
+ +
+ INTERFACE X; INTERFACE Y; + TYPE T <: ROOT; END Y. + END X. + + MODULE Y; + IMPORT X; + REVEAL X.T = ROOT BRANDED OBJECT c: CHAR END; + BEGIN END Y. ++ +
The m3makefile for package LibPkg is:
+ +
+ import(libm3) + Interface(X) + Module(Y) + Library(LibPkg) ++ +
The ProgPkg package consists of a single source file, + "Main.m3". + +
+ MODULE Main; + IMPORT X; + BEGIN END Main. ++ +
The m3makefile for package ProgPkg is:
+ +
+ override(LibPkg, "../..") + import(libm3) + import(LibPkg) + implementation(Main) + program(Prog) ++ +
The unit graph constructed by the linker when it builds the + ProgPkg program looks like this:
+
+ ![[ Image for Figure 1 ]](Example1.gif)
+ +
In this and subsequent figures, the roots are colored red, the + reachable non-roots are colored blue, and the edges are labeled "I" or + "E" to denote that the edge is due to an IMPORT or EXPORTS relation, + respectively. Hence, the colored nodes correspond to the units + included in the final build.
+ +
Since the units "Y.m3" and "Y.i3" are not reachable from the single + root "Main.m3", the linker does not include them in the build. Hence, + the linker does not find a concrete revelation for the type "X.T". + When we run m3build on the ProgPkg package, the compiler + prints out the following error message:
+ +
+ -> linking Prog + opaque type never revealed: _tb81ca1e6 + defined in X.i3 ++ +
The problem can be avoided in a number of ways, as shown in the + following three examples. + +
If we change "Main.m3" so that it imports "Y" as well as "X", the unit + graph changes to look like this:
+
+ ![[ Image for Figure 2 ]](Example2.gif)
+ + Now, both "Y.i3" and "Y.m3" are reachable from the root, so the linker + finds a concrete revelation for "X.T", and the program builds + successfully. + +
Starting from Example 1, we can instead export the interface "X" in + the module "Y", like this:
+ +
+ MODULE Y EXPORTS X, Y; + IMPORT X; + REVEAL X.T = ROOT BRANDED OBJECT c: CHAR END; + BEGIN END Y. ++ +
This adds a new EXPORTS edge to the unit graph:
+
+ ![[ Image for Figure 3 ]](Example3.gif)
+ +
Now, "Y.m3" has become reachable from the root "Main.m3" through + "X.i3", so the linker again finds a concrete revelation for "X.T", and + the program builds successfully.
+ +
Starting from the source files of Example 1, we can move all of the + LibPkg sources into the ProgPkg package. The + m3makefile for the ProgPkg then becomes:
+ +
+ import(libm3) + interface(X) + module(Y) + implementation(Main) + program(Prog) ++ +
This doesn't change the unit graph from Example 1, but it does + makes all four of the sources roots:
+
+ ![[ Image for Figure 4 ]](Example4.gif)
+ +
Hence, "Y.m3" is once again seen by the linker, and the program builds + successfully.
+ + + + Index: m3/pm3/language/modula3/m3compiler/src/linking/ReachabilityReq.html diff -c /dev/null m3/pm3/language/modula3/m3compiler/src/linking/ReachabilityReq.html:1.2 *** /dev/null Tue Feb 10 23:31:02 1998 --- m3/pm3/language/modula3/m3compiler/src/linking/ReachabilityReq.html Tue Feb 10 22:57:52 1998 *************** *** 0 **** --- 1,44 ---- + +
++ + When building a program, the linker determines which units (interfaces + and modules) to include by traversing a directed graph. The nodes of + the graph correspond to program units, and certain nodes of the graph + are designated as roots. A unit u is included in the + build if and only if u is reachable from some root, that is, if + there exists a (possibly empty) path in the graph from some root + r to u. We must now describe how the linker determines + the set of roots and the set of edges in this graph.
+ + Each program's m3makefile specifies a set of sources via quake + calls like interface(X), implementation(X), and + module(X). Each of these calls adds the name of the source file + (or unit) to the set of program sources. + These program sources constitute the set of roots used + to start the traversal. Notice that source files included via + include_dir(D) or include_pkg(P) will get added to this + list, but not those imported via import(P).
+ + The edges of the graph are determined by the IMPORT and EXPORTS + relations among the units. An edge exists in the graph from the unit + A to the unit B if and only if:
+ +
That is, if A IMPORTs B, then there is a directed edge from A to B in + the graph, but if A EXPORTS B, then there is a bi-directional edge + between A and B.
+ + + + Index: m3/pm3/language/modula3/m3compiler/src/linking/m3makefile diff -c /dev/null m3/pm3/language/modula3/m3compiler/src/linking/m3makefile:1.1.1.1 *** /dev/null Tue Feb 10 23:31:02 1998 --- m3/pm3/language/modula3/m3compiler/src/linking/m3makefile Sat Jan 31 14:47:12 1998 *************** *** 0 **** --- 1,9 ---- + + HtmlTextFile("Example1.gif") + HtmlTextFile("Example2.gif") + HtmlTextFile("Example3.gif") + HtmlTextFile("Example4.gif") + HtmlFile("LinkingLibs") + HtmlFile("LinkingProgs") + HtmlFile("ReachabilityExs") + HtmlFile("ReachabilityReq") Index: m3/pm3/language/modula3/m3tools/coverage/src/m3makefile diff -c m3/pm3/language/modula3/m3tools/coverage/src/m3makefile:1.5 m3/pm3/language/modula3/m3tools/coverage/src/m3makefile:1.6 *** m3/pm3/language/modula3/m3tools/coverage/src/m3makefile:1.5 Wed Dec 17 15:57:00 1997 --- m3/pm3/language/modula3/m3tools/coverage/src/m3makefile Tue Feb 10 22:57:57 1998 *************** *** 28,34 **** if defined ("_all") if stale (pgm, src) ! ret = m3_compile_c(src,obj,["../src"]) if not equal(ret, 0) error("command failed with error code: ", ret) end ret = m3_link(pgm,[obj],[]) if not equal(ret, 0) error("command failed with error code: ", ret) end --- 28,34 ---- if defined ("_all") if stale (pgm, src) ! ret = m3_compile_c(src,obj,[".." & SL & "src"]) if not equal(ret, 0) error("command failed with error code: ", ret) end ret = m3_link(pgm,[obj],[]) if not equal(ret, 0) error("command failed with error code: ", ret) end Index: m3/pm3/language/modula3/m3tools/gnuemacs/src/index.html diff -c /dev/null m3/pm3/language/modula3/m3tools/gnuemacs/src/index.html:1.2 *** /dev/null Tue Feb 10 23:31:06 1998 --- m3/pm3/language/modula3/m3tools/gnuemacs/src/index.html Tue Feb 10 22:58:02 1998 *************** *** 0 **** --- 1,148 ---- + +
++ SRC Modula-3 comes with a mode for editing Modula-3 programs under + gnuemacs. Here is a list of the main features this mode + provides: + +
+ + Modula-3 mode provides two methods of formatting code, one ``batch'' + and one ``interactive.'' The batch method invokes the program m3pp, which takes a program unit such + as a procedure and formats it completely. The gnuemacs + commands (and their keyboard shortcuts) that invoke m3pp are:
+
+ The other method of formatting text is a more traditional one for + gnuemacs, in which the language mode provides a key that + indents the current line appropriately. In keeping with the + convention used in modes for other languages such as Lisp and C, the + key used is TAB. Typing TAB on a line indents the + current line in a way that is (we hope) appropriate given the lines + that precede it. + +
+ The two formatting methods are not mutually exclusive; perhaps + you like the way m3pp lines up columns in declarations, + but you also like to keep things indented while you type. You + can use the electric mode to get things close, then invoke + m3pp when you're done. + +
+ + Modula-3 mode offers some aid if you don't like typing a lot of + uppercase keywords. The TAB actually serves double + duty; it not only indents the current line, but when invoked at + the end of a word, it attempts to complete the current word as a + keyword. For example b TAB expands the b to + BEGIN, provided the b appears in a context where + BEGIN may be a valid keyword. There are some fairly extensive + rules governing the contexts in which a given keyword is a valid + completion; the net result is that it is seldom necessary to type + more than one letter to get the correct completion. If you + specify a non-unique prefix of a set of keywords, it chooses the + first in an ordering intended to capture frequency of use; it + also presents the other choices, and typing TAB repeatedly + cycles through these choices. +
+ A pair of related features are ``END-completion'' and + ``END-matching.'' If the elisp variable + m3::electric-end is set to 'all, completing the + keyword END has the additional effect of finding the + construct that the END completes. If that construct is a + an interface, module, or procedure, it fills in the name of the + completed construct after the END; otherwise, it inserts a + comment containing the keyword of the completed construct. If + m3::electric-end is 'proc-mod, it only fills in + real names, never keyword comments. Independently, a non-nil + value of the elisp variable m3::blink-end-matchers causes + completion of END to blink the cursor briefly at the + beginning of the completed construct. + +
+ The key C-c i is bound to m3::show-interface, which + expects the point to be in an interface name, and attempts to + find that interface and display it in another window. + It uses a built-in list of directories. The + default value of this list is the one used at SRC; other + sites will probably need to modify this. +
+ + The key C-c m is bound to m3::show-implementation. This + attempts to find the module that implements the interface in the + current buffer. As distributed, this function relies on SRC-specific + conventions. Obviously, this may not work outside of SRC, and + m3::show-implementation may need to be re-implemented or abandoned. +
+ To have the Modula-3 mode automatically invoked when visiting a + Modula-3 source file, you should put in your .emacs: + +
+ (autoload 'modula-3-mode "modula3")
+ (setq auto-mode-alist
+ (append '(("\\.ig$" . modula-3-mode)
+ ("\\.mg$" . modula-3-mode)
+ ("\\.i3$" . modula-3-mode)
+ ("\\.m3$" . modula-3-mode))
+ auto-mode-alist))
+
+
+ + It is also convenient to have the lines: + +
+ (setq completion-ignored-extensions
+ (append '(".mo" ".mx" ".mc" ".io" ".ix") completion-ignored-extensions))
+
+ + so that you don't get the files with those extensions offered as + possible completions. + +
+ Your system administrator may have inserted these lines in the default + macro files for your system. + +
+ There is also a program to build tags file for Modula-3 programs: + m3tags; see the manpage for the details. When the system is + installed, a tag file for the public interfaces is built. To access + it, you need in your .emacs (or in the system initialization file) + the line: +
+ (visit-tags-table "LIB_USE/FTAGS") ++
+ where LIB_USE is the place where the Modula-3 libraries have + been installed. + +
+ Last modified on Mon Jul 22 12:51:08 PDT 1996 by heydon + modified on Fri Apr 22 11:35:32 PDT 1994 by kalsow + modified on Thu Jan 7 18:40:57 PST 1993 by muller ++ + + + Index: m3/pm3/language/modula3/m3tools/gnuemacs/src/m3makefile diff -c m3/pm3/language/modula3/m3tools/gnuemacs/src/m3makefile:1.4 m3/pm3/language/modula3/m3tools/gnuemacs/src/m3makefile:1.5 *** m3/pm3/language/modula3/m3tools/gnuemacs/src/m3makefile:1.4 Wed Dec 17 15:54:43 1997 --- m3/pm3/language/modula3/m3tools/gnuemacs/src/m3makefile Tue Feb 10 22:58:02 1998 *************** *** 6,13 **** % modified on Fri Nov 5 16:41:57 PST 1993 by detlefs % modified on Mon Jan 18 19:09:20 PST 1993 by muller - m3_option("-commands") - VERBOSE="TRUE" if equal (TARGET, "LINUX") or equal (TARGET, "LINUXELF") include_dir ("flex-bison") --- 6,11 ---- *************** *** 20,31 **** import_lib("c", "/lib") c_source ("m3tags") h_source ("hash") - C_program ("m3tags") ManPage ("m3tags", 1) CompiledGnuemacs ("m3tags") CompiledGnuemacs ("modula3") CompiledGnuemacs ("ispell19-3.0") % CompiledGnuemacs ("m3-debug") % CompiledGnuemacs ("shell-compile") --- 18,32 ---- import_lib("c", "/lib") c_source ("m3tags") h_source ("hash") ManPage ("m3tags", 1) + import("m3doc") + HtmlFile("index") CompiledGnuemacs ("m3tags") CompiledGnuemacs ("modula3") CompiledGnuemacs ("ispell19-3.0") % CompiledGnuemacs ("m3-debug") % CompiledGnuemacs ("shell-compile") + + C_program ("m3tags") Index: m3/pm3/language/modula3/m3tools/m3gdb/src/index.html diff -c /dev/null m3/pm3/language/modula3/m3tools/m3gdb/src/index.html:1.1.1.1 *** /dev/null Tue Feb 10 23:31:40 1998 --- m3/pm3/language/modula3/m3tools/m3gdb/src/index.html Sat Jan 31 14:47:12 1998 *************** *** 0 **** --- 1,116 ---- + + +
+ + A Modula-3 aware version of gdb may be used to debug Modula-3 code. + It understands Modula-3 types, declarations, and expressions. It also + supports threads. The usual gdb commands may be used. This document + discusses three areas where special care is required: + garbage collection, threads, and calling non standard procedures. + + While gdb tries to determine automatically the language for + the current frame (procedure), you may sometimes want to + explicitely set the current language: +
+ (m3gdb) set language m3 + (m3gdb) set language c ++ +
+ On some platforms, a VM synchronized version of the garbage collector + uses SIGSEGV signals. By default, gdb stops and prints a message each + time SIGSEGV is received. This behavior may be changed with the + handle command. + The simplest way to avoid these signals + is to disable the VM synchronized garbage collector, using the + @M3novm command line option: + +
+ cassis> m3gdb myprog + (m3gdb) run @M3novm ...other arguments... ++ +
+ If you prefer to keep the VM synchronized collector while debugging, + you may use: + +
+ (m3gdb) handle SIGSEGV noprint pass ++ +
+ However, you will then not be able to examine the protected memory regions. + You may unprotect the memory with: + +
+ (m3gdb) call RTCollectorSRC.FinishVM() ++ +
+ You may disable the memory protection for the rest of the execution with: + +
+ (m3gdb) call RTCollectorSRC.DisableVM() ++ +
+ On platforms where Modula-3 uses native threads (NT), the + gdb thread commands may be used (info thread, and thread) + to list the threads and switch to another thread. + +
+ On other platforms, m3gdb provides threads to list the + threads, and switch id to switch to another thread indicated by + id. You must switch back to the thread where the program + stopped before continuing the execution (i.e. the first thread + listed by the threads). + If the switch command is interrupted, the state of + m3gdb is essentially random and it will most likely crash. + The current language must be m3 for the threads + and switch commands to work. +
+ +
+ Modula-3 procedures are mapped as closely as possible into C procedures + and may be called by gdb using call. + Two differences exist: "large" results and nested procedures. + +
+ First, procedures that return structured values (i.e. records, arrays + or sets) take an extra parameter. The last parameter is a pointer to + the memory that will receive the returned result. This parameter was + necessary because some C compilers return structured results by + momentarily copying them into global memory. The global memory scheme + works fine until it's preempted by the Modula-3 thread scheduler. + +
+ Second, nested procedures are passed an extra parameter, the ``static link''. + The exact details of how that parameter are passed are system dependent. + When a nested procedure is passed as a parameter, the address of the + corresponding C procedure and its extra parameter are packaged + into a small closure record. The address of this record is actually + passed. Any call through a formal procedure parameter first checks to + see whether the parameter is a closure or not and then makes the + appropriate call. Likewise, assignments of formal procedure + parameters to variables perform runtime checks for closures. +
+ + <*EXTERNAL*> + procedures have no extra parameters. + except if they return large results?? +
+
+
+
+
Index: m3/pm3/language/modula3/m3tools/m3gdb/src/m3makefile
diff -c m3/pm3/language/modula3/m3tools/m3gdb/src/m3makefile:1.2 m3/pm3/language/modula3/m3tools/m3gdb/src/m3makefile:1.3
*** m3/pm3/language/modula3/m3tools/m3gdb/src/m3makefile:1.2 Fri Nov 28 09:24:19 1997
--- m3/pm3/language/modula3/m3tools/m3gdb/src/m3makefile Tue Feb 10 22:58:21 1998
***************
*** 45,59 ****
if not equal(ret,0) error("Failed to build m3gdb") end
else
% configure the sources & compile
! ret = exec (["../gdb/configure", % M3GDB_CONFIG,
! "--srcdir=../gdb", "--disable-gdbtk", gnu_platform (M3GDB_HOST)])
ret = exec ([M3GDB_MAKE, ARG0, ARG1])
if not equal(ret,0) error("Failed to build m3gdb") end
end
% finally, build the exportable link and man page and export them
! ret = exec(["mv","gdb/gdb", "m3gdb"])
if not equal(ret,0) error("Failed to rename gdb to m3gdb") end
BindExport ("m3gdb")
ManPage ("m3gdb","1")
--- 45,75 ----
if not equal(ret,0) error("Failed to build m3gdb") end
else
% configure the sources & compile
! local cmd = [".." & "/" & "gdb" & "/" & "configure", % M3GDB_CONFIG,
! "--srcdir=../gdb", "--disable-gdbtk", gnu_platform (M3GDB_HOST)]
! if equal(OS_TYPE,"WIN32")
! > "tmpsh" in
! write("#! /bin/sh",CR)
! write(cmd,CR)
! end
! ret = exec(["sh","tmpsh"])
! else
! ret = exec (cmd)
! end
ret = exec ([M3GDB_MAKE, ARG0, ARG1])
if not equal(ret,0) error("Failed to build m3gdb") end
end
% finally, build the exportable link and man page and export them
! ret = exec(["mv","gdb/gdb" & NAMING_CONVENTIONS[20],
! "m3gdb" & NAMING_CONVENTIONS[20])
if not equal(ret,0) error("Failed to rename gdb to m3gdb") end
BindExport ("m3gdb")
ManPage ("m3gdb","1")
+
+ import("m3doc")
+ HtmlFile("index")
+
+ OtherPackage("m3gdb")
+
Index: m3/pm3/language/modula3/m3tools/m3ide/src/index.html
diff -c m3/pm3/language/modula3/m3tools/m3ide/src/index.html:1.1.1.1 m3/pm3/language/modula3/m3tools/m3ide/src/index.html:1.2
*** m3/pm3/language/modula3/m3tools/m3ide/src/index.html:1.1.1.1 Tue Jan 27 13:56:26 1998
--- m3/pm3/language/modula3/m3tools/m3ide/src/index.html Tue Feb 10 22:58:25 1998
***************
*** 17,26 ****
The first step is set your emacs path to include
/usr/local/pm3-1.1/lib/elisp and
to load m3setup.el from your .emacs file.
!
(setq load-path (append (list "/usr/local/pm3-1.1/lib/elisp") load-path))
(load-library "m3setup.el")
!
This will setup the automatic loading of the m3ide (within the modula3) mode when a file ending in .i3, .m3, .ig, .mg, .fv is loaded. Then, --- 17,27 ---- The first step is set your emacs path to include /usr/local/pm3-1.1/lib/elisp and to load m3setup.el from your .emacs file. ! !
(setq load-path (append (list "/usr/local/pm3-1.1/lib/elisp") load-path)) (load-library "m3setup.el") !
This will setup the automatic loading of the m3ide (within the modula3)
mode when a file ending in .i3, .m3, .ig, .mg, .fv is loaded. Then,
***************
*** 56,62 ****
move even more functionality into Modula-3 code. Here is a whish
list. I will not have time in the foreseeable future to do
any of it. Volunteers are more than welcome. Thanks to
! Lennart Staflin
+ SRC Modula-3 includes a pretty-printer for Modula-3 programs called
+ m3pp.
+ It will take the source code
+ and make decisions on where to place line breaks, how far to indent lines,
+ etc. to produce a supposedly more readable version of the program.
+
+
+ The syntax for calling m3pp is
+ The pretty-printer reads its input from the specified file.
+ If no file is given, then the pretty-printer reads standard
+ input. The formatted version is always sent to standard output.
+
+
+ The pretty-printer can produce text output suitable for replacing your code
+ (the default) or PostScript output suitable for printing. Some additional
+ options are availble when producing PostScript output.
+
+
+ The pretty-printer reads options from $HOME/.m3pp.pro.1,
+ then .m3pp.pro.1
+ in the current directory, then from the command line. Single-letter
+ abbreviations can be used, but no others are recognized.
+
+
+ -caps
+ Recognize keywords in either lower or upper case and
+ map them to upper case in the output. If this option
+ is not specified, keywords must appear in upper case.
+
+
+ -margin n
+ Set the margin to n.
+ The margin is the maximum width of an output line.
+ The pretty-printer occasionally exceeds this maximum, so it's usually wise
+ to set it a little lower than you want. If this option is not specified, a
+ margin of 75 is used.
+
+
+ -offset n
+ Set the offset to n.
+ The offset is the number of spaces by
+ which a construct inside another one is indented. The default
+ is 2 for text ouput, and 4 for PostScript output.
+
+
+ -xcolumn n
+ Set the comment column to n.
+ This is the column in which comments that are on
+ the same line as code but are not followed on that line by code will start.
+ To disable comment alignment, specify -xcolumn 1.
+ The default is 33 for text output, 80 for PostScript output.
+
+
+ -src
+ Use the SRC style of formatting (default).
+
+
+ -eric
+ Use Eric's style. "END"s are emitted at the end of lines rather
+ than on a line by themselves. This option cannot be abbreviated.
+
+
+ -callspace
+ This inserts blank space around function calls and array subscripts.
+ "f(x,y)" becomes "f (x, y)" and "a[i]" becomes "a [i]".
+ This option cannot be abbreviated.
+
+
+ -noalign
+ The pretty-printer attempts to align const, variable, and type declarations
+ into columns. This option turns off the alignment. It does not disable
+ the alignment of formal parameter lists when they don't fit on one line.
+
+
+ -whenbreak {always | early | late}
+ When the pretty-printer has to break a line that's too long, you have
+ two stylistic choices:
+
+ -whenbreak always
+ tells the pretty-printer to use style 1, always. Otherwise,
+ it will consider BOTH styles, which takes somewhat more time. If
+ style 1 produces fewer lines, it will use it. If they produce the
+ same number of lines, then:
+ -whenbreak early
+ says to use style 1, and
+ -whenbreak late
+ says to use style 2.
+ The arguments can be abbreviated as a, e, or l.
+ The default is "-whenbreak early".
+
+
+ -break
+ This is equivalent to "-whenbreak always".
+
+
+ -follow
+ Normally, the formatter assumes that comments precede declarations or code,
+ and formats them at the same indentation level as whatever follows. This
+ style can also work fine with comments that follow a declaration. This
+ option changes the comment indentation to more closely match the older
+ version of the pretty-printer, assuming that comments follow declarations.
+ With -follow, you get
+ instead of
+ In either case, a blank line will cause subsequent comments to be aligned
+ with the statements or declarations that follow. You get
+ in either mode. The chief disadvantage of this mode is that comments in
+ blocks of code are attached to the preceding statement and indented one
+ level unless they are preceded by a blank line.
+
+
+ -ZZ
+ Use emacs filter mode. The formatter loops,
+ accepting and formatting declarations, BEGIN-END groups, or modules. Each
+ chunk of code to be formatted should begin with a control-B (^B) and end
+ with a control-A (^A).
+
+
+ -ZZG
+ Use emacs filter mode on a single chunk (for a different Emacs package).
+
+
+ -text
+ Produce text output. This is the default.
+
+
+ The following options are used when producing PostScript output. Except
+ for -portrait,
+ they cannot be abbreviated. For the font options, valid font names are
+ PostScript names followed by an integer point size (e.g. "Helvetica9").
+
+
+ -ps
+ Produce PostScript output suitable for printing.
+
+
+ -portrait
+ Produce one-column portrait mode output. The default is two-column
+ landscape mode output.
+
+
+ -bf font
+ Set the font used for formatting the body text of the program. The default
+ is Times-Roman10.
+
+
+ -kf font
+ Set the font used for formatting keywords. The default
+ is Helvetica7.
+
+
+ -bif font
+ Set the font used for formatting built-in identifiers. The default
+ is Times-Roman8.
+
+
+ -pf font
+ Set the font used for formatting procedure names. The default
+ is Times-Bold10.
+
+
+ -cf font
+ Set the font used for formatting comments. The default
+ is Times-Italic10.
+
+
+ -fcf font
+ Set the font used for formatting comments that aren't refilled (see below).
+ The default is Courier-Oblique9.
+
+
+ -ff font
+ Set the font used for formatting text and char literals. The default
+ is Courier9.
+
+
+ The pretty-printer fills long comments; that is, it chooses line breaks
+ inside long comments so as to fill up each line with words. This is
+ usually convenient, but occasionally disastrous: a carefully formated
+ table, equation, or program in the input will be reduced to a dense
+ paragraph in the output. To spare your formatted comments from this fate,
+ begin the comment with "(*|" or "(**", or begin the comment with "(*" on a
+ line by itself. The old style of marking each line individually is also
+ supported. In filled comments, lines that begin with a vertical bar ("|")
+ in column 1 will not be filled.
+
+
+ Conversely, if you want a comment to be filled, begin the comment with
+ "(*" and place some text on the same line as the comment start. Pragmas
+ are never reformatted. Pragmas and comments that are not reformatted may
+ still be moved left or right to an appropriate indentation level.
+
+
+ The pretty-printer tries hard not to add or remove blank lines from the
+ program. It will add and remove line breaks, however.
+
+
+ The formatting rule used for CASE statements is geared toward
+ programs in which there is no vertical bar after the last case, and
+ no vertical bar before the ELSE clause. The same goes for TYPECASE
+ and TRY statements.
+
+
+ In selecting elements of multi-dimensional arrays, the syntax
+ a[i][j] means the same thing as a[i, j]. The second version will
+ be handled better by the pretty-printer.
+
+
+ The compiler currently ignores the portion of the input file that
+ follows the module-terminating dot. However, the pretty-printer
+ requires that only properly-delimited comments appear in this
+ portion of the file. Therefore, if your file has any comments
+ there, be sure that they are enclosed within comment brackets.
+
+
+ If the input contains a syntactically valid compilation unit (that
+ is, a definition module, implementation module, or program module)
+ then the output becomes the corresponding pretty-printed version.
+ If the input contains a syntax error, then the output is
+ pretty-printed up to the lexical token that caused the syntax
+ error, then a line is printed consisting of the string "(* SYNTAX
+ ERROR *)" followed by the offending token, an error message is
+ printed to standard error output, and the remainder of the input is
+ copied unchanged into the output. Regardless of whether a syntax
+ error is found, m3pp
+ exits with status code 0. (If the syntax error
+ was caused by an unexpected end of file, then the string
+ "(* SYNTAX ERROR *)" will appear at the end of the output file.)
+
+
+ String constants of more than 500 characters, or input or output
+ lines of more than 500 characters, will overflow internal buffers.
+ In case these or any other run-time errors cause the program to
+ abort, the output file (if specified) will not be modified.
+
+
+ The pretty-printer sometimes exceeds the margin limits due to details of
+ the formatting algorithm. The text that exceeds the limit usually consists
+ of closing delimiters, such as right parens and right brackets. Setting
+ the margin a little lower than you want usually does the trick.
+
+
+ The -noalign
+ option still uses the alignment machinery of the formatter, but tells it to
+ reset its idea of the column boundaries after each declaration. The bad
+ side effect of this is that a declaration with a large initializier can be
+ formatted with the initializer snaking down the right side of the page.
+
+
+ If you have alignment on and a record has some fields with initializers,
+ but the last field has no initializer and no trailing semicolon and is
+ followed by a comment on the same line, then the other fields may be
+ aligned improperly. Fix this by adding a semicolon to the last field
+ declaration.
+
+
+ Bill Kalsow and Eric Muller (using the framework provided by ppmp).
+ David Nichols (Xerox PARC) and Jim Meehan (Adobe) made a large number of
+ improvements and bug fixes.
+ David Nichols added PostScript support, which Bill Schilit (Xerox PARC and
+ Columbia Univ.) ported into the current version.
+
+
+ The showheap program displays a map of the traced heap of running
+ Modula-3 program.
+
+
+ Normally, you should not start showheap directly. Rather, the runtime
+ will start showheap and feed it with the proper data when the argument
+ @M3showheap
+ is given to a Modula-3 program; for example, to
+ run the program foo and see the heap of that process, type:
+ A Trestle window will appear; when you
+ click the start button, the program foo will actually start.
+
+
+ The SRC Modula-3 garbage collector divides the traced heap into pages,
+ and showheap shows the status of each page controlled by the
+ collector. The page size is implementation-dependent. There are far
+ more possible page states than can be easily shown, but showheap
+ colorcodes page states as follows.
+
+
+ When a program use the showheap facility, a Trestle window is created
+ at the beginning of the execution. It shows on the right a map of the
+ traced heap; this map is a 2D matrix of squares, and each square
+ represents a page. Reading this matrix row by row, from left to
+ right, one finds all that pages in increasing order. Only the pages
+ from the first to the last page in the traced heap are displayed (the
+ other are non-heap pages).
+
+
+ Most pages can contain multiple objects; larger objects require
+ multiple pages, and those pages are shown as being connected.
+
+
+ On the left side of the window, there is legend of the hues used,
+ together with a count of pages in that state. The line "gc =
+ <number>" shows the number of garbage collections since the beginning
+ of the execution of the program. The line "off = <number>" is
+ non-zero iff collection is currently prohibited.
+
+
+
+
Index: m3/pm3/language/modula3/m3tools/showheap/src/m3makefile
diff -c m3/pm3/language/modula3/m3tools/showheap/src/m3makefile:1.2 m3/pm3/language/modula3/m3tools/showheap/src/m3makefile:1.3
*** m3/pm3/language/modula3/m3tools/showheap/src/m3makefile:1.2 Tue Jan 28 12:24:33 1997
--- m3/pm3/language/modula3/m3tools/showheap/src/m3makefile Tue Feb 10 22:58:47 1998
***************
*** 8,13 ****
--- 8,16 ----
import ("vbtkit")
implementation ("ShowHeap")
+
+ HtmlFile("index")
+
Program ("showheap")
ManPage ("showheap", 1)
Index: m3/pm3/language/modula3/m3tools/shownew/src/index.html
diff -c /dev/null m3/pm3/language/modula3/m3tools/shownew/src/index.html:1.2
*** /dev/null Tue Feb 10 23:31:52 1998
--- m3/pm3/language/modula3/m3tools/shownew/src/index.html Tue Feb 10 22:58:51 1998
***************
*** 0 ****
--- 1,36 ----
+
+
+ The shownew program displays a running record of the heap allocations
+ in a Modula-3 program.
+
+
+ Normally, you should not start shownew directly. Rather, the runtime
+ will start shownew and feed it with the proper data when the argument
+ @M3shownew is given to a Modula-3
+ program; for example, to
+ run the program foo and see the allocations of that process, type:
+ A Trestle window will appear; when you
+ click the start option in the control menu, the program foo will
+ actually start.
+
+
+ To set the interval between updates to X seconds, add the argument
+ @M3update=X to the command line.
+ X must be an integer. For example:
+
+ The showthread program displays the thread activity of a Modula-3 program.
+
+
+ Normally, you should not start showthread directly. Rather, the
+ runtime will start showthread and feed it with the proper
+ data when the argument
+ @M3showthread
+ is given to a Modula-3 program;
+ for example, to run the program foo and see the threads of that
+ process, type:
+ A Trestle window
+ will appear; when you click the start button, the program foo
+ will actually start.
+
+
+ Each thread in the program will be given a vertical track in the
+ showthread window, in which the successive states of the thread will
+ be displayed, using color patches. After the thread dies, the track can
+ be reused for another thread.
+
+
+ Each time the scheduler decides to stop the currently running thread and
+ makes a decision about what to do next, showthread will add a new row
+ of color patches to show the state of all the threads.
+
+
+ The legend in the showthread window indicates which color is used for which
+ state:
+ Tools for debugging, analysing and processing Modula-3 programs.
+
+ As Sam Harbison writes in his book,
+ Modula-3 is a member of
+ the Pascal family of languages. Designed in the late 1980s at Digital
+ Equipment Corporation and Olivetti, Modula-3 corrects many of the
+ deficiencies of Pascal and Modula-2 for practical software engineering.
+ In particular, Modula-3 keeps the simplicity of type safety of the
+ earlier languages, while providing new facilities for exception
+ handling, concurrency, object-oriented programming, and automatic
+ garbage collection. Modula-3 is both a practical implementation
+ language for large software projects and an excellent teaching
+ language.
+
+
+ Proponents of object-oriented programming claim that it provides
+ at least two benefits: code reuse and encapsulation. These
+ features, however, often conflict, as it is difficult to reuse
+ something that is hidden, and most statically typed, object-
+ oriented languages (those in which the type of expressions and
+ variables can be determined at compile time) require that
+ visibility and inheritance information be described early in the
+ class hierarchy. As experienced software writers know, it is hard
+ to predict from first principles how a class will eventually be
+ reused, so it is common to expose more features of a class than
+ necessary to avoid changing its definition once in use. If you
+ are not extremely careful, this approach increases the
+ dependencies on the initial implementation and makes the whole
+ system more brittle.
+
+ Modula-3 lets you control reuse with a degree of flexibility
+ uncommon in strongly typed languages. The key concept is that an
+ object type may be divided up into partial types, each of which
+ describes some aspect of the object. A source file may then
+ import, or reveal, only those aspects of an object relevant to
+ the task at hand. Thus, the parts of a system that depend on a
+ particular object feature can be isolated and found automatically
+ when a change is necessary.
+
+ In this article, I'll show how Modula-3's type system, with its
+ partial revelations, makes code reuse and encapsulation easier
+ compared to the statically typed, object-oriented languages. I'll then
+ work through an example showing the Modula-3 type system in use.
+
+
+ Statically typed, object-oriented languages generally support
+ encapsulation by distinguishing between public and private
+ features in a type, although there may also be intermediate
+ states. There is a hierarchy of access in which privileged code
+ can see the whole structure of an object but external code can
+ only see the public features; see Figure 1.
+
+
+
+ The problem with this approach is that it treats all users
+ of each level in the class the same way, and all-purpose code is
+ always difficult to write. The class designer must draw a fine
+ line in the class definition between exposing too little to be
+ useful and exposing too much to be safe. Even escape mechanisms
+ (such as the friend construct in C++) included in the visible
+ definition are liable to acquire dependencies. Once a design is
+ achieved, its details are embedded in every piece of code that
+ uses the type, so a change in a high-level class must be
+ propagated throughout a system; if the class is part of, say, a
+ commercial library, then users just have to live with the
+ designer's decisions. Class internals may not need to be accessed
+ frequently, but when they are, it is likely to be important, and
+ such prohibitions are doubly frustrating if the required features
+ are visible, but inaccessible, in the class definition.
+
+
+ I'll illustrate my point using the "many-to-one associations" example
+ in Object-Oriented Modelling and Design, by James Rumbaugh et al.
+ (Prentice-Hall, 1991), which shows two classes: Item and
+ Group. When an Item is added to a Group,
+ the Group object is updated to include the new Item
+ and the Item object is updated so that it refers to the
+ Group. The cross-reference attributes in both classes,
+ however, should be accessible only to the code that maintains the
+ association. If the attributes were freely available, they could be
+ updated separately, thus allowing inconsistencies.
+
+ Most statically typed languages have some mechanism for limited
+ relaxation of encapsulation. C++ has the friend construct,
+ whereby a class gives other classes or procedures access to its
+ private fields. Listing One (a) allows the
+ Group's add and remove methods to update both sides of the
+ association together when links are added or removed, as in Listing One (b).
+
+ Listing One (a)
+
+
+
+ The disadvantage of this approach is that the details of the
+ implementation, although protected from inconsistent access, are
+ specified in the class definition. This increases the cost of changing
+ a class once it is in use and limits the range of possible extensions.
+ For example, to adapt the library for multithreading, it might be
+ necessary to add a mutex to the Item class that is locked
+ while the group_ field is being set. Propagating a change in
+ a low-level class, such as Item, can require rebuilding large
+ amounts of code. Similarly, if you want to extend the Group
+ class so that, for example, changes in membership are logged, the
+ original author must have declared the add and remove methods as
+ virtual (that is, eligible to be overwritten in a subclass).
+ This approach constantly requires class designers to decide whether to
+ make a method virtual (and so more flexible) or not (and so more
+ efficient) before the class has been put to use.
+
+ To defer such decisions, it's common to define an abstract type (which
+ includes methods but no data fields) that describes what you can do
+ with it, not how it is implemented; see
+ Listing Two (a). You then write a
+ concrete subclass that has data fields (that is, state) and implements
+ the methods defined in the parent abstract type, as in
+ Listing Two (b). It's also common to
+ provide a function that you call to create new instances of the
+ object. Users see objects of the abstract parent type, but these are
+ actually implemented by objects of the concrete child.
+
+ Listing Two (a)
+
+
+
+ This isolates the users of a class from its implementation, but makes
+ reuse by inheritance difficult, as a subclass of the public
+ AbstractItem will not inherit from the private
+ ConcreteItem. Class designers may also use delegation, in
+ which the Item behavior is managed by an abstract object in
+ the public class to which the method calls are forwarded; see Listing Two (c).
+
+ Listing Two (c)
+
+ In addition, methods such as AddItem in the (public)
+ abstract classes must be defined in terms of other abstract
+ classes because the (private) concrete classes are invisible at
+ this level. This means that the implementations of these methods
+ must receive parameters as abstract types and cast them down to
+ their concrete subclass, which either requires an extra
+ consistency check or provides a potential source of pointer
+ errors.
+
+ Other languages are more flexible. Eiffel, for example, provides a
+ redefine keyword that allows a subclass to override any of
+ its ancestor's public methods--unlike C++, in which the ancestor class
+ must declare the methods that may be overridden. Eiffel, however, also
+ requires the ancestor class to declare which other classes can access
+ its private fields, so our Item class is defined as
+ Listing Three. Again, specifying exported
+ features in the class definition makes it more difficult to
+ restructure an installed library or program. Furthermore, the controls
+ can be overridden by defining a new subclass of GROUP to gain
+ arbitrary access to the ITEM internals.
+
+ Listing Three
+
+ Ada 95 also distinguishes between public and private features of a
+ type and uses its support for structured libraries to control access.
+ Briefly, an Ada program unit (or package) has a specification, divided
+ into visible and private sections, and a body. The logical interface
+ to a package, its abstract types and procedure declarations, is
+ defined in the visible section of the specification; this is what
+ clients of the package use. The implementation of a package is split
+ between the private section of the specification, which expands the
+ definitions of the data types, and the package body, which contains
+ the procedure code; the private section is accessible from the body,
+ but not from clients of the package. An Ada 95 specification of the
+ example might look like Listing Four.
+
+ Listing Four
+
+ Ada 95 supports hierarchies of packages. That is, given a package
+ parent, you can write a package parent.child to
+ extend it; the visible specification of the new package will inherit
+ the visible features of the parent. More importantly, the (private)
+ implementation of a child can see all the private features of its
+ ancestors, whereas the public interface to a child sees only the
+ ancestors' visible sections. The Ada 95 approach is a little like a
+ street of theaters: The public sees only what's on stage, while some
+ of the backstage crew have access to everything in the building. Each
+ theater (or library), however, is independent; the crew of one theater
+ is not allowed backstage next door, but can still buy tickets to see
+ the show. This approach supports the way software libraries are built
+ (or should be), but suffers from two limitations: first, the concrete
+ part of a data type is still held in the interface file, so it may be
+ difficult to predict what will need to be rebuilt when an
+ implementation changes; second, the package designer must still decide
+ exactly how it may be reused before it is put into service, so changes
+ to an installed library may be painful.
+
+ While it is possible to separate interface and implementation in most
+ statically typed OO languages, engineering such a design for long-term
+ reuse requires skill and experience because too many details must be
+ committed to too early. In Modula-3, programmers do not have to put
+ all the details of a class in a single place, yet the benefits of a
+ strong type system are retained. There are two main techniques:
+
+
+ Modula-3 is a statically typed, object-oriented language with single
+ inheritance, integrated threads, garbage collection and exception
+ handling, and separate interface and implementation files. To
+ illustrate basic Modula-3 concepts, I'll first rewrite the
+ Associations example in Listing Two. Listing Five is the interface file
+ Association.i3 (interface files define a namespace that can
+ contain type definitions and procedure and variable declarations, but
+ no implementation code). The IMPORT statement makes the
+ contents of another interface file available; here, I import the type
+ T from the interface List to define the value
+ returned from the items method of the Group object.
+ Modula-3 objects are records that may contain variables and methods;
+ here, of course, the abstract types have no variable fields because
+ these are only defined in the implementation.
+
+ Listing Five
+
+ The phrase "type1 <: type2" is an example of partial
+ revelation. It says that type1 is a subtype of type2
+ but that this is not the entire definition of type1; the rest will be
+ revealed in other places, possibly in other files. The
+ Association interface, for example, defines an Item
+ as a subtype of an AbstractItem, so it includes a
+ memberOf method, but provides no other information about its
+ features. The AbstractItem and AbstractGroup names
+ are not strictly necessary, but are introduced to save retyping the
+ object details in the implementation file Association.m3, as
+ in Listing Six.
+
+ Listing Six
+
+ The phrase "REVEAL type1=type2" provides more information about
+ the structure of type1. The use of "=" shows that
+ this is the final revelation in the declaration of an object type;
+ there can be multiple partial revelations about the structure of an
+ object. In this case, an Item object contains a group data
+ field, and the memberOf method has been overridden by the
+ procedure ItemMemberOf; in other words, I provide a concrete
+ implementation. The implementation is entirely hidden from the rest of
+ the library (it could be replaced by relinking the application with a
+ new implementation module), but you can still meaningfully subclass
+ from the Item and Group types in the
+ Association interface. For example, to add logging to the add
+ method of Group, write the subclass in
+ Listing Seven.
+
+ Listing Seven
+
+ With the addition of our new logging feature, the new
+ LogGroup object inherits all the hidden behavior of the
+ Association.Group object. This demonstrates subtyping the parent
+ type when not all is visible. The implementation of
+ Assocation.Group is entirely hidden behind its interface, so
+ program units that use the public type do not depend on its
+ private implementation. To subtype in this way in C++ or Eiffel,
+ for example, you would either have to write a concrete class that
+ exposes some implementation details or write a delegation class
+ that includes an abstract object to which method calls are
+ forwarded.
+
+
+ Class designers use partial revelation to split the definition of
+ an object type across multiple files, both interface and
+ implementation. A revelation in an interface is a mechanism for
+ access control; it makes some feature of an object accessible
+ wherever the interface is imported. A revelation in an
+ implementation, on the other hand, is a mechanism for
+ encapsulation; it is an addition to the object definition that is
+ visible only within that implementation.
+
+
+ Partial revelation really shines when used to support
+ sophisticated access control to the features of an object type.
+ To demonstrate this, I'll present an unreasonable extension of
+ the Association objects. We have a hypothetical new requirement
+ that Associations work with multiple threads, so the objects must
+ be protected against concurrent changes. We also want to allow a
+ thread to be notified when another thread has added a new item to
+ a group. This new requirement, however, says nothing about the
+ implementation of associations, so we can divide our new objects
+ into three aspects: The first deals with the data structures for
+ associating items and groups, the second deals with
+ multithreading issues and handles locking and notification, and
+ the third deals with class-wide code that is independent of
+ either of these specific issues. These aspects are independent of
+ each other, so a change of data structure need not affect the
+ locking scheme, and we can partition our object types to reflect
+ this.
+
+ The first interface (see Listing Eight)
+ provides opaque types; it reveals only that the objects have
+ identifiable types and the operations the objects respond to. This
+ interface is for normal clients who just want to use the types without
+ knowing about their implementation. Next, I define abstract types for
+ the item and group objects; any implementation must provide code for
+ the methods of the object types in Listing
+ Nine. This interface is similar to the original version in Listing Five, except that it now includes the
+ opaque types ItemPrivate and GroupPrivate; I'll
+ explain the purpose of these types shortly. Once the library is
+ installed, however, I might want to write the logging subtype from Listing Seven; I can do this with the
+ interfaces provided so far. If I import AssocClass, I know
+ that any group object includes an addItem method that I can override.
+ I can subclass knowing very little about the how the types are
+ implemented and pass the new type to the procedures in Association.
+ Note that, so far, the multithreading features of the objects are
+ completely invisible.
+
+ Listing Eight
+
+
+
+ The next stage is to provide an implementation of items and groups, so
+ I write an interface AssocImpl as a default version; see Listing Ten (a). The subtypes declared
+ here are still opaque, so a client knows only that they can be used
+ with the procedures declared in Associations. The module
+ AssocImpl.m3 in Listing Ten
+ (b) reveals more detail about these types--we are not defining a
+ further level of subtyping here, but adding more detail to an existing
+ type. This module reveals that the items are stored using a standard
+ Set.T type and provides implementations for the methods for
+ the Item and Group objects. For example, the
+ AddItem procedure in Listing
+ Ten (c) ensures that the Set field of the Group
+ object has been initialized and adds the new item to it. I don't need
+ to call the setGroup method of the item because, as you'll see below,
+ this will be done elsewhere.
+
+ Listing Ten (a)
+
+
+
+
+
+
+ More-sophisticated clients know that each call of a procedure in the
+ Association interface involves acquiring and freeing a lock,
+ which may be expensive. If they had access to an appropriate level of
+ detail, they could batch a set of calls within a single lock, rather
+ than locking each time; thus, the code in Listing Eleven (a) might change to
+ that in Listing Eleven (b). There's
+ also an explicit call to notify any other waiting threads that new
+ items have arrived, as this is also normally provided by
+ Association.AddItem. Clearly, programmers working at this
+ level must be more careful because they can no longer rely on the
+ implementation to ensure, for example, that a group is locked before
+ an item is added to it.
+
+
+
+
+ Modula-3 distinguishes between safe and unsafe program units; unsafe
+ interfaces and modules allow the programmer more freedom but provide
+ fewer guarantees that errors will be caught by compiler analysis of
+ the code. An unsafe interface may only be imported by unsafe modules
+ and other unsafe interfaces, but an unsafe module may implement a safe
+ interface--which is how Modula-3 provides safe access to external (and
+ so uncheckable) libraries. Modula-3 supports this controlled
+ relaxation of its type safety to help programmers isolate and identify
+ code that is "dangerous."
+
+ I have made the interface UnsafeAssoc unsafe because it
+ allows a programmer to bypass the thread-safe code provided through
+ the Association interface; this code is shown in Listing Twelve. UnsafeAssoc reveals
+ that both the item and group object types are derived from
+ MUTEX, a built-in mutual exclusion type, so any code that
+ imports this interface can lock item or group objects, as in Listing Eleven (b). The interface also
+ declares unsafe versions of the thread-safe procedures that implement
+ class-wide behavior. We know that these procedures are not concerned
+ with thread safety because item and group locking is done separately.
+ Data-structure management is defined in the AssocImpl module,
+ so the unsafe procedures have common behavior across all
+ implementations of Associations. I also use this interface to declare
+ a procedure that supports the notification of the arrival of new
+ items.
+
+ Listing Twelve
+
+ Now I can write the module Assocation.m3, which provides the
+ final revelations about the item and group types and implements the
+ procedures declared in Association and UnsafeAssoc.
+ Listing Thirteen (a) shows the
+ start of the module; the EXPORTS clause says that this module
+ implements, and automatically imports, those interfaces. Note that
+ Association and AssocClass are safe, whereas
+ UnsafeAssoc is not. The final revelations for the item and
+ group object types show that there is nothing more to say about item
+ objects, but that groups need some extra state that will be used for
+ the thread-specific code. Listing
+ Thirteen (b) shows the implementation of two procedures from the
+ UnsafeAssoc interface. NotifyNewItem simply sets the
+ last item variable and wakes up all the threads waiting on the group's
+ condition variable, while UnsafeAddItem adds the item to the
+ group and sets the group in the item. Finally, Listing Thirteen (c) shows the code
+ for two of the procedures in the Association interface; this
+ is where all the code associated with thread safety belongs.
+ AddItem provides a safe wrapper for the
+ UnsafeAddItem call, and NewItem blocks its calling
+ thread until a new item has been added to the group.
+
+
+
+
+
+ The Association example, although contrived, shows how
+ partial revelation can be used to partition an object type by
+ feature, rather than by the designer's conception of how it will
+ be used. Clients of the library can import just those features
+ they need, perhaps to reimplement the default implementation or
+ to optimize a set of calls. In this case, the object types were
+ divided into concerns about data structures, thread-safety, and
+ class-wide behavior. I can change each of these independently,
+ and Modula-3's import system makes dependencies on existing code
+ easy to find.
+
+
+ Partial revelation is a powerful technique for providing
+ controlled access to the features of an object type. A class
+ definition can be split into a set of distinct features made
+ accessible by importing interfaces. There is no hierarchy of
+ access imposed at the interface level, so each feature can be
+ imported independently into a program unit; see Figure 2. The
+ definitive structure of the type is then finally revealed in the
+ implementation.
+
+
+
+ The division of an object type can be based on its essential
+ features, rather than on the designer's expectations about its
+ use and implementation concerns. Furthermore, importing the
+ interface localizes the dependence on features of the supertype
+ and makes such dependencies easy to find automatically. When an
+ interface is intended for use within a library's implementation
+ but not by its clients, privacy can be achieved by controlling
+ access to the interface file.
+
+ Modula-3 reduces the tension between reuse and encapsulation
+ by allowing programmers to avoid embedding implementation details
+ in the visible definition of a class. A designer can concentrate
+ on extracting the essential features of a class, rather than
+ declaring in advance how it relates to other classes and
+ procedures. Users of a class can select only those features they
+ need and still reuse them by inheritance; the hidden parts of the
+ class are still available and can be revealed elsewhere in the
+ program. Partial revelation avoids the rigidity of a hierarchical
+ access system and provides inheritance with true encapsulation,
+ as opposed to simple access control, without the implementation
+ costs and risks of delegation.
+
+ The ability to import only the necessary features of a class
+ means that dependencies are limited to the code that uses them
+ and are made explicit when they occur. This reduces code
+ fragility and makes it easier to develop software-management
+ tools. Furthermore, Modula-3's distinction between safe and
+ unsafe program units highlights vulnerable code and provides
+ language support for multiple roles in a software team.
+
+ Of course, writing reusable objects is still hard and no language can
+ be a substitute for good ideas, but the right language can assist in
+ the their design and implementation. The many libraries available with
+ the Modula-3 distribution provide both models for how to write
+ well-structured software and a mine of reliable code for reuse.
+ There's an excellent discussion of how this technique was used for the
+ Modula-3 I/O library in Systems Programming with Modula-3, edited by
+ Greg Nelson (Prentice-Hall, 1991). "Adding Digital Video to an
+ Object-Oriented User Interface Toolkit," by Mark Manasse and myself
+ (Object-Oriented Programming, ECOOP 1994, Springer-Verlag, 1994),
+ describes how the type system helped during a major modification of
+ Trestle, the Modula-3 user interface toolkit. Modula-3 is freely
+ available for a wide range of platforms. Its home page is at http://www.research.digital.com/SRC/modula-3/html/home.html
+ and is available via anonymous ftp from gatekeeper.dec.com.
+ There is also a newsgroup comp.lang.modula3.
+
+ Modula-3's partial revelation, especially when combined with its
+ interface and module structure, provides a powerful and unusual tool
+ for managing the trade-off between reuse and encapsulation. It doesn't
+ impose the hierarchical approach to encapsulation of other statically
+ typed object-oriented languages, so there's less need either to
+ subvert the type system, or to increase code dependencies to achieve
+ the flexibility that any substantial library or application needs.
+ It's an effective programming-language technology that deserves to be
+ better known and widely used.
+
+
+ Many thanks to Farshad Nayeri for his generous help with this
+ article.
+
+
+ Steve is a Research Scientist at the Rank Xerox Research Centre in
+ Grenoble, France, working on the implementation of a rule-based
+ coordination language. He can be reached at sfreeman@pa.dec.com.
+
+
+ This article originally appeared in Dr.
+ Dobb's Journal, October 1995, Volume 20, Issue 10, pages 36-42 and
+ pages 110-112 (code listings). Thanks to the people at Dr. Dobb's
+ Journal for their gracious permission to publish it electronically. It
+ was translated to HTML by Allan
+ Heydon. The figures were redrawn from the article using Juno-2, a
+ constraint-based drawing editor.
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/acks.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/acks.html:1.1.1.1
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/acks.html Sat Jan 31 14:47:13 1998
***************
*** 0 ****
--- 1,59 ----
+
+
+
+
+ Modula-3 was designed by Luca Cardelli, Jim Donahue, Mick Jordan, Bill
+ Kalsow, and Greg Nelson, as a joint project by the Digital Equipment
+ Corporation Systems Research Center and the Olivetti Research Center.
+ Paul Rovner made many contributions as a founding member of the design
+ committee. The language specification was written by Lucille Glassman
+ and Greg Nelson, under the watchful supervision of the whole committee.
+
+ Maurice Wilkes had the inspiration that sparked the project.
+
+ Our technical starting point was Modula-2+, which was designed by Paul
+ Rovner, Roy Levin, John Wick, Andrew Birrell, Butler Lampson, and Garret
+ Swart. We made good use of the ruthlessly complete description of
+ Modula-2+ in Mary-Claire van Leunen's Modula-2+ User's Manual.
+ The ideas in the ``+'' part of Modula-2+ were mostly derived from the
+ Mesa and Cedar languages developed at Xerox PARC.
+
+ Niklaus Wirth designed Modula-2, the starting point of our starting
+ point. He also reviewed the evolving design and made many valuable
+ suggestions---not one of which was a suggested addition. Indeed, he
+ inspired us with the courage to pull out a number of deep-rooted weeds.
+
+ SRC Modula-3 was implemented by Bill Kalsow and Eric Muller. Olivetti
+ Modula-3 was implemented by Mick Jordan, Trevor Morris, David Chase,
+ Steve Glassman, and Marion Sturtevant.
+
+ The language and book were greatly improved by the helpful feedback
+ from Bob Ayers, Andrew Black, Regis Crelier, Dan Craft, Hans Eberle,
+ John Ellis, Stu Feldman, Michel Gangnet, Lucille Glassman, David
+ Goldberg, Stephen Harrison, Sam Harbison, Jim Horning, Solange Karsenty,
+ Mike Kupfer, Butler Lampson, Mark Manasse, Tim Mann, Eliot Moss, Dick
+ Orgass, Sharon Perl, Norman Ramsey, Lyle Ramshaw, Eric Roberts, Peter
+ Robinson, Ed Satterthwaite, Jorge Stolfi, Garret Swart, Chuck Thacker,
+ and Ken Zadeck.
+
+ We are grateful for the support of Digital Equipment Corporation in
+ general, and Bob Taylor and Sam Fuller in particular.
+
+
+
+
+ A procedure call is an expression if the procedure returns a result.
+ The type of the expression is the result type of the procedure.
+
+
+
+
+ The basic arithmetic operations are built into the language;
+ additional operations are provided by the required
+ floating-point interfaces.
+
+
+ To test or set the implementation's behavior for overflow, underflow,
+ rounding, and division by zero, see the required interface
+ FloatMode.
+ Modula-3 arithmetic was designed
+ to support the
+ IEEE floating-point
+ standard, but not to require it.
+
+
+ To perform arithmetic operations modulo the word size, programs should
+ use the routines in the required interface
+ Word.
+
+
+ Implementations must not rearrange the computation of expressions in
+ a way that could affect the result. For example, (x+y)+z
+ generally cannot be computed as x+(y+z), since addition is not
+ associative either for bounded integers or for floating-point values.
+
+
+
+ As a prefix operator, +x returns x.
+ As an infix operator on numeric arguments,
+ + denotes addition. On sets, + denotes set union.
+ That is,
+ e IN (x + y) if and only if (e IN x) OR (e IN y).
+ The types of x and y must be the same, and the result
+ is the same type as both.
+ In unsafe modules, + is extended to ADDRESS.
+
+
+
+ As a prefix operator, -x is the negative of x.
+ As an infix operator on numeric arguments, - denotes subtraction.
+ On sets, - denotes set difference.
+ That is, e IN (x - y) if and only if
+ (e IN x) AND NOT (e IN y).
+ The types of x and y must be the same, and the result
+ is the same type as both.
+ In unsafe modules, - is extended to ADDRESS.
+
+
+
+ On numeric arguments, * denotes multiplication.
+ On sets, * denotes intersection.
+ That is, e IN (x * y) if and only if (e IN x) AND (e IN y).
+ The types of x and y must be the same, and the result
+ is the same type as both.
+
+
+ On reals, / denotes division. On sets, / denotes
+ symmetric difference.
+ That is, e IN (x / y) if and only if (e IN x) # (e IN y).
+ The types of x and y must be the same, and the result
+ is the same type as both.
+
+
+ The value x DIV y is the floor of
+ the quotient of x and y; that is, the maximum integer
+ not exceeding the real number z such that z * y = x.
+ For integers x and y, the value of x MOD y is
+ defined to be x - y * (x DIV y).
+
+
+ This means that for positive y, the value of x MOD y
+ lies in the interval [0 .. y-1], regardless of
+ the sign of x. For negative y, the value of
+ x MOD y lies in the interval [y+1 .. 0], regardless
+ of the sign of x.
+
+
+ If x and y are floats, the value of x MOD y is
+ x - y * FLOOR(x / y). This may be computed as a Modula-3
+ expression, or by a method that avoids overflow if x is much
+ greater than y. The types of x and y must
+ be the same, and the result is the same type as both.
+
+
+ ABS(x) is the absolute value of x.
+ If x is a float,
+ the type of ABS(x) is the same as the type of x.
+
+
+ FLOAT(x, T) is a floating-point value of type T
+ that is equal to or very near x.
+ The type T must be a floating-point type;
+ it defaults to REAL. The exact semantics depend on the
+ thread's current rounding mode, as defined in the required interface
+ FloatMode.
+
+
+ FLOOR(x) is the greatest integer not exceeding x.
+ CEILING(x) is the least integer not less than x.
+
+
+ ROUND(r) is the nearest integer to r; ties are broken
+ according to the constant RoundDefault in the required interface
+ FloatMode.
+ TRUNC(r) rounds r toward zero; it equals
+ FLOOR(r) for positive r and CEILING(r) for
+ negative r.
+
+
+ MAX returns the greater of the two values x and y;
+ MIN returns the lesser. If x and y are ordinals,
+ they must have the same base type, which is the type of the result.
+ If x and y are floats, they must have the same type, and
+ the result is the same type as both.
+
+
+
+
+ An array is an indexed collection of component variables,
+ called the elements of the array. The indexes are the values of
+ an ordinal type, called the index type of the array. The elements
+ all have the same size and the same type, called the element type
+ of the array.
+
+
+ There
+ are two kinds of array types, fixed and open. The
+ length of a fixed array is determined at compile time. The length
+ of an open array type is determined at runtime, when it is allocated
+ or bound. The length cannot be changed thereafter.
+
+
+ The
+ shape of a multi-dimensional array is the sequence of its
+ lengths in each dimension. More precisely, the shape of an array
+ is its length followed by the shape of any of its elements; the shape
+ of a non-array is the empty sequence.
+
+
+ Arrays
+ are assignable if they have the same element type and shape.
+ If either the source or target of the assignment is an open array,
+ a runtime shape check is required.
+
+
+ A
+ fixed array type declaration has the form:
+ where Index is an ordinal type and Element is any type other
+ than an open array type. The values of type T are arrays whose
+ element type is Element and whose length is the number of elements
+ of the type Index.
+
+
+ If
+ a has type T, then a[i] designates the element
+ of a whose position corresponds to the position of i
+ in Index. For example, consider the declarations:
+ Now a = b is TRUE;
+ yet a[1] = 1.0 while b[1] = 3.0.
+ The interpretation of indexes is determined by an array's
+ type, not its value; the assignment b := a changes b's
+ value, not its type. (This example uses
+ variable initialization,
+ and
+ array constructors.)
+
+
+ An
+ expression of the form:
+ is shorthand for:
+
+
+ This shorthand is eliminated from the expanded type definition
+ used to define structural equivalence. An expression of the form
+ a[i_1, ..., i_n]
+ is shorthand for a[i_1]...[i_n].
+
+
+ An
+ open array type declaration has the form:
+ where Element is any type. The values of T are arrays
+ whose element type is Element and whose length is arbitrary.
+ The index type of an open array is the integer subrange
+ [0..n-1], where n is the length of the array.
+
+
+ An open array type can be used only as the type of a formal parameter,
+ the referent of a reference type, the element type of another open
+ array type, or as the type in an array constructor.
+
+
+ Examples of array types:
+
+
+ To specify the typechecking of assignment statements we need to define
+ "assignable", which is a relation between types and types, between
+ expressions and variables, and between expressions and types.
+
+
+ A type T is assignable to a type U if:
+
+
+ An
+ expression e is assignable to a variable v if:
+
+
+ The
+ first point can be checked statically; the others generally require
+ runtime checks. Since there is no way to determine statically whether
+ the value of a procedure parameter is local or global, assigning
+ a local procedure is a runtime rather than a static error.
+
+
+ An expression e is assignable to a type T
+ if e is assignable to some variable of type T.
+ (If T is not an open array type, this is the same as saying
+ that e is assignable to any variable of type T.)
+
+
+ An
+ assignment statement has the form:
+ where v is a writable designator and e is an expression
+ assignable to the variable designated by v. The statement sets
+ v to the value of e. The order of evaluation of
+ v and e is undefined, but e will be evaluated before
+ v is updated.
+ In particular, if v and e are overlapping
+ subarrays,
+ the assignment is performed in such a way that no element is used
+ as a target before it is used as a source.
+
+
+ Examples of assignments:
+
+
+ The
+ same comments would apply if x had an ordinal type with
+ non-overlapping subranges a and b, or if x had
+ an object type and a and b had incompatible subtypes.
+ The type ADDRESS is treated differently from other reference
+ types, since a runtime check cannot be performed on the assignment
+ of raw addresses. For example:
+
+
+
+ Luca Cardelli was an undergraduate in Pisa and has a Ph.D. in Computer
+ Science from the University of Edinburgh (1982). He worked at AT&T
+ Bell Labs, Murray Hill, from 1982 to 1985 before assuming his current
+ position at DEC SRC. His main interests are in constructive logic,
+ type theory, and language design and implementation.
+
+
+ Jim Donahue received his Ph.D. in Computer Science at the University
+ of Toronto (1975). He was an Assistant Professor at Cornell University
+ from 1975 to 1981. In 1981, he joined the Computer Science Laboratory
+ of the Xerox Palo Alto Research Center. In 1986, he established the
+ Olivetti Research Center and was its Director until 1990. He is now
+ a Senior Scientist and Product Manager for Teknekron Software Systems.
+ His interests include programming language design, distributed system
+ design, and database systems and applications.
+
+
+ Lucille Glassman is a technical writer for DEC SRC.
+
+
+ Mick Jordan has a Ph.D. in Computer Science from the University of
+ Cambridge. From 1984 to 1988 he worked at the Acorn Research Center
+ in Palo Alto on a programming environment for Modula-2+. Before joining
+ DEC SRC in 1990 he was at Olivetti Research, where he led the group
+ that produced the Olivetti Modula-3 implementation. His principal
+ current interest is in programming tools that are based on Modula-3
+ Abstract Syntax Trees.
+
+
+ Bill Kalsow received his Ph.D. in Computer Science from the University
+ of Wisconsin at Madison (1986). Since then he has worked as DEC SRC.
+ His primary interests are programming languages and their
+ implementations.
+
+
+ Greg Nelson got his Ph.D. from Stanford in 1980, where he worked on
+ program verification and algorithms for mechanical theorem proving.
+ He was the author of the Juno constraint-based graphics system at Xerox
+ PARC's Computer Science Laboratory, has taught at Princeton University,
+ and is now a member of DEC SRC. Currently his active interests are
+ window systems, programming language design, and the semantic theory
+ of guarded commands.
+
+
+
+
+ A block statement has the form:
+ where Decls is a sequence of declarations and S
+ is a statement.
+ The block introduces the constants, types, variables,
+ and procedures declared in Decls and then executes S.
+ The scope of the
+ declared names
+ is the block.
+
+
+
+
+ NOT p is the complement of p.
+
+
+ p AND q is TRUE if both p and q
+ are TRUE.
+ If p is FALSE, q is not evaluated.
+
+
+ p OR q is TRUE if at least one of p and q
+ is TRUE.
+ If p is TRUE, q is not evaluated.
+
+
+
+
+ The language predeclares the two types:
+ which represent text strings and mutual exclusion semaphores,
+ respectively. These are
+ opaque types.
+ Their properties are specified in
+ the required interfaces
+ Text
+ and
+ Thread.
+
+
+
+
+ A procedure call has the form:
+ where P is a procedure-valued expression and Bindings
+ is a list of keyword or positional bindings. A keyword
+ binding has the form name := actual, where actual is
+ an expression and name is an identifier. A positional binding
+ has the form actual, where actual is an expression.
+ When keyword and positional bindings are mixed in a call, the
+ positional bindings must precede the keyword bindings. If the list
+ of bindings is empty, the parentheses are still required.
+
+
+ The
+ list of bindings is rewritten to fit the signature of P's
+ type as follows: First, each positional binding actual is
+ converted and added to the list of keyword bindings by supplying the
+ name of the i'th formal parameter, where actual is the
+ i'th binding in Bindings. Second, for each parameter that
+ has a default and is not bound after the first step,
+ the binding name := default is added to the list of bindings,
+ where name
+ is the name of the parameter and default is its default value.
+ The rewritten list of bindings must bind only formal parameters and
+ must bind each formal parameter exactly once.
+ For example, suppose that the type of P is
+ Then the following calls are all equivalent:
+ The call P() is illegal, since it doesn't bind
+ ch. The call P(n := 0, 'a') is illegal, since it has
+ a keyword parameter before a positional parameter.
+
+
+ For
+ a READONLY or VALUE parameter, the actual can be
+ any expression assignable to the type of the formal (except that
+ the prohibition against assigning local procedures is relaxed). For
+ a VAR parameter, the actual must be a
+ writable designator whose
+ type is the same as that of the formal, or, in case of a VAR
+ array parameter, assignable to that of the formal.
+
+
+ A
+ VAR formal is bound to the variable designated by the
+ corresponding actual; that is, it is aliased. A VALUE formal
+ is bound to a variable with an unused location and initialized to
+ the value of the corresponding actual. A READONLY formal is
+ treated as a VAR formal if the actual is a designator and the
+ type of the actual is the same as the type of the formal (or an array
+ type that is assignable to the type of the formal); otherwise
+ it is treated as a VALUE formal.
+
+
+ Implementations
+ are allowed to forbid VAR or READONLY
+ parameters of packed types.
+
+
+ To
+ execute the call, the procedure P and its arguments are
+ evaluated, the formal parameters are bound, and the body of the
+ procedure is executed. The order of evaluation of P and its
+ actual arguments is undefined. It is a checked runtime error to
+ call an undefined or NIL procedure.
+
+
+ It
+ is a checked runtime error for a procedure to raise an exception
+ not included in its raises set (If an implementation
+ maps this runtime error into an exception, the exception is implicitly
+ included in all RAISES clauses.) or for a function procedure
+ to fail to return a result.
+
+
+ A procedure call is a statement only if the procedure is proper. To
+ call a function procedure and discard its result, use
+ EVAL.
+
+
+ A
+ procedure call can also have the form:
+ where o is an object and m names one of
+ o's methods. This is equivalent to:
+
+
+ A CASE statement has the form:
+ where Expr is an expression whose type is an ordinal type and
+ each L is a list of constant expressions or ranges of constant
+ expressions denoted by "e_1..e_2", which represent
+ the values from e_1 to e_2 inclusive. If
+ e_1 exceeds e_2, the range is empty. It is a static
+ error if the sets represented by any two L's overlap or if
+ the value of any of the constant expressions is not a member of the
+ type of Expr. The "ELSE S_0" is optional.
+
+
+ The
+ statement evaluates Expr. If the resulting value is in any
+ L_i, then S_i is executed. If the value is
+ in no L_i and "ELSE S_0" is present, then it is executed.
+ If the value is in no L_i and "ELSE S_0" is absent,
+ a checked runtime error occurs.
+
+
+
+
+ If id is an identifier, T a type,
+ and C a constant expression, then:
+ declares id as a constant with the type T and the value
+ of C. The ": T" can be omitted, in which case the type
+ of id is the type of C. If T is present it must
+ contain C.
+
+
+
+ Constant expressions are a subset of the general class of expressions,
+ restricted by the requirement that it be possible to evaluate the
+ expression statically. All operations are legal in constant expressions
+ except for ADR, LOOPHOLE, TYPECODE, NARROW,
+ ISTYPE, SUBARRAY, NEW, dereferencing (explicit or
+ implicit), and the only procedures that can be applied are the functions
+ in the
+ Word interface.
+
+
+ A variable can appear in a constant expression only as an argument
+ to FIRST, LAST, NUMBER, BITSIZE,
+ BYTESIZE, or ADRSIZE, and such a variable must not
+ have an open array type.
+ Literals and top-level procedure constants are legal in constant
+ expressions.
+
+
+
+
+ A set constructor has the form:
+ where S is a set type and the e's are expressions or ranges
+ of the form lo..hi. The constructor denotes a value of type
+ S containing the listed values and the values in the listed ranges.
+ The e's, lo's, and hi's must be assignable
+ to the element type of S.
+
+
+ An
+ array constructor has the form:
+ where A is an array type and the e's are expressions.
+ The constructor denotes a value of type A containing the listed
+ elements in the listed order. The e's must be assignable to
+ the element type of A. This means that if A is a
+ multi-dimensional array, the e's must themselves be array-valued
+ expressions.
+
+
+ If A is a fixed array type and n is at least 1, then
+ e_n can be followed by ", .." to indicate that the
+ value of e_n will be replicated as many times as necessary
+ to fill out the array. It is a static error to provide too many or
+ too few elements for a fixed array type.
+
+
+ A
+ record constructor has the form:
+ where R is a record type and Bindings is a list of keyword
+ or positional bindings, exactly as in a
+ procedure call.
+ The list of bindings is rewritten to fit the list of fields and defaults
+ of R, exactly as for a procedure call; the record field names
+ play the role of the procedure formal parameters. The expression
+ denotes a value of type R whose field values are specified by
+ the rewritten binding.
+
+
+ The rewritten binding must bind only field names and must bind each field
+ name exactly once. Each expression in the binding must be assignable
+ to the type of the corresponding record field.
+
+
+
+ To describe the argument and result types of operations,
+ we use a notation like procedure signatures. But since most operations
+ are too general to be described by a true procedure signature, we
+ extend the notation in several ways.
+
+
+ The argument to an operation can be required to have a type in a particular
+ class, such as an ordinal type, set type, etc. In this case the formal
+ specifies a type class instead of a type. For example:
+ The formal type Any specifies an argument of any type.
+
+
+ A
+ single operation name can be overloaded, which means that it denotes
+ more than one operation. In this case, we write a separate signature
+ for each of the operations. For example:
+ The particular operation will be selected so that each actual argument
+ type is a subtype of the corresponding formal type or a member
+ of the corresponding formal type class.
+
+
+ The argument to an operation can be an expression denoting a type.
+ In this case, we write Type as the argument type. For example:
+ The result type of an operation can depend on its argument values
+ (although the result type can always be determined statically). In
+ this case, the expression for the result type contains the
+ appropriate arguments.
+ For example:
+ IndexType(T) denotes the index type of the array type
+ T and IndexType(a) denotes the index type of the array
+ a. The definitions of ElemType(T) and ElemType(a)
+ are similar.
+
+
+
+
+
+ There are two basic methods of declaring high or low before the showdown
+ in all High-Low Poker games. They are (1) simultaneous declarations,
+ and (2) consecutive declarations .... It is a sad but true fact that
+ the consecutive method spoils the game.
+ ---John Scarne's Guide to Modern Poker
+
+
+ A
+ declaration introduces a name for a constant, type, variable, exception,
+ or procedure. The scope of the name is the block containing the
+ declaration. A block has the form:
+ where
+ Decls is a sequence of declarations and S is a
+ statement, the executable part of the block. A block can appear as
+ a statement or as the body of a module or procedure. The declarations
+ of a block can introduce a name at most once, though a name can be
+ redeclared in nested blocks, and a procedure declared in an interface
+ can be redeclared in a
+ module
+ exporting the interface.
+ The order of declarations
+ in a block does not matter, except to determine the order of
+ initialization of variables.
+
+
+ Each type of declaration is described below
+
+
+ A
+ Modula-3 program specifies a computation that acts on a sequence
+ of digital components called locations. A variable is a set
+ of locations that represents a mathematical value according to a
+ convention determined by the variable's type. If a value can
+ be represented by some variable of type T, then we say that
+ the value is a member of T and T contains
+ the value.
+
+
+ An
+ identifier is a symbol declared as a name for a variable, type,
+ procedure, etc. The region of the program over which a declaration
+ applies is called the scope of the declaration. Scopes can be
+ nested. The meaning of an identifier is determined by the smallest
+ enclosing scope in which the identifier is declared.
+
+
+ An
+ expression specifies a computation that produces a value
+ or variable. Expressions that produce variables are called
+ designators. A designator can denote either a variable or the value
+ of that variable, depending on the context. Some designators are
+ readonly, which means that they cannot be used in contexts that might
+ change the value of the variable. A designator that is not readonly
+ is called writable. Expressions
+ whose values can be determined statically are called constant
+ expressions; they are never designators.
+
+
+ A
+ static error is an error that the implementation must detect
+ before program execution. Violations of the language definition
+ are static errors unless they are explicitly classified as runtime
+ errors.
+
+
+ A
+ checked runtime error is an error that the implementation
+ must detect and report at runtime. The method for reporting such
+ errors is implementation-dependent. (If the implementation maps
+ them into exceptions, then a program could handle these exceptions
+ and continue.)
+
+
+ An
+ unchecked runtime error is an error that is not guaranteed
+ to be detected, and can cause the subsequent behavior of the
+ computation to be arbitrary. Unchecked runtime errors can occur
+ only in unsafe modules.
+
+
+
+
+ An identifier is a writable designator
+ if it is declared as a variable,
+ is a VAR or VALUE parameter,
+ is a local of a TYPECASE
+ or TRY EXCEPT statement,
+ or is a WITH local that is bound to a writable designator.
+ An identifier is a readonly designator if it is
+ a READONLY parameter,
+ a local of a FOR statement,
+ or a WITH local bound to a non-designator or
+ readonly designator.
+
+
+ The
+ only operations that produce designators are dereferencing,
+ subscripting, selection, and SUBARRAY.
+ This section defines these operations and specifies the conditions
+ under which they produce designators.
+ In unsafe modules,
+ LOOPHOLE
+ can also produce a designator.
+
+
+ r^
+ denotes the the referent of
+ r; this operation is called dereferencing. The
+ expression r^ is always a writable designator. It is a
+ static error if the type of r is REFANY,
+ ADDRESS, NULL, an object type, or an opaque type,
+ and a checked runtime error if r is NIL.
+ The type of r^ is the referent type of r.
+
+
+ a[i]
+ denotes the (i + 1 - FIRST(a))-th element of the
+ array a. The expression a[i] is a designator
+ if a is, and is writable if a is.
+ The expression i
+ must be assignable to the index type of a. The type of
+ a[i] is the element type of a.
+
+
+ An expression of the form a[i_1, ..., i_n] is
+ shorthand for a[i_1]...[i_n]. If a is a reference
+ to an array, then a[i] is shorthand for a^[i].
+
+
+ r.f, o.f, I.x, T.m, E.id
+ If r denotes a record,
+ r.f denotes its f field. In
+ this case r.f is a designator if r is,
+ and is writable if r is.
+ The type of r.f is the declared type of the field.
+
+
+ If r is a reference to a record,
+ then r.f is shorthand for r^.f.
+
+
+ If o denotes an object and f
+ names a data field specified
+ in the type of o, then o.f denotes
+ that data field of o. In this case o.f is a writable
+ designator whose type is the declared type of the field.
+
+
+ If I denotes an imported interface, then I.x denotes
+ the entity named x in the interface I. In this case
+ I.x is a designator if x is declared as a variable;
+ such a designator is always writable.
+
+
+ If T is an object type and m
+ is the name of one of
+ T's methods, then T.m denotes the m method of
+ type T. In this case T.m is not a designator. Its type
+ is the procedure type whose first argument has mode VALUE
+ and type T, and whose remaining arguments are determined by
+ the method declaration for m in T. The name of the first
+ argument is unspecified; thus in calls to T.m, this argument
+ must be given positionally, not by keyword. T.m is a
+ procedure constant.
+
+
+ If E is an enumerated type,
+ then E.id denotes its
+ value named id. In this case E.id is not a designator.
+ The type of E.id is E.
+
+
+
+ SUBARRAY(a: Array; from, for: CARDINAL): ARRAY OF ElemType(a)
+
+ SUBARRAY produces a subarray of a. It does not copy the
+ array; it is a designator if a is, and is writable if a
+ is. If a is a multi-dimensional array, SUBARRAY applies
+ only to the top-level array.
+
+
+ The operation returns the subarray that skips the
+ first from
+ elements of a and contains the next for elements. Note
+ that if from is zero, the subarray is a prefix of a,
+ whether the type of a is zero-based or not. It is a checked
+ runtime error if from+for exceeds NUMBER(a).
+
+
+ Implementations may restrict
+ or prohibit the SUBARRAY operation for arrays with packed
+ element types.
+
+
+ An EVAL statement has the form:
+ where e is an expression. The effect is to evaluate e and
+ ignore the result. For example:
+
+
+ Here is the canonical example of a public stack with hidden representation:
+
+
+ If the representation of stacks is required in more than one module,
+ it should be moved to a private interface, so that it can be imported
+ wherever it is required:
+
+
+
+
+ If id is an identifier and T a type other than
+ an open array type, then:
+ declares id as an exception with argument type T.
+ If "(T)" is omitted, the exception takes no argument.
+ An exception declaration is allowed only in an interface or in the
+ outermost scope of a module.
+ All declared exceptions are distinct.
+
+
+
+ The statement
+ raises the exit-exception. An EXIT statement must be textually
+ enclosed by a
+ LOOP,
+ WHILE,
+ REPEAT,
+ or
+ FOR
+ statement.
+
+
+ We
+ define EXIT and RETURN in terms of exceptions in order
+ to specify their interaction with the exception handling statements.
+ As a pathological example, consider the following code, which is an
+ elaborate infinite loop:
+
+
+
+ The rules of logical syntax must follow of themselves,
+ if we only know how every single sign signifies.
+ ---Ludwig Wittgenstein
+
+
+ An
+ expression prescribes a computation that produces a value or
+ variable. Syntactically, an expression is either an operand, or an
+ operation applied to arguments, which are themselves expressions.
+ Operands are identifiers, literals, or types. An expression is
+ evaluated by recursively evaluating its arguments and performing
+ the operation. The order of argument evaluation is undefined for
+ all operations except AND and OR.
+
+
+ The following topics are discussed below
+
+
+ For definitions of the terms used in these interfaces, see the ANSI/IEEE
+ Standard 754-1985 for floating-point arithmetic.
+
+
+ These interfaces define operations that depend on the
+ floating-point representation. They are all are instances of a generic
+ interface Float:
+ This generic interface provides access to the floating-point operations
+ required or recommended by the IEEE floating-point standard. Consult
+ the standard for the precise specifications of the procedures,
+ including when their arguments are NaNs, infinities, and signed
+ zeros, and including what exceptions they can raise. The comments
+ here specify their effect when the arguments are ordinary numbers
+ and no exception is raised. Implementations on non-IEEE machines
+ that have values similar to NaNs and infinities should explain how
+ those values behave in an implementation guide.
+
+
+ Return x * 2^n.
+
+ Return the exponent of x. More precisely, return the unique
+ n such that the ratio ABS(x) / Base^n is in the range
+ [1..Base-1], unless x is denormalized, in which case
+ return the minimum exponent value for T.
+
+
+ Like Logb, but returns an integer, never raises an exception,
+ and always returns the n such that ABS(x) / Base^n is
+ in the range [1..Base-1], even for denormalized numbers.
+
+
+ Return the next representable neighbor of x in the direction
+ towards y. If x = y, return x.
+
+
+ Return x with the sign of y.
+
+ Return TRUE if x is strictly between minus infinity and
+ plus infinity. This always returns TRUE on non-IEEE machines.
+
+ Return FALSE if x represents a numerical
+ (possibly infinite) value,
+ and TRUE if x does not represent a numerical value.
+ For example, on IEEE implementations,
+ returns TRUE if x is a NaN,
+ FALSE otherwise.
+
+ Return the sign bit of x. For non-IEEE implementations,
+ this is the same as ORD(x >= 0); for IEEE implementations,
+ Sign(-0) = 1 and Sign(+0) = 0.
+
+ Return (x < y OR y < x). Thus, for IEEE implementations,
+ Differs(NaN,x) is always FALSE;
+ for non-IEEE implementations,
+ Differs(x,y) is the same as x # y.
+
+ Return NOT (x <= y OR y <= x).
+
+ Return the square root of T. This must be correctly rounded if
+ FloatMode.IEEE is TRUE.
+
+ Return the IEEE number class containing x.
+
+
+
+ The FloatMode interface allows you to test the behavior
+ of rounding and of numerical exceptions. On some implementations it
+ also allows you to change the behavior, on a per-thread basis.
+
+
+ For definitions of the terms used in this interface, see the ANSI/IEEE
+ Standard 754-1985 for floating-point arithmetic.
+
+
+ TRUE for fully-compliant IEEE implementations.
+
+ Raised by attempts to set modes that are not supported by
+ the implementation.
+
+ Rounding modes. The first four are the IEEE modes.
+
+ Implementation-dependent: the default mode for rounding arithmetic
+ operations, used by a newly forked thread. This also specifies
+ the behavior of the ROUND operation in half-way cases.
+
+ Change the rounding mode for the calling thread to md, or raise
+ the exception if this cannot be done. This affects the implicit
+ rounding in floating-point operations; it does not affect the
+ ROUND operation. Generally this can be done only on IEEE
+ implementations and only if md is an IEEE mode.
+
+ Return the rounding mode for the calling thread.
+
+ Associated with each thread is a set of boolean status flags recording
+ whether the condition represented by the flag has occurred in the
+ thread since the flag was last reset. The meaning of the first
+ five flags is defined precisely in the IEEE floating point standard;
+ roughly they mean:
+ Invalid = invalid argument to an operation.
+
+
+ Inexact = an operation produced an inexact result.
+
+
+ Overflow = a floating-point operation produced a result whose
+ absolute value is too large to be represented.
+
+
+ Underflow = a floating-point operation produced a result whose
+ absolute value is too small to be represented.
+
+
+ DivByZero = floating-point division by zero.
+
+
+
+ The meaning of the last two flags is:
+ IntOverflow = an integer operation produced a result whose
+ absolute value is too large to be represented.
+
+
+ IntDivByZero = integer DIV or MOD by zero.
+
+
+ Return the set of flags for the current thread.
+
+ Set the flags for the current thread to s, and return their previous
+ values.
+
+ Turn off the flag f for the current thread.
+
+ The behavior of an operation that causes one of the flag conditions is either
+ Ignore = return some result and do nothing.
+
+
+ SetFlag = return some result and set the condition
+ flag. For IEEE implementations, the result of the operation is defined
+ by the standard.
+
+
+
+ Trap = possibly set the condition flag; in any case
+ raise the Trap exception with the appropriate flag as the
+ argument.
+ Set the behavior of the current thread for the flag f
+ to be b, or raise Failure if this cannot be done.
+
+ Return the behavior of the current thread for the flag f.
+
+
+
+
+
+ There are three floating point types, which in order of increasing
+ range and precision are REAL, LONGREAL,
+ and EXTENDED.
+ The properties of these types are specified by
+ required interfaces.
+
+
+
+
+ A FOR statement has the form:
+ where id is an identifier, first and last are
+ ordinal expressions with the same base type,
+ step is an integer-valued expression, and S is a statement.
+ "BY step" is optional; if omitted, step defaults to
+ 1.
+
+
+ The identifier id denotes a readonly variable whose scope is
+ S and whose type is the common basetype of first and
+ last.
+
+
+ If id is an integer, the statement steps id through the
+ values first, first+step, first+2*step,
+ ..., stopping when the value of id passes last.
+ S executes once for each value; if the sequence of values is
+ empty, S never executes. The expressions first,
+ last, and step are evaluated once,
+ before the loop is entered.
+ If step is negative, the loop iterates downward.
+
+
+ The case in which id is an element of an enumeration is similar.
+ In either case, the semantics are defined precisely by the following
+ rewriting, in which T is the type of id and in which
+ i, done, and delta stand for variables that do
+ not occur in the FOR statement:
+
+
+ If the upper bound of the loop is LAST(INTEGER), it should be
+ rewritten as a WHILE loop to avoid overflow.
+
+
+
+
+ In a generic interface or module, some of the imported interface names
+ are treated as formal parameters, to be bound to actual interfaces
+ when the generic is instantiated.
+
+
+ A generic interface has the form
+ where G is an identifier that names the generic interface,
+ F_1, ..., F_n is a list of identifiers, called
+ the formal imports of G, and Body is a sequence of imports
+ followed by a sequence of declarations, exactly as in a non-generic
+ interface.
+
+
+ An instance of G has the form
+ where I is the name of the instance and A_1, ...,
+ A_n is a list of actual interfaces to which the formal imports
+ of G are bound. The instance I is equivalent to an ordinary
+ interface defined as follows:
+
+
+ A
+ generic module has the form
+ where G is an identifier that names the generic module,
+ F_1, ..., F_n is a list of identifiers, called
+ the formal imports of G, and Body is a sequence of imports
+ followed by a block, exactly as in a non-generic module.
+
+
+ An instance of G has the form
+ where I is the name of the instance,
+ E is a list of interfaces exported
+ by I, and A_1, ...,
+ A_n is a list of actual interfaces to which the formal
+ imports of G are bound.
+ "EXPORTS E" can be omitted, in which case
+ it defaults to "EXPORTS I".
+ The instance I is equivalent
+ to an ordinary module defined as follows:
+ Notice that the generic module itself has no exports; they are supplied
+ only when it is instantiated.
+
+
+ For
+ example, here is a generic stack package:
+ To instantiate these generics to produce stacks of integers:
+ Implementations are not expected to share code between different
+ instances of a generic module, since this will not be possible in
+ general.
+
+
+ Implementations are not required to typecheck uninstantiated generics,
+ but they must typecheck their instances. For example, if one made
+ the following mistake:
+ everything would go well until the last line, when the compiler would
+ attempt to compile a version of Stack in which the element type
+ was an open array. It would then complain that the NEW call
+ in Push does not have enough parameters.
+
+
+
+
+ An IF statement has the form:
+
+
+ where the B's are boolean expressions and the S's are
+ statements. The "ELSE S_0" and each
+ "ELSIF B_i THEN S_i" are optional.
+
+
+ The statement evaluates the B's in order until some
+ B_i evaluates to TRUE, and then executes S_i.
+ If none of the expressions evaluates to TRUE and
+ "ELSE S_0" is present, S_0 is executed.
+ If none of the expressions evaluates
+ to TRUE and "ELSE S_0" is absent, the statement
+ is a no-op (except for any side-effects of the B's).
+
+
+
+
+ There are two forms of import statements. All imports of both forms
+ are interpreted simultaneously: their order doesn't matter.
+
+
+
+ The first form is
+
+ which imports the interface whose global name is I and gives
+ it the local name J. The entities and revelations declared in
+ I become accessible in the importing module or interface, but
+ the entities and revelations imported into I do not. To refer
+ to the entity declared with name N in the interface I,
+ the importer must use the qualified identifier J.N.
+
+
+ The statement IMPORT I is short for IMPORT I AS I.
+
+
+ The
+ second form is
+ which introduces N as the local name for the entity declared
+ as N in the interface I.
+ A local binding for I takes
+ precedence over a global binding.
+ For example,
+ simultaneously introduces local names J, I, and N
+ for the entities whose global names are I, J,
+ and J.N, respectively.
+
+
+ It is illegal to use the same local name twice:
+ is a static error, even if J and K are the same.
+
+
+
+ INC and DEC statements have the form:
+ where v designates a variable of an ordinal type
+ and n is an optional integer-valued argument. If omitted,
+ n defaults to 1. The statements increment and decrement
+ v by n, respectively.
+ The statements are equivalent to:
+ where T is the type of v and x stands for
+ a variable that does not appear in n. As a
+ consequence, the statements check for range errors.
+
+
+ In unsafe modules,
+ INC and DEC are extended to ADDRESS.
+
+
+
+
+ The order of execution of the modules in a program is constrained by
+ the following rule:
+
+
+ If module M depends on module N and N
+ does not depend on M, then N's body will be
+ executed before M's body,
+ where:
+
+
+ Except for this constraint, the order of execution is
+ implementation-dependent.
+
+
+
+
+ An interface has the form:
+ where id is an identifier that names the interface,
+ Imports is a sequence of import statements, and Decls is
+ a sequence of declarations that contains no procedure bodies or
+ non-constant variable initializations. The names declared in
+ Decls and the visible imported names must be distinct. It is a static
+ error for two or more interfaces to form an import cycle.
+
+
+ C++ has a host of operators that will be explained if and where needed.
+ ---The C++ Programming Language
+
+
+ There
+ are several fundamental interfaces that every
+ Modula-3 implementation must provide:
+ Text provides operations
+ on text strings.
+
+
+ Thread provides synchronization
+ primitives for multiple threads of control.
+
+
+ Word provides operations on
+ unsigned words.
+
+
+ Real, LongReal,
+ and ExtendedReal
+ define the properties of the three floating point types;
+ for example, their bases and ranges.
+
+
+ RealFloat, LongFloat,
+ and ExtendedFloat
+ provide numerical operations related to the
+ floating-point representation; for example, extracting the exponent
+ of a number.
+
+
+ FloatMode provides operations
+ for testing (and possibly setting) the behavior of the implementation
+ in response to numeric conditions; for example, overflow.
+
+
+ Implementations are free to extend the required interfaces, provided
+ they do not invalidate clients of the unextended interfaces.
+
+
+ He that will not apply new remedies must expect new evils: for time is
+ the greatest innovator, and if time of course alter things to the
+ worse, and wisdom and counsel shall not alter them to the better, what
+ shall be the end?
+ ---Francis Bacon
+
+
+
+
+ On November 6th, 1986, Maurice Wilkes wrote to Niklaus Wirth proposing
+ that the Modula-2+ language be revised and standardized as a successor
+ to Modula-2. Wirth gave this project his blessing, and the Modula-3
+ committee was born.
+
+
+ At the first meeting, the committee unanimously agreed to be true to
+ the spirit of Modula-2 by selecting simple, safe, proven features rather
+ than experimenting with our own untried ideas. We found that unanimity
+ was harder to achieve when we got to the details.
+
+
+ Modula-3
+ supports interfaces, objects, generics, lightweight threads
+ of control, the isolation of unsafe code, garbage collection,
+ exceptions, and subtyping. Some of the more problematical features
+ of Modula-2 have been removed, like variant records and the built-in
+ unsigned numeric data type. Modula-3 is substantially simpler than other
+ languages with comparable power.
+
+
+ Modula-3
+ is closely based on Modula-2+, which was designed at the
+ Digital Equipment Corporation Systems Research Center and used to build
+ the Topaz system
+ [McJones89,
+ Rovner86].
+ The Modula-3 design was
+ a joint project by Digital and Olivetti. The language definition was
+ published in August 1988, and immediately followed by implementation
+ efforts at both companies. In January 1989, the committee revised
+ the language to reflect the experiences of these implementation teams.
+ A few final revisions were made for the publication of this book.
+
+
+ SRC Modula-3
+ is distributed by the DEC Systems Research Center under a liberal license.
+ The distribution
+ includes a compiler for Modula-3, the Modula-3 Abstract Syntax Tree
+ toolkit developed at Olivetti, and a runtime system with configuration
+ files for DEC, IBM, HP, and Sun workstations.
+
+
+
+
+ Most systems programming today is done in the BCPL family of languages,
+ which includes B, Bliss, and C. The beauty of these languages is the
+ modest cost with which they were able to take a great leap
+ forward from assembly language. To fully appreciate them, you must
+ consider the engineering constraints of machines in the 1960s. What
+ language designed in the 1980s has a compiler that fits into four
+ thousand 18-bit words, like Ken Thompson's B compiler for the PDP-7?
+ The most successful of these languages was C, which by the early 1970s
+ had almost completely displaced assembly language in the Unix system.
+
+
+ The BCPL-like languages are easy
+ to implement efficiently for the same reason they are attractive to
+ skeptical assembly language programmers: they present a programming
+ model that is close to the target machine. Pointers are identified
+ with arrays, and address arithmetic is ubiquitous. Unfortunately, this
+ low-level programming model is inherently dangerous. Many errors are
+ as disastrous as they would be in machine language. The type system
+ is scanty, and reveals enough quirks of the target machine that even
+ experienced and disciplined programmers sometimes write unportable
+ code simply by accident. The most modern language in this family,
+ C++, has enriched C by adding objects; but it has also given up C's
+ best virtue---simplicity---without relieving C's worst drawback---its
+ low-level programming model.
+
+
+ At
+ the other extreme are languages like Lisp, ML, Smalltalk, and CLU,
+ whose programming models originate from mathematics. Lisp is the hybrid
+ of the lambda calculus and the theory of a pairing function; ML stems
+ from polymorphic type theory; Smalltalk from a theory of objects and
+ inheritance; CLU from a theory of abstract data types. These languages
+ have beautiful programming models, but they tend to be difficult to
+ implement efficiently, because the uniform treatment of values in the
+ programming model invites a runtime system in which values are uniformly
+ represented by pointers. If the implementer doesn't take steps to
+ avoid it, as simple a statement as n := n + 1 could require an
+ allocation, a method lookup, or both. Good implementations avoid
+ most of the cost, and languages in this family have been used
+ successfully for systems programming. But their general disposition
+ towards heap allocation rather than stack allocation remains, and they
+ have not become popular with systems programmers. The runtime systems
+ required to make these languages efficient often isolate them in closed
+ environments that cannot accommodate programs written in other
+ languages. If you are a fan of these languages you may find Modula-3
+ overly pragmatic; but read on anyway, and give us a chance to show
+ that pragmatic constraints do not exclude attractive solutions.
+
+
+ Between
+ the extremes of BCPL and Lisp is the Algol family of languages,
+ whose modern representatives include Pascal, Ada, Modula-2, and
+ Modula-3. These languages have programming models that reflect the
+ engineering constraints of random-access machines but conceal the
+ details of any particular machine. They give up the beauty and
+ mathematical symmetry of the Lisp family in order to make efficient
+ implementations possible without special tricks; they also have strong
+ type systems that avoid most of the dangerous and machine-dependent
+ features of the BCPL family.
+
+
+ In
+ the 1960s, the trend in the Algol family was toward features for
+ control flow and data structuring. In the 1970s, the trend was toward
+ information-hiding features like interfaces, opaque types, and generics.
+ More recently, the trend in the Algol family has been to adopt a careful
+ selection of techniques from the Lisp and BCPL families. This trend
+ is demonstrated by Modula-3, Oberon, and Cedar, to name three languages
+ that have floated portable implementations in the last few years.
+
+
+ Modula-3, Oberon, and Cedar all provide garbage collection, previously
+ viewed as a luxury available only in the closed runtime systems of
+ the Lisp family. But the world is starting to understand that garbage
+ collection is the only way to achieve an adequate level of safety,
+ and that modern garbage collectors can work in open runtime
+ environments.
+
+
+ At the same time, these three languages allow a small set of unsafe,
+ machine-dependent operations of the sort usually associated with the
+ BCPL family. In Modula-3, unsafe operations are allowed only in modules
+ explicitly labeled unsafe. The combination of garbage collection with
+ the explicit isolation of unsafe features produces a language suitable
+ for programming entire systems from the highest-level applications
+ down to the lowest-level device drivers.
+
+
+
+
+ The remainder of the introduction is an overview of the most important
+ features of Modula-3.
+
+
+
+ One of Modula-2's most successful features is the provision for explicit
+ interfaces between modules. Interfaces are retained with essentially
+ no changes in Modula-3. An interface to a module is a collection of
+ declarations that reveal the public parts of a module; things in the
+ module that are not declared in the interface are private. A module
+ imports the interfaces it depends on and exports the
+ interface (or, in Modula-3, the interfaces) that it implements.
+
+
+ Interfaces make separate compilation type-safe; but it does them an
+ injustice to look at them in such a limited way. Interfaces make it
+ possible to think about large systems without holding the whole system
+ in your head at once.
+
+
+ Programmers who have never used Modula-style interfaces tend to
+ underestimate them, observing, for example, that anything that can
+ be done with interfaces can also be done with C-style include files.
+ This misses the point: many things can be done with include files that
+ cannot be done with interfaces. For example, the meaning of an include
+ file can be changed by defining macros in the environment into which
+ it is included. Include files tempt programmers into shortcuts across
+ abstraction boundaries. To keep large programs well structured, you
+ either need super-human will power, or proper language support for
+ interfaces.
+
+
+
+
+ THe better we understand our programs, the bigger the building blocks
+ we use to structure them. After the instruction came the statement,
+ after the statement came the procedure, after the procedure came the
+ interface. The next step seems to be the abstract type.
+
+
+ At
+ the theoretical level, an abstract type is a type defined by the
+ specifications of its operations instead of by the representation of
+ its data. As realized in modern programming languages, a value of
+ an abstract type is represented by an "object" whose operations are
+ implemented by a suite of procedure values called the object's
+ "methods". A new object type can be defined as a subtype of
+ an existing type, in which case the new type has all the methods of
+ the old type, and possibly new ones as well (inheritance). The new
+ type can provide new implementations for the old methods (overriding).
+
+
+ Objects were invented in the mid-sixties by the farsighted designers
+ of Simula
+ [Birtwistle].
+ Objects in Modula-3 are very much like
+ objects in Simula: they are always references, they have both data
+ fields and methods, and they have single inheritance but not multiple
+ inheritance.
+
+
+ Small examples are often used to get across the basic idea: truck as
+ a subtype of vehicle; rectangle as a subtype of polygon. Modula-3
+ aims at larger systems that illustrate how object types provide
+ structure for large programs. In Modula-3 the main design
+ effort is concentrated into specifying the properties of a single
+ abstract type---a stream of characters, a window on the screen. Then
+ dozens of interfaces and modules are coded that provide useful subtypes
+ of the central abstraction. The abstract type provides the blueprint
+ for a whole family of interfaces and modules. If the central
+ abstraction is well-designed then useful subtypes can be produced
+ easily, and the original design cost will be repaid with interest.
+
+
+ The
+ combination of object types with Modula-2 opaque types produces
+ something new: the partially opaque type, where some of an
+ object's fields are visible in a scope and others are hidden. Because
+ the committee had no experience with partially opaque types, the first
+ version of Modula-3 restricted them severely; but after a year of
+ experience it was clear that they were a good thing, and the language
+ was revised to remove the restrictions.
+
+
+ It is possible to use object-oriented techniques even in languages
+ that were not designed to support them, by explicitly allocating the
+ data records and method suites. This approach works reasonably smoothly
+ when there are no subtypes; however it is through subtyping that
+ object-oriented techniques offer the most leverage. The approach works
+ badly when subtyping is needed: either you allocate the data records
+ for the different parts of the object individually (which is expensive
+ and notationally cumbersome) or you must rely on unchecked type
+ transfers, which is unsafe. Whichever approach is taken, the subtype
+ relations are all in the programmer's head: only with an object-oriented
+ language is it possible to get object-oriented static typechecking.
+
+
+
+
+ A generic module is a template in which some of the imported interfaces
+ are regarded as formal parameters, to be bound to actual interfaces
+ when the generic is instantiated. For example, a generic hash table
+ module could be instantiated to produce tables of integers, tables
+ of text strings, or tables of any desired type. The different generic
+ instances are compiled independently: the source program is reused,
+ but the compiled code will generally be different for different
+ instances.
+
+
+ To keep Modula-3 generics simple, they are confined to the module level:
+ generic procedures and types do not exist in isolation, and generic
+ parameters must be entire interfaces.
+
+
+ In the same spirit of simplicity, there is no separate typechecking
+ associated with generics. Implementations are expected to expand the
+ generic and typecheck the result. The alternative would be to invent
+ a polymorphic type system flexible enough to express the constraints
+ on the parameter interfaces that are necessary in order for the generic
+ body to compile. This has been achieved for ML and CLU, but it has
+ not yet been achieved satisfactorily in the Algol family of languages,
+ where the type systems are less uniform. (The rules associated with
+ Ada generics are too complicated for our taste.)
+
+
+
+
+ Dividing a computation into concurrent processes (or threads of control)
+ is a fundamental method of separating concerns. For example, suppose
+ you are programming a terminal emulator with a blinking cursor: the
+ most satisfactory way to separate the cursor blinking code from the
+ rest of the program is to make it a separate thread. Or suppose you
+ are augmenting a program with a new module that communicates over a
+ buffered channel. Without threads, the rest of the program will be
+ blocked whenever the new module blocks on its buffer, and conversely,
+ the new module will be unable to service the buffer whenever any other
+ part of the program blocks. If this is unacceptable (as it almost
+ always is) there is no way to add the new module without finding and
+ modifying every statement of the program that might block. These
+ modifications destroy the structure of the program by introducing
+ undesirable dependencies between what would otherwise be independent
+ modules.
+
+
+ The
+ provisions for threads in Modula-2 are weak, amounting essentially
+ to coroutines. Hoare's monitors
+ [Hoare]
+ are a sounder basis for
+ concurrent programming. Monitors were used in Mesa, where they worked
+ well; except that the requirement that a monitored data structure be
+ an entire module was irksome. For example, it is often useful for
+ a monitored data structure to be an object instead of a module. Mesa
+ relaxed this requirement, made a slight change in the details of the
+ semantics of Hoare's Signal primitive, and introduced the
+ Broadcast primitive as a convenience
+ [Lampson].
+ The Mesa primitives were simplified in the Modula-2+ design, and the result
+ was successful enough to be incorporated with no substantial changes
+ in Modula-3.
+
+
+ A
+ threads package is a tool with a very sharp edge. A common
+ programming error is to access a shared variable without obtaining
+ the necessary lock. This introduces a race condition that can lie
+ dormant throughout testing and strike after the program is shipped.
+ Theoretical work on process algebra has raised hopes that the rendezvous
+ model of concurrency may be safer than the shared memory model, but
+ the experience with Ada, which adopted the rendezvous, lends at best
+ equivocal support for this hope---Ada still allows shared variables,
+ and apparently they are widely used.
+
+
+
+
+ A language feature is unsafe if its misuse can corrupt the runtime
+ system so that further execution of the program is not faithful to
+ the language semantics. An example of an unsafe feature is array
+ assignment without bounds checking: if the index is out of bounds,
+ then an arbitrary location can be clobbered and the address space can
+ become fatally corrupted. An error in a safe program can cause the
+ computation to abort with a run-time error message or to give the wrong
+ answer, but it can't cause the computation to crash in a rubble of
+ bits.
+
+
+ Safe programs can share the same address space, each safe from
+ corruption by errors in the others. To get similar protection for
+ unsafe programs requires placing them in separate address spaces. As
+ large address spaces become available, and programmers use them to
+ produce tightly-coupled applications, safety becomes more and more
+ important.
+
+
+ Unfortunately, it is generally impossible to program the lowest levels of
+ a system with complete safety. Neither the compiler nor the runtime
+ system can check the validity of a bus address for an I/O controller,
+ nor can they limit the ensuing havoc if it is invalid. This presents
+ the language designer with a dilemma. If he holds out for safety,
+ then low level code will have to be programmed in another language.
+ But if he adopts unsafe features, then his safety guarantee becomes
+ void everywhere.
+
+
+ The languages of the BCPL family are full of unsafe features;
+ the languages of the Lisp family generally have none (or none that
+ are documented). In this area Modula-3 follows the lead of Cedar by
+ adopting a small number of unsafe features
+ that are allowed only in
+ modules explicitly labeled unsafe. In a safe module, the compiler
+ prevents any errors that could corrupt the runtime system; in an unsafe
+ module, it is the programmer's responsibility to avoid them.
+
+
+
+
+ A classic unsafe runtime error is to free a data structure that is
+ still reachable by active references (or "dangling pointers"). The
+ error plants a time bomb that explodes later, when the storage is
+ reused. If on the other hand the programmer fails to free records
+ that have become unreachable, the result will be a "storage leak"
+ and the computation space will grow without bound. Problems due to
+ dangling pointers and storage leaks tend to persist long after other
+ errors have been found and removed. The only sure way to avoid
+ these problems is the automatic freeing of unreachable storage, or
+ garbage collection.
+
+
+ Modula-3 therefore provides "traced references", which are like
+ Modula-2 pointers except that the storage they point to is kept in
+ the "traced heap" where it will be freed automatically when all
+ references to it are gone.
+
+
+ Another great benefit of garbage collection is that it simplifies
+ interfaces. Without garbage collection, an interface must specify
+ whether the client or the implementation has the responsibility for
+ freeing each allocated reference, and the conditions under which it
+ is safe to do so. This can swamp the interface in complexity. For
+ example, Modula-3 supports text strings by a simple required interface
+ Text, rather than with a built-in type. Without garbage
+ collection, this approach would not be nearly as attractive.
+
+
+ New refinements in garbage collection have appeared continually for
+ more than twenty years, but it is still difficult to implement
+ efficiently. For many programs, the programming time saved by
+ simplifying interfaces and eliminating storage leaks and dangling
+ pointers makes garbage collection a bargain, but the lowest levels
+ of a system may not be able to afford it. For example, in SRC's Topaz
+ system, the part of the operating system that manages files and
+ heavy-weight processes relies on garbage collection, but the inner
+ "nub" that implements virtual memory and thread context switching
+ does not. Essentially all Topaz application programs rely on garbage
+ collection.
+
+
+ For programs that cannot afford garbage collection, Modula-3 provides
+ a set of reference types that are not traced by the garbage collector.
+ In most other respects, traced and untraced references behave
+ identically.
+
+
+
+
+ An exception is a control construct that exits many scopes at once.
+ Raising an exception exits active scopes repeatedly until a handler
+ is found for the exception, and transfers control to the handler. If
+ there is no handler, the computation terminates in some system-dependent
+ way---for example, by entering the debugger.
+
+
+ There are many arguments for and against exceptions, most of which
+ revolve around inconclusive issues of style and taste. One argument
+ in their favor that has the weight of experience behind it is that
+ exceptions are a good way to handle any runtime error that is usually,
+ but not necessarily, fatal. If exceptions are not available, each
+ procedure that might encounter a runtime error must return an additional
+ code to the caller to identify whether an error has occurred. This
+ can be clumsy, and has the practical drawback that even careful
+ programmers may inadvertently omit the test for the error return code.
+ The frequency with which returned error codes are ignored has become
+ something of a standing joke in the Unix/C world. Raising an exception
+ is more robust, since it stops the program unless there is an explicit
+ handler for it.
+
+
+
+
+ Like all languages in the Algol family, Modula-3 is strongly typed.
+ The basic idea of strong typing is to partition the value space into
+ types, restrict variables to hold values of a single type, and restrict
+ operations to apply to operands of fixed types. In actuality, strong
+ typing is rarely so simple. For example, each of the following
+ complications is present in at least one language of the Algol family:
+ a variable of type [0..9] may be safely assigned to an
+ INTEGER, but not vice-versa (subtyping). Operations like absolute
+ value may apply both to REALs and to INTEGERs instead of
+ to a single type (overloading). The types of literals (for example,
+ NIL) can be ambiguous. The type of an expression may be
+ determined by how it is used (target-typing). Type mismatches may
+ cause automatic conversions instead of errors (as when a fractional
+ real is rounded upon assignment to an integer).
+
+
+ We adopted several principles in order to make Modula-3's type system
+ as uniform as possible. First, there are no ambiguous types or
+ target-typing: the type of every expression is determined by its
+ subexpressions, not by its use. Second, there are no automatic
+ conversions. In some cases the representation of a value changes
+ when it is assigned (for example, when assigning to a packed field
+ of a record type) but the abstract value itself is transferred without
+ change. Third, the rules for type compatibility are defined in terms
+ of a single subtype relation. The subtype relation is required for
+ treating objects with inheritance, but it is also useful for defining
+ the type compatibility rules for conventional types.
+
+
+
+
+ In the early days of the Ada project, a general in the Ada Program
+ Office opined that "obviously the Department of Defense is not
+ interested in an artificially simplified language such as Pascal".
+ Modula-3 represents the opposite point of view. We used every artifice
+ that we could find or invent to make the language simple.
+
+
+ C. A. R. Hoare has suggested that as a rule of thumb a language is
+ too complicated if it can't be described precisely and readably in
+ fifty pages. The Modula-3 committee elevated this to a design
+ principle: we gave ourselves a "complexity budget" of fifty pages,
+ and chose the most useful features that we could accommodate within
+ this budget. In the end, we were over budget by six lines plus the
+ syntax equations. This policy is a bit arbitrary, but there are so
+ many good ideas in programming language design that some kind of
+ arbitrary budget seems necessary to keep a language from getting too
+ complicated.
+
+
+ In retrospect, the features that made the cut were directed toward
+ two main goals. Interfaces, objects, generics, and threads provide
+ fundamental patterns of abstraction that help to structure large
+ programs. The isolation of unsafe code, garbage collection, and
+ exceptions help make programs safer and more robust. Of the techniques
+ that we used to keep the language internally consistent, the most
+ important was the definition of a clean type system based on a subtype
+ relation. There is no special novelty in any one of these features
+ individually, but there is simplicity and power in their combination.
+
+
+
+
+ A LOCK statement has the form:
+ where S is a statement and mu is an expression.
+ It is equivalent to:
+ where m stands for a variable that does not occur in S.
+
+
+
+
+ A statement of the form:
+ repeatedly executes S until it raises the exit-exception.
+ Informally it is like:
+
+
+
+ The language designer should be familiar with many alternative
+ features designed by others, and should have excellent judgment in
+ choosing the best and rejecting any that are mutually inconsistent...
+ One thing he should not do is to include untried ideas of his own.
+ His task is consolidation, not innovation.
+ ---C.A.R. Hoare
+
+
+ The original definition of Modula-3 was given in
+ SRC Research Report 31,
+ August 1988.
+ It was revised in
+ report 52,
+ November 1989.
+ And finally published in
+ Systems Programming with Modula-3, November 1989.
+ This edition of the language definition is derived from all of the above.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A module has the form:
+ where id is an identifier that names the module, Interfaces
+ is a list of distinct names of interfaces exported by the module,
+ Imports is a list of import statements, and Block is
+ a block, the body of the module. The name id must be
+ repeated after the END that terminates the body.
+ "EXPORTS Interfaces" can be omitted,
+ in which case Interfaces defaults
+ to id.
+
+
+ If
+ module M exports interface I, then all declared names
+ in I are visible without qualification in M. Any
+ procedure declared in I can be redeclared in M, with
+ a body. The signature in M must be
+ covered by the signature
+ in I.
+ To determine the interpretation of keyword
+ bindings and parameter defaults in calls to the procedure, the
+ signature in M is used within M; the signature in
+ I is used everywhere else.
+
+
+ Except for the redeclaration of exported procedures, the names declared
+ at the top level of Block, the visible imported names, and
+ the names declared in the exported interfaces must be distinct.
+
+
+ For example, the following is illegal, since two names in exported
+ interfaces coincide:
+
+
+ The following is also illegal, since the visible imported name
+ X coincides with the top-level name X:
+
+
+ But
+ the following is legal, although peculiar:
+
+
+ since the only visible imported name is I, and the coincidence
+ between X as a top-level name and X as a name in an
+ exported interface is allowed, assuming the interface signature covers
+ the module signature. Within M, the interface declaration
+ determines the signature of I.X and the module declaration
+ determines the signature of X.
+
+
+
+ An allocation operation has the form:
+ where T is a reference type other than REFANY,
+ ADDRESS, or NULL. The operation returns the address of a
+ newly-allocated variable of T's referent type; or if T
+ is an object type, a newly-allocated data record paired with a method
+ suite. The reference returned by NEW is distinct from all
+ existing references. The allocated type of the new reference is T.
+
+
+ It is a static error if T's referent type is empty.
+ If T is declared as an opaque type,
+ NEW(T) is legal only in scopes
+ where T's concrete type is known completely,
+ or is known to be an object type.
+
+
+ The initial state of the referent generally represents an arbitrary
+ value of its type. If T is an object type or a reference to
+ a record or open array then NEW takes additional arguments
+ to control the initial state of the new variable.
+
+
+ If
+ T is a reference to an array with k open dimensions, the
+ NEW operation has the form:
+ where the n's are integer-valued expressions that specify the
+ lengths of the new array in its first k dimensions. The values in
+ the array will be arbitrary values of their type.
+
+
+ If
+ T is an object type or a reference to a record, the NEW
+ operation has the form:
+ where Bindings is a list of keyword bindings used to initialize
+ the new fields. Positional bindings are not allowed.
+
+
+ Each binding f := v initializes the field f to the value
+ v. Fields for which no binding is supplied will be initialized
+ to their
+ defaults
+ if they have defaults; otherwise they will be
+ initialized to arbitrary values of their types.
+
+
+ The order of the field bindings makes no difference.
+
+
+ If T is an object type then Bindings can also include
+ method overrides of the form m := P, where m is a method
+ of T and P is a top-level procedure constant. This is
+ syntactic sugar for the allocation of a subtype of T that includes
+ the given overrides, in the given order.
+ For example, NEW(T, m := P) is sugar for
+
+
+ The literal "NIL" denotes the value NIL.
+ Its type is NULL.
+
+
+
+
+ Numeric literals denote constant non-negative integers or reals.
+ The types of these literals are INTEGER, REAL,
+ LONGREAL, and EXTENDED.
+
+
+ A literal INTEGER has the form base_digits,
+ where base
+ is one of "2", "3", ..., "16", and digits
+ is a non-empty sequence of the decimal digits 0 through
+ 9 plus the hexadecimal digits A through F.
+ The "base_" can be omitted,
+ in which case base defaults to 10.
+ The digits are interpreted in the given base.
+ Each digit must be less than base.
+ For example, 16_FF and 255
+ are equivalent integer literals.
+
+
+ If no explicit base is present, the value of the literal must be at
+ most LAST(INTEGER). If an explicit base is present, the value
+ of the literal must be less than 2^Word.Size,
+ and its interpretation uses the convention of the
+ Word interface.
+ For example, on a sixteen-bit two's complement machine,
+ 16_FFFF and -1 represent the same value.
+
+
+ A
+ literal REAL has the form decimal E exponent, where
+ decimal is a non-empty sequence of decimal digits followed
+ by a decimal point followed by a non-empty sequence of decimal digits, and
+ exponent is a non-empty sequence of decimal digits optionally
+ beginning with a + or -.
+ The literal denotes decimal
+ times 10^exponent.
+ If "E exponent" is omitted,
+ exponent defaults to 0.
+
+
+ LONGREAL and EXTENDED
+ literals are like REAL literals,
+ but instead of E they use D and X respectively.
+
+
+ Case
+ is not significant in digits, prefixes or scale factors. Embedded
+ spaces are not allowed.
+
+
+ For example, 1.0 and 0.5 are valid, 1.
+ and .5 are not;
+ 6.624E-27 is a REAL,
+ and 3.1415926535d0 a LONGREAL.
+
+
+
+
+ An object is either NIL or a reference to a data
+ record paired with a method suite, which is a record of procedures that will
+ accept the object as a first argument.
+
+
+ An object type determines the types of a prefix of the fields of the
+ data record, as if "OBJECT" were "REF RECORD". But
+ in the case of an object type, the data record can contain additional fields
+ introduced by subtypes of the object type. Similarly, the object type
+ determines a prefix of the method suite, but the suite can contain
+ additional methods introduced by subtypes.
+
+
+ If
+ o is an object, then o.f designates the data field named
+ f in o's data record.
+ If m is one of o's methods,
+ an invocation of the form
+ o.m( ... )
+ denotes an execution of o's m method.
+ An object's methods can be invoked, but not read or written.
+
+
+ If T is an object type and m is the name of one of
+ T's methods, then T.m denotes T's m method.
+ This notation makes it convenient for a subtype method to invoke
+ the corresponding method of one of its supertypes.
+
+
+ A
+ field or method in a subtype masks any field or method with the
+ same name in the supertype. To access such a masked field, use
+ NARROW to view the subtype variable as a member of the supertype,
+ as illustrated below.
+
+
+ Object assignment is reference assignment. Objects cannot be
+ dereferenced, since the static type of an object variable does not determine
+ the type of its data record. To copy the data record of one object
+ into another, the fields must be assigned individually.
+
+
+ There
+ are two predeclared object types:
+
+
+ The
+ declaration of an object type has the form:
+ where ST is an optional supertype, Fields is a list of
+ field declarations, exactly as in a record type, Methods is a
+ list of method declarations and Overrides is a list of
+ method overrides. The fields of T consist of the fields
+ of ST followed by the fields declared in Fields.
+ The methods of T consist of the methods of ST modified by
+ Overrides and followed by the methods declared in Methods.
+ T has the same reference class as ST.
+
+
+ The names introduced in Fields and Methods must be distinct
+ from one another and from the names overridden in Overrides.
+ If ST is omitted, it defaults to ROOT. If ST is
+ untraced, then the fields must not include traced types.
+ (This restriction is lifted in unsafe modules.)
+ If ST is declared as an
+ opaque type,
+ the declaration of T is legal only in scopes where
+ ST's concrete type is known to be an object type.
+
+
+ The
+ keyword OBJECT can optionally be preceded by "BRANDED"
+ or by "BRANDED b", where b is a text constant. The meaning
+ is the same as in non-object reference types.
+
+
+ A
+ method declaration has the form:
+ where m is an identifier, sig is a procedure signature,
+ and proc is a top-level procedure constant. It specifies that
+ T's m method has signature sig
+ and value proc.
+ If ":= proc" is omitted, ":= NIL" is assumed.
+ If proc is non-nil, its first parameter must have mode
+ VALUE and
+ type some supertype of T, and dropping its first parameter must
+ result in a signature that is covered by sig.
+
+
+ A
+ method override has the form:
+ where m is the name of a method of the supertype ST and
+ proc is a top-level procedure constant. It specifies that the
+ m method for T is proc, rather than ST.m.
+ If proc is non-nil,
+ its first parameter must have mode VALUE and type some supertype
+ of T, and dropping its first parameter must result in a signature
+ that is covered by the signature of ST's m method.
+
+
+ Examples. Consider the following declarations:
+ The procedures Pa and Pab are candidate values for
+ the p
+ methods of objects of types A and AB. For example:
+ declares a type with an AB data record and a p method
+ that expects an AB.
+ T1 is a valid subtype of AB. Similarly,
+ declares a type with an A data record and a method that expects
+ an A. T2 is a valid subtype of A. A more
+ interesting example is:
+ which declares a type with an AB data record and a p method
+ that expects an A. Since every AB is an A,
+ the method is not too choosy for the objects in which it will be placed.
+ T3 is a valid subtype of AB. In contrast,
+ attempts to declare a type with an A data record and a method
+ that expects an AB; since not every A is an AB,
+ the method is too choosy for the objects in which it would
+ be placed. The declaration of T4 is a static error.
+
+
+ The following example illustrates the difference between declaring
+ a new method and overriding an existing method.
+ After the declarations
+ we have that
+ So far there is no difference between overriding and extending. But
+ c's method suite has two methods, while b's has only one,
+ as can be revealed if b and c are viewed as members of
+ type A:
+ Here NARROW is used to view a variable of a subtype as a value
+ of its supertype.
+ It is more often used for the opposite purpose, when it requires a
+ runtime check.
+
+
+ The last example uses object subtyping to define reusable queues. First
+ the interface:
+
+
+ Then an example client:
+
+
+ Passing x to Insert is safe,
+ since every IntQueueElem is a QueueElem.
+ Assigning the result of Delete to x cannot be
+ guaranteed valid at compile-time, since other subtypes
+ of QueueElem can be inserted into q, but the assignment
+ will produce a checked runtime error if the source value is not a member
+ of the target type. Thus IntQueueElem bears the same relation
+ to QueueElem as [0..9] bears to INTEGER.
+
+
+
+
+ An opaque type is a name that denotes an unknown subtype of some
+ given reference type. For example, an opaque subtype of REFANY is
+ an unknown traced reference type; an opaque subtype of
+ UNTRACED ROOT
+ is an unknown untraced object type. The actual type denoted by an
+ opaque type name is called its concrete type.
+
+
+ Different scopes can reveal different information about an opaque type.
+ For example, what is known in one scope only to be a subtype of REFANY
+ could be known in another scope to be a subtype of ROOT.
+
+
+ An opaque type declaration has the form:
+ where T is an identifier and U an expression denoting a
+ reference type. It introduces the name T as an opaque type and
+ reveals that U is a supertype of T. The concrete type of
+ T must be revealed elsewhere in the program.
+
+
+
+ The operators that have special syntax are classified and listed in order of
+ decreasing binding power in the following table:
+
+
+ All infix operators are left associative. Parentheses can be used
+ to override the precedence rules. Here are some examples of expressions
+ together with their fully parenthesized forms:
+
+
+ Operators
+ without special syntax are procedural. An application
+ of a procedural operator has the form op(args),
+ where op is the operation
+ and args is the list of argument expressions. For example,
+ MAX and MIN are procedural operators.
+
+
+
+ There are three kinds of ordinal types: enumerations, subranges,
+ and INTEGER. An enumeration type is declared like this:
+ where the id's are distinct identifiers. The type T is an
+ ordered set of n values; the expression T.id_i denotes
+ the $'th value of the type in increasing order. The empty enumeration
+ { } is allowed.
+
+
+ Integers
+ and enumeration elements are collectively called ordinal values.
+ The base type of an ordinal value v is
+ INTEGER if v is an integer, otherwise it is the unique
+ enumeration type that contains v.
+
+
+ A
+ subrange type is declared like this:
+ where Lo and Hi are two ordinal values with the same
+ base type, called the base type of the subrange. The values of T
+ are all the values from Lo to Hi inclusive.
+ Lo and Hi must be
+ constant expressions.
+ If Lo exceeds Hi, the subrange is empty.
+
+
+ The operators
+ ORD and VAL
+ convert between enumerations and integers.
+ The operators
+ FIRST, LAST,
+ and
+ NUMBER
+ applied to an ordinal type return the first element, last element,
+ and number of elements, respectively.
+
+
+ Here are the predeclared ordinal types:
+ The first 256 elements of type CHAR represent characters in the
+ ISO-Latin-1 code, which is an extension of ASCII. The language does
+ not specify the names of the elements of the CHAR enumeration.
+ The syntax for character literals is specified in the section on
+ literals.
+ FALSE and TRUE are predeclared
+ synonyms for BOOLEAN.FALSE and BOOLEAN.TRUE.
+
+
+ Each distinct enumeration type introduces a new collection of values,
+ but a subrange type reuses the values from the underlying type. For
+ example:
+ T1 and T2 are the same type, since they have the same
+ expanded definition. In particular, T1.C = T2.C and therefore
+ U1 and U2 are also the same type. But the types T1
+ and U1 are distinct, although they contain the same values,
+ because the expanded definition of T1 is an enumeration while the
+ expanded definition of U1 is a subrange.
+ The type V is a third type whose values V.A and V.B
+ are not related to the values T1.A and T1.B.
+
+
+
+ A declaration of a packed type has the form:
+ where Base is a type and n is an integer-valued constant
+ expression. The values of type T are the same as the values
+ of type Base, but variables of type T that occur in
+ records, objects, or arrays will occupy exactly n bits and
+ be packed adjacent to the preceding field or element. For example,
+ a variable of type
+ is an array of 256 booleans, each of which occupies one bit of storage.
+
+
+ The values allowed for n are implementation-dependent. An
+ illegal value for n is a static error. The legality of a packed
+ type can depend on its context; for example, an implementation could
+ prohibit packed integers from spanning word boundaries.
+
+
+
+ There are two forms of procedure declaration:
+ where
+ id is an identifier, sig is a procedure signature, and
+ B is a block. In both cases, the type of id is the procedure
+ type determined by sig. The first form is allowed only in
+ modules; the second form is allowed only in interfaces.
+
+
+ The
+ first form declares id as a procedure constant whose signature
+ is sig, whose body is B, and whose environment is the scope
+ containing the declaration. The parameter names are treated as if
+ they were declared at the outer level of B; the parameter types
+ and default values are evaluated in the scope containing the procedure
+ declaration. The procedure name id must be repeated after the
+ END that terminates the body.
+
+
+ The second form declares id to be a procedure constant whose
+ signature is sig. The procedure body is specified in a module
+ exporting the interface, by a declaration of the first form.
+
+
+
+ A procedure is either NIL or a triple consisting of:
+
+
+ A
+ procedure that returns a result is called a function procedure;
+ a procedure that does not return a result is called a
+ proper procedure.
+ A top-level procedure is a procedure declared in the outermost scope
+ of a module. Any other procedure is a local procedure.
+ A local procedure can be passed as a parameter but not assigned, since
+ in a stack implementation a local procedure becomes invalid when the
+ frame for the procedure containing it is popped.
+
+
+ A
+ procedure constant is an identifier declared as a procedure.
+ (As opposed to a procedure variable, which is a variable declared
+ with a procedure type.)
+
+
+ A procedure type declaration has the form:
+ where
+ sig is a signature specification, which has the form:
+ where
+
+
+ A formal parameter declaration has the form
+ where
+
+
+ When a series of parameters share the same mode, type, and default,
+ name_i can be a list of identifiers separated by commas. Such
+ a list is shorthand for a list in which the mode, type, and
+ default are repeated for each identifier. That is:
+ is shorthand for:
+
+
+ This shorthand is eliminated from the expanded definition of the type.
+ The default values are included.
+
+
+ A
+ procedure value P is a member of the type T
+ if it is NIL
+ or its signature is covered by the signature of T, where
+ signature_1 covers signature_2 if:
+
+
+ The parameter names and defaults affect the type of a procedure, but
+ not its value. For example, consider the declarations:
+ Now P = q is TRUE, yet P() prints "P"
+ and q() prints "Q". The interpretation of defaulted
+ parameters is determined by a procedure's type, not its value; the
+ assignment q := P changes q's value, not its type.
+
+
+ Examples of procedure types:
+
+
+ In
+ a procedure type, RAISES binds to the closest preceding
+ PROCEDURE.
+ That is, the parentheses are required in:
+
+
+ A RAISE statement without an argument has the form:
+ where e is an exception that takes no argument. The outcome
+ of the statement is the exception e. A RAISE statement
+ with an argument has the form:
+ where e is an exception that takes an argument and x is
+ an expression assignable to e's argument type. The outcome is
+ the exception e paired with the argument x.
+
+
+
+
+ For definitions of the terms used in these interfaces, see the ANSI/IEEE
+ Standard 754-1985 for floating-point arithmetic.
+
+
+ These interfaces define constant attributes of the three
+ built-in floating-point types:
+
+
+
+
+
+
+
+
+ The specification is the same for all three interfaces:
+
+
+ Base is the radix of the floating-point representation for T.
+
+
+ Precision is the number of base-Base digits of
+ precision for T.
+
+
+ MaxFinite is the maximum finite value in T.
+ For non-IEEE implementations, this is the same as LAST(T).
+
+
+ MinPos is the minimum positive value in T.
+
+
+ MinPosNormal is the minimum positive normal value in T;
+ it differs from MinPos only for implementations (like IEEE) with
+ denormalized numbers.
+
+
+
+
+ A record is a sequence of named variables, called the
+ fields of the record. Different fields can have different types.
+ The name and type of each field is statically determined by the
+ record's type. The expression r.f designates the field named
+ f in the record r.
+
+
+ A record type declaration has the form:
+ where FieldList is a list of field declarations,
+ each of which has the form:
+ where fieldName is an identifier,
+ Type is any non-empty type other
+ than an open array type, and default is a constant expression.
+ The field names must be distinct.
+ A record is a member of T if it has fields with the given names
+ and types, in the given order, and no other fields. Empty records
+ are allowed.
+
+
+ The
+ constant default is a default value used when a record
+ is
+ constructed
+ or
+ allocated.
+ Either ":= default" or ": Type"
+ can be omitted, but not both. If Type is omitted, it is taken
+ to be the type of default. If both are present, the value of
+ default must be a member of Type.
+
+
+ When a series of fields shares the same type and default,
+ any fieldName
+ can be a list of identifiers separated by commas. Such a list is
+ shorthand for a list in which the type and default are repeated
+ for each identifier. That is:
+ is shorthand for:
+ This shorthand is eliminated from the expanded definition
+ of the type. The default values are included.
+
+
+ Examples of record types:
+
+
+
+
+ A constant, type, or procedure declaration N = E,
+ a variable declaration N: E,
+ an exception declaration N(E),
+ or a revelation N = E
+ is recursive if N
+ occurs in any partial expansion of E.
+ A variable declaration N := I where the type is omitted is recursive
+ if N occurs in any partial expansion of the type
+ E of I.
+ Such declarations are
+ allowed if every occurrence of N in any partial expansion of
+ E is (1) within some occurrence of the type constructor REF
+ or PROCEDURE,
+ (2) within a field or method type of the type constructor OBJECT,
+ or (3) within a procedure body.
+
+
+ Examples of legal recursive declarations:
+
+
+ Examples of illegal recursive declarations:
+
+
+ Examples of legal non-recursive declarations:
+
+
+
+
+ A reference value is either NIL or the address of
+ a variable, called the referent.
+
+
+ A
+ reference type is either traced or untraced. When
+ all traced references to a piece of allocated storage are gone, the
+ implementation reclaims the storage. Two reference types are of the
+ same reference class if they are both traced or both untraced.
+ A general type is traced if it is a traced reference type,
+ a record type any of whose field types is traced, an array type whose
+ element type is traced, or a packed type whose underlying unpacked
+ type is traced.
+
+
+ A
+ declaration for a traced reference type has the form:
+ where Type is any type. The values of T are traced
+ references to variables of type Type, which is called
+ the referent type of T.
+
+
+ A
+ declaration for an untraced reference type has the form:
+ where Type is any untraced type.
+ (This restriction is lifted in unsafe modules.)
+ The values of T are the untraced references
+ to variables of type Type.
+
+
+ In
+ both the traced and untraced cases, the keyword REF can
+ optionally be preceded by "BRANDED b" where b is
+ a text constant called the brand. Brands distinguish types
+ that would otherwise be the same; they have no other semantic effect.
+ All brands in a program must be distinct. If BRANDED is present
+ and b is absent, the implementation automatically supplies
+ a unique value for b. Explicit brands are useful for persistent
+ data storage.
+
+
+ The
+ following reference types are predeclared:
+ The TYPECASE statement
+ can be used to test the referent type
+ of a REFANY or object, but there is
+ no such test for an ADDRESS.
+
+
+ Examples of reference types:
+
+
+ The operator = returns TRUE if x and y
+ are equal. The operator # returns TRUE
+ if x and y are not equal.
+ It is a static error if the type of x is not
+ assignable to the type of y or vice versa.
+
+
+ Ordinals are equal if they have the same value. Floats are equal
+ if the underlying implementation defines them to be; for example,
+ on an IEEE implementation, +0 equals -0 and
+ NaN does not equal itself.
+ References are equal if they address the same location.
+ Procedures are equal if they agree as closures; that
+ is, if they refer to the same procedure body and environment.
+ Sets are equal if they have the same elements.
+ Arrays are equal if they have the same length and corresponding
+ elements are equal.
+ Records are equal if they have the same fields and corresponding fields
+ are equal.
+
+
+ In the first three cases, <= returns TRUE if x
+ is at most as large as y. In the last case, <= returns
+ TRUE if every element of x is an element of y.
+ In all cases, it is a static error if the type of x is
+ not assignable to the type of y, or vice versa.
+ The expression x >= y is equivalent to y <= x.
+
+
+ In all cases, x < y means (x <= y) AND (x # y),
+ and x > y means y < x.
+ It is a static error if the type of x is not assignable
+ to the type of y, or vice versa.
+
+
+ Warning: with IEEE floating-point, x <= y
+ is not the same as NOT x > y.
+
+
+ Returns TRUE if e is an element of the set s.
+ It is a static error if the type of e is not assignable to
+ the element type of s.
+ If the value of e is not a member of the element type,
+ no error occurs, but IN returns FALSE.
+
+
+
+ If B is an expression of type BOOLEAN
+ and S is a statement:
+ is shorthand for:
+
+
+ A RETURN statement for a
+ proper procedure
+ has the form:
+ The statement raises the return-exception without an argument. It
+ is allowed only in the body of a proper procedure.
+
+
+ A
+ RETURN statement for a
+ function procedure
+ has the form:
+ where Expr is an expression assignable to the result type of
+ the procedure. The statement raises the return-exception with the
+ argument Expr. It is allowed only in the body of a function
+ procedure.
+
+
+ Failure
+ to return a value from a function procedure is a checked runtime
+ error.
+
+
+ The effect of raising the return exception is to terminate the current
+ procedure activation. To be precise, a call on a proper procedure
+ with body B is equivalent (after binding the arguments) to:
+ A call on a function procedure with body B is equivalent to:
+
+
+ A revelation introduces information about an opaque type into
+ a scope. Unlike other declarations, revelations introduce no new names.
+
+
+ There are two kinds of revelations, partial and complete.
+ A program can contain any number of partial revelations for an opaque
+ type; it must contain exactly one complete revelation.
+
+
+ A partial revelation has the form:
+ where V is a type expression (possibly just a name)
+ and T is an identifier (possibly
+ qualified)
+ declared as an opaque type. It reveals that
+ V is a supertype of T.
+
+
+ In any scope, the revealed supertypes of an opaque type must be linearly
+ ordered by the subtype relation.
+ That is, if it is revealed that T <: U1 and T <: U2,
+ it must also be revealed either that
+ U1 <: U2 or that U2 <: U1.
+
+
+ A complete revelation has the form:
+ where V is a type expression (not just a name) whose outermost
+ type constructor is a branded reference or object type and T
+ is an identifier (possibly qualified) that has been declared as an
+ opaque type. The revelation specifies that V is the concrete
+ type for T. It is a static error if any type revealed in any
+ scope as a supertype of T is not a supertype of V.
+ Generally this error is detected at link time.
+
+
+ Distinct opaque types have distinct concrete types, since V
+ includes a brand and all brands in a program are distinct.
+
+
+ A
+ revelation is allowed only in an interface or in the outermost scope
+ of a module. A revelation in an interface can be imported into any
+ scope where it is required, as illustrated by the
+ stack example.
+
+
+ For example, consider:
+
+ An importer of I sees I.T as an opaque subtype of
+ ROOT, and is limited to allocating objects of type I.T,
+ passing them to I.P, or declaring subtypes of I.T.
+ An importer of IClass sees that every I.T is a
+ MUTEX, and can therefore lock objects of type I.T.
+ Finally, an importer of IRep sees the concrete type,
+ and can access the count field.
+
+
+
+ The keyword UNSAFE can precede the declaration of any interface
+ or module to indicate that it is unsafe; that is, uses the
+ unsafe features
+ of the language.
+ An interface or module not explicitly labeled
+ UNSAFE is called safe.
+
+
+ An
+ interface is intrinsically safe if there is no way to produce
+ an unchecked runtime error by using the interface in a safe module.
+ If all modules that export a safe interface are safe, the compiler
+ guarantees the intrinsic safety of the interface. If any of the modules
+ that export a safe interface are unsafe, it is the programmer, rather
+ than the compiler, who makes the guarantee.
+
+
+ It is a static error for a safe interface to import an unsafe one
+ or for a safe module to import or export an unsafe interface.
+
+
+
+
+ A statement of the form:
+ executes S_1, and then if the outcome is normal, executes
+ S_2. If the outcome of S_1 is an exception, S_2
+ is ignored.
+
+
+ Some programmers use the semicolon as a statement
+ terminator, some as a statement separator. Similarly, some
+ use the vertical bar in case statements as a case initiator, some
+ as a separator. Modula-3 allows both styles. This report
+ uses both operators as separators.
+
+
+
+ A set is a collection of values taken from some ordinal type.
+ A set type declaration has the form:
+ where Base is an ordinal type. The values of T are all sets
+ whose elements have type Base. For example, a variable whose
+ type is SET OF [0..1] can assume the following
+ values:
+
+
+ Implementations are expected to use the same representation for a
+ SET OF T as for an ARRAY T OF BITS 1 FOR BOOLEAN. Hence,
+ programmers should expect SET OF [0..1023] to be practical,
+ but not SET OF INTEGER.
+
+
+
+
+ Look into any carpenter's tool-bag and see how many different
+ hammers, chisels, planes and screw-drivers he keeps there---not for
+ ostentation or luxury, but for different sorts of jobs.
+ ---Robert Graves and Alan Hodge
+
+
+ Executing
+ a statement produces a computation that can halt (normal
+ outcome), raise an exception, cause a checked runtime error, or
+ loop forever. If the outcome is an exception, it can optionally
+ be paired with an argument.
+
+
+ We
+ define the semantics of EXIT and RETURN with exceptions
+ called the exit-exception and the return-exception.
+ The exit-exception takes no argument; the return-exception takes
+ an argument of arbitrary type. Programs cannot name these exceptions
+ explicitly.
+
+
+ Implementations should speed up normal outcomes at the expense of
+ exceptions (except for the return-exception and exit-exception).
+ Expending a thousand instructions per exception raised to save
+ one instruction per procedure call would be reasonable.
+
+
+ If an expression is evaluated as part of the execution of a statement,
+ and the evaluation raises an exception, then the exception becomes
+ the outcome of the statement.
+
+
+ The empty statement is a no-op. In this report, empty statements
+ are written (*skip*).
+
+
+ Each of the statments is described below
+
+
+ We write T <: U to indicate that T is a subtype
+ of U and U is a supertype of T.
+
+
+ If
+ T <: U, then every value of type T is also a value
+ of type U. The converse does not hold: for example, a record
+ or array type with packed fields contains the same values as the
+ corresponding type with unpacked fields, but there is no subtype
+ relation between them. This section presents the rules that define
+ the subtyping relation.
+
+
+ For ordinal types T and U, we have T <:
+ U if they have the same basetype and every member of T
+ is a member of U. That is, subtyping on ordinal types
+ reflects the subset relation on the value sets.
+
+
+ For array types,
+
+
+ That is, an array type A is a subtype of an array type
+ B if they have the same ultimate element type, the same
+ number of dimensions, and, for each dimension, either both are open
+ (as in the first m dimensions above),
+ or A is fixed and B is open
+ (as in the next n dimensions above), or they are
+ both fixed and have the same size
+ (as in the last p dimensions above).
+
+
+
+
+ That is, REFANY and ADDRESS contain all traced and
+ untraced references, respectively, and NIL is a member
+ of every reference type. These rules also apply to branded
+ types.
+
+
+ That is, NIL is a member of every procedure type.
+
+ That is, for procedure types, T <: U if
+ they are the same except for parameter names, defaults,
+ and raises sets, and the raises set for T is contained in the
+ raises set for U.
+
+
+ That is, every object is a reference,
+ NIL is a member of every
+ object type, and every subtype is included in its supertype.
+ The third rule also applies to branded types.
+
+ That is, BITS FOR T has the same values as T.
+
+ That is, <: is reflexive and transitive.
+
+
+ Note that T <: U and U <: T does not imply that
+ T and U are the same, since the subtype relation
+ is unaffected by parameter names, default values, and packing.
+
+
+ For example, consider:
+ The types T and U are subtypes of one another but are
+ not the same. The types AT and AU are
+ unrelated by the subtype relation.
+
+
+
+
+ Care should be taken, when using colons and semicolons in the same
+ sentence, that the reader understands how far the force of each sign
+ carries.
+ ---Robert Graves and Alan Hodge
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A comment is an arbitrary character sequence opened by (* and closed
+ by *). Comments can be nested and can extend over more than one line.
+
+
+
+
+ A pragma is an arbitrary character sequence opened by <*
+ and closed by *>.
+ Pragmas can be nested and can extend over more than one line.
+ Pragmas are hints to the implementation; they do not affect the
+ language semantics.
+
+
+ We
+ recommend supporting the two pragmas <*INLINE*> and
+ <*EXTERNAL*>.
+ The pragma <*INLINE*> precedes a procedure
+ declaration to indicate that the procedure should be expanded at the
+ point of call. The pragma <* EXTERNAL N:L *> precedes an
+ interface or a declaration in an interface to indicate that the entity
+ it precedes is implemented by the language L, where it has the
+ name N. If ":L" is omitted, then the implementation's
+ default external language is assumed. If "N" is omitted, then
+ the external name is determined from the Modula-3 name in some
+ implementation-dependent way.
+
+
+
+
+ We use the following notation for defining syntax:
+ "Followed by" has greater binding power than | or &;
+ parentheses are used to override this precedence rule. Non-terminals
+ begin with an upper-case letter. Terminals are either keywords or
+ quoted operators. The symbols Ident, Number,
+ TextLiteral, and CharLiteral are defined in the
+ token grammar.
+ Each production is terminated by a period.
+ The syntax does not reflect the restrictions that revelations
+ and exceptions can be declared only at the top level; nor does it
+ include explicit productions for NEW, INC, and DEC,
+ which parse like procedure calls.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ To read a token, first skip all blanks, tabs, newlines, carriage
+ returns, vertical tabs, form feeds, comments, and pragmas. Then read the
+ longest sequence of characters that forms an
+ operator
+ or an Id or Literal.
+
+
+ An
+ Id is a case-significant sequence of letters, digits, and
+ underscores that begins with a letter.
+ An Id is a keyword if it appears in the
+ list of keywords,
+ a reserved identifier if it appears in the
+ list of reserved identifiers,
+ and an ordinary identifier otherwise.
+
+
+ In the following grammar, terminals are characters surrounded by
+ double-quotes and the special terminal DQUOTE represents
+ double-quote itself.
+
+
+
+ A non-nil TEXT represents a zero-based sequence of characters.
+ NIL does not represent any sequence of characters, it will not
+ be returned from any procedure in the interface, and it is a checked
+ runtime error to pass it to any procedure in the interface.
+
+ The concatenation of t and u.
+
+ TRUE if t and u have the same length
+ and (case-sensitive) contents.
+
+ Character i of t. A checked runtime error
+ if i >= Length(t).
+
+ The number of characters in t.
+
+ TRUE if Length(t) = 0.
+
+ Return a subsequence of t: empty if start >= Length(t)
+ or length = 0; otherwise the subsequence ranging from
+ start to the minimum of start+length-1 and
+ Length(t)-1.
+
+ For each i from 0 to MIN(LAST(a),
+ Length(t)-1), set a[i] to
+ GetChar(t, i).
+
+ A text containing the single character ch.
+
+ A text containing the characters of a.
+
+ Return a hash function of the contents of t.
+
+
+
+ The concatenation of a and b, as defined by
+ Text.Cat.
+
+
+
+ A character literal is a pair of single quotes enclosing either a
+ single ISO-Latin-1 printing character (excluding single quote)
+ or an escape sequence. The type of a character literal is CHAR.
+
+
+ A
+ text literal is a pair of double quotes enclosing a sequence of
+ ISO-Latin-1 printing characters (excluding double quote) and escape
+ sequences. The type of a text literal is TEXT.
+
+
+ Here are
+ are the legal escape sequences and the characters they denote:
+ A \ followed by exactly three octal digits specifies the character
+ whose code is that octal value. A \ that is not a part
+ of one of these escape sequences is a static error.
+
+
+ For example, 'a' and '\'' are valid character
+ literals, ''' is not; "" and "Don't\n"
+ are valid text literals, """ is not.
+
+
+
+ If a shared variable is written concurrently by two threads, or written
+ by one and read concurrently by another, the effect is to set the
+ variable to an implementation-dependent value of its type.
+ For example, if one thread writes a[0] while another
+ concurrently writes a[1], one of the writes might be lost.
+ Thus, portable programs must
+ use the Thread interface to provide mutual exclusion for shared
+ variables.
+
+ A Thread.T is a handle on a thread. A Mutex is locked
+ by some thread, or unlocked. A Condition is a set of waiting
+ threads. A newly-allocated Mutex is unlocked; a newly-allocated
+ Condition is empty. It is a checked runtime error to pass the
+ NIL Mutex, Condition, or T to any
+ procedure in this interface.
+
+ A handle on a newly-created thread executing cl.apply().
+
+ Wait until t has terminated and return its result. It is a
+ checked error to call this more than once for any t.
+
+ The calling thread must have m locked. Atomically unlocks
+ m and waits on c. Then relocks m and returns.
+
+ Wait until m is unlocked and then lock it.
+
+
+ The calling thread must have m locked. Unlocks m.
+
+ All threads waiting on c become eligible to run.
+
+ One or more threads waiting on c become eligible to run.
+
+ Return the handle of the calling thread.
+
+ Used to approximate asynchronous interrupts.
+
+ Mark t as an alerted thread.
+
+ TRUE if the calling thread has been marked alerted.
+
+ Like Wait, but if the thread is marked alerted at the time of
+ call or sometime during the wait, lock m and raise Alerted.
+
+ Like Join, but if the calling thread is marked alerted at
+ the time of call or sometime during the wait, raise Alerted.
+
+ An implementation-dependent integer constant: the number of bits in
+ a memory-coherent block. If two components of a record or array fall
+ in different blocks, they can be accessed concurrently by different
+ threads without locking.
+
+
+
+ A TRY-EXCEPT statement has the form:
+ where Body and each Handler are statements,
+ each id names an exception, and each v_i is an identifier.
+ The "ELSE Handler_0" and each "(v_i)" are optional.
+ It is a static error for an exception to be named more than once
+ in the list of id's.
+
+
+ The
+ statement executes Body. If the outcome is normal, the
+ except clause is ignored. If Body raises any listed exception
+ id_i, then Handler_i is executed. If Body
+ raises any other exception and "ELSE Handler_0" is present,
+ then it is executed. In either case, the outcome of the TRY
+ statement is the outcome of the selected handler. If Body
+ raises an unlisted exception and "ELSE Handler_0" is
+ absent, then the outcome of the TRY statement is the exception
+ raised by Body.
+
+
+ Each
+ (v_i) declares a variable whose type is the argument
+ type of the exception id_i and whose scope is
+ Handler_i. When an exception id_i paired with an
+ argument x is handled, v_i is initialized to
+ x before Handler_i is executed. It is a static error
+ to include (v_i) if exception id_i does not take
+ an argument.
+
+
+ If (v_i) is absent, then id_i can be a list of
+ exceptions separated by commas, as shorthand for a list in
+ which the rest of the handler is repeated for each exception.
+ That is:
+ is shorthand for:
+
+
+ It
+ is a checked runtime error to raise an exception outside the dynamic
+ scope of a handler for that exception. A "TRY EXCEPT ELSE"
+ counts as a handler for all exceptions.
+
+
+
+ A statement of the form:
+ executes statement S_1 and then statement S_2.
+ If the outcome of S_1 is normal, the TRY statement
+ is equivalent to S_1; S_2. If the outcome of
+ S_1 is an exception and the outcome of S_2 is normal,
+ the exception from S_1 is re-raised after S_2
+ is executed. If both outcomes are exceptions, the outcome of the
+ TRY is the exception from S_2.
+
+
+
+ If T is an identifier and U a type
+ (or type expression, since a type expression is allowed
+ wherever a type is required), then:
+ declares T to be the type U.
+
+
+
+ A TYPECASE statement has the form:
+ where Expr is an expression whose type is a reference type,
+ the S's are statements, the T's are reference types,
+ and the v's are identifiers. It is a static error if
+ Expr has type ADDRESS or if any T is not a subtype of
+ the type of Expr. The "ELSE S_0"
+ and each "(v)" are optional.
+
+
+ The
+ statement evaluates Expr. If the resulting reference value
+ is a member of any listed type T_i, then S_i is executed,
+ for the minimum such i. (Thus a NULL case is useful only if it
+ comes first.) If the value is a member of no listed type and
+ "ELSE S_0" is present, then it is executed. If the value is a member
+ of no listed type and "ELSE S_0" is absent, a checked runtime error
+ occurs.
+
+
+ Each (v_i) declares a variable whose type is T_i and
+ whose scope is S_i. If v_i is present, it is
+ initialized to the value of Expr before S_i is
+ executed.
+
+
+ If (v_i) is absent, then T_i can be a list of type
+ expressions separated by commas, as shorthand for a list in
+ which the rest of the branch is repeated for each type expression.
+ That is:
+ is shorthand for:
+
+
+ For example:
+
+
+ ISTYPE(x, T) is TRUE if and only if x is a member
+ of T. T must be an object type or traced reference
+ type, and x must be assignable to T.
+
+ NARROW(x, T) returns x after checking that x is
+ a member of T. If the check fails, a runtime error occurs.
+ T must be an object type or traced reference type,
+ and x must be assignable to T.
+
+
+ Every object type or traced reference type (including NULL)
+ has an associated integer code. Different types have different
+ codes. The code for a type is constant for any single execution
+ of a program, but may differ for different executions.
+ TYPECODE(T) returns the code for the type T and
+ TYPECODE(r) returns the code for the allocated type of r.
+ It is a static error if T is REFANY or is not an object
+ type or traced reference type.
+
+
+ ORD converts an element of an enumeration to the integer that
+ represents its position in the enumeration order. The first value
+ in any enumeration is represented by zero. If the type
+ of element is a subrange of an enumeration T, the result
+ is the position of the element within T, not within the subrange.
+
+
+ VAL is the inverse of ORD; it converts from a numeric
+ position i into the element that occupies that position in
+ an enumeration. If T is a subrange, VAL returns the
+ element with the position i in the original enumeration type,
+ not the subrange. It is a checked runtime error for the value
+ of i to be out of range for T.
+
+
+ If n is an integer, ORD(n) = VAL(n, INTEGER) = n.
+
+
+ For an ordinal type T, NUMBER(T) returns the number of
+ elements in T.
+ For a fixed array type A, NUMBER(A) is defined by
+ NUMBER(IndexType(A)). Similarly, for an array a,
+ NUMBER(a) is defined by NUMBER(IndexType(a)). In
+ this case, the expression a will be evaluated only if it
+ denotes an open array.
+
+
+ For a non-empty ordinal type T, FIRST returns the
+ smallest value of T and LAST returns the largest
+ value. If T is the empty enumeration, FIRST(T) and
+ LAST(T) are static errors. If T is any other empty
+ ordinal type, the values returned are implementation-dependent,
+ but they satisfy FIRST(T) > LAST(T).
+
+
+ For a floating-point type T, FIRST(T) and LAST(T)
+ are the smallest and largest values of the type, respectively.
+ On IEEE implementations, these are minus and plus infinity.
+
+
+ For a fixed array type A, FIRST(A) is defined by
+ FIRST(IndexType(A)) and LAST(A) by
+ LAST(IndexType(A)).
+ Similarly, for an array a,
+ FIRST(a) and LAST(a) are defined by
+ FIRST(IndexType(a)) and LAST(IndexType(a)).
+ The expression a will be evaluated only if it is an open array.
+ Note that if a is an open array,
+ FIRST(a) and LAST(a)
+ have type INTEGER.
+
+
+ These operations return the size of the variable x or of
+ variables of type T. BITSIZE returns the number of bits,
+ BYTESIZE the number of 8-bit bytes, and ADRSIZE the number
+ of addressable locations. In all cases, x must be a designator
+ and T must not be an open array type. A designator x
+ will be evaluated only if its type is an open array type.
+
+
+
+
+ I am the voice of today, the herald of tomorrow...
+ I am the leaden army that conquers the world---I am TYPE.
+ ---Frederic William Goudy
+
+
+ Modula-3
+ uses structural equivalence, instead of the name equivalence
+ of Modula-2. Two types are the same if their definitions become the
+ same when expanded; that is, when all constant expressions are replaced
+ by their values and all type names are replaced by their definitions.
+ In the case of recursive types, the expansion is the infinite limit
+ of the partial expansions. A type expression is generally allowed
+ wherever a type is required.
+
+
+ A
+ type is empty if it contains no values. For example,
+ [1..0] is an empty type. Empty types can be used to build non-empty
+ types (for example, SET OF [1..0], which is not empty because
+ it contains the empty set). It is a static error to declare a variable
+ of an empty type.
+
+
+ Every expression has a statically-determined type, which contains
+ every value that the expression can produce. The type of a designator
+ is the type of the variable it produces.
+
+
+ Assignability and type compatibility are defined in terms of a single
+ syntactically specified subtype relation with the property that if
+ T is a subtype of U, then every member of T
+ is a member of U. The subtype relation is reflexive and transitive.
+
+
+ Every expression has a unique type, but a value can be a member of
+ many types. For example, the value 6 is a member of both
+ [0..9] and INTEGER. It would be ambiguous to talk
+ about "the type of a value". Thus the phrase "type of x"
+ means "type of the expression x", while "x is a
+ member of T" means "the value of x is a member of
+ T".
+
+
+ However,
+ there is one sense in which a value can be said to have
+ a type: every object or traced reference value includes a code
+ for a type, called the allocated type of the reference value.
+ The allocated type is tested by TYPECASE.
+
+
+ The type constructors and subtyping rules are discussed below
+
+ Art, it seems to me, should simplify. That, indeed, is very nearly
+ the whole of the higher artistic process; finding what conventions
+ of form and what detail one can do without and yet preserve the spirit
+ of the whole.
+ ---Willa Cather
+
+
+ A
+ module is like a block, except for the visibility of names.
+ An entity is visible in a block if it is declared in the block
+ or in some enclosing block; an entity is visible in a module if
+ it is declared in the module or in an interface that is imported
+ or exported by the module.
+
+
+ An
+ interface is a group of declarations. Declarations in
+ interfaces are the same as in blocks, except that any variable
+ initializations must be constant, and procedure declarations must specify
+ only the signature, not the body.
+
+
+ A module X exports an interface I to supply bodies
+ for one or more of the procedures declared in the interface. A module
+ or interface X imports an interface I to make the
+ entities declared in I visible in X.
+
+
+ A
+ program is a collection of modules and interfaces that contains
+ every interface imported or exported by any of its modules or
+ interfaces, and in which no procedure, module, or interface is multiply
+ defined. The effect of executing a program is to execute the bodies
+ of each of its modules. The order of execution of the modules is
+ constrained by the initialization rule.
+
+
+ The
+ module whose body is executed last is called the main module.
+ Implementations are expected to provide a way to specify the main
+ module, in case the initialization rule does not determine it uniquely.
+ The recommended rule is that the main module be the one that exports
+ the interface Main, whose contents are implementation-dependent.
+
+
+ Program
+ execution terminates when the body of the main module
+ terminates, even if concurrent threads of control are still executing.
+
+
+ The names of the modules and interfaces of a program are called
+ global names. The method for looking up global names---for example,
+ by file system search paths---is implementation-dependent.
+
+
+ The following topics are discussed below
+
+
+
+ There are some cases that no law can be framed to cover.
+ ---Aristotle
+
+
+ The
+ features defined in this section can potentially cause unchecked
+ runtime errors and are thus forbidden in safe interfaces and modules.
+
+
+ An
+ unchecked type transfer operation has the form:
+ where e is an expression whose type is not an open array type
+ and T is a type. It denotes e's bit pattern
+ interpreted as a variable or value of type T. It is a designator
+ if e is, and is writable if e is.
+ An unchecked runtime error can occur if e's bit pattern
+ is not a legal T, or if e
+ is a designator and some legal bit pattern for T is not legal
+ for e.
+
+
+ If T is not an open array type, BITSIZE(e) must equal
+ BITSIZE(T). If T is an open array type, its element type
+ must not be an open array type, and e's bit pattern is interpreted
+ as an array whose length is BITSIZE(e) divided by
+ BITSIZE(the element type of T).
+ The division must come out even.
+
+
+ The
+ following operations are primarily used for address arithmetic:
+ ADR(x) is the address of the variable x. The actual
+ argument must be a designator but need not be writable.
+ The operations
+ + and - treat addresses as integers. The validity of the
+ addresses produced by these operations is implementation-dependent.
+ For example, the address of a variable in a local procedure frame
+ is probably valid only for the duration of the call. The address
+ of the referent of a traced reference is probably valid only as long
+ as traced references prevent it from being collected (and not even
+ that long if the implementation uses a compacting collector).
+
+
+ In
+ unsafe modules the INC and DEC statements apply to
+ addresses as well as ordinals:
+ These are short for x := x + n and x := x - n, except that
+ x is evaluated only once.
+
+
+ A
+ DISPOSE statement has the form:
+ where v is a writable designator whose type is not REFANY,
+ ADDRESS, or NULL. If v is untraced, the statement
+ frees the storage for v's referent and sets v to
+ NIL.
+ Freeing storage to which active references remain is an unchecked
+ runtime error. If v is traced, the statement is equivalent to
+ v := NIL. If v is NIL, the statement is a no-op.
+
+
+ In
+ unsafe interfaces and modules the definition of "assignable" for
+ types is extended:
+ two reference types T and U are assignable
+ if T <: U or U <: T.
+ The only effect of this change is to allow a value of
+ type ADDRESS to be assigned to a variable of type
+ UNTRACED REF T. It is an unchecked runtime error if the value does
+ not address a variable of type T.
+
+
+ In
+ unsafe interfaces and modules the type constructor UNTRACED REF T
+ is allowed for traced as well as untraced T, and the fields of
+ untraced objects can be traced. If u is an untraced reference
+ to a traced variable t, then the validity of the traced references
+ in t is implementation-dependent, since the garbage collector
+ probably will not trace them through u.
+
+
+
+ If id is an identifier, T a non-empty type other than
+ an open array type, and E an expression, then:
+ declares id as a variable of type T whose initial value
+ is the value of E. Either ":= E" or ": T"
+ can be omitted, but not both. If T is omitted, it is taken
+ to be the type of E. If E is omitted, the initial value
+ is an arbitrary value of type T. If both are present,
+ E must be assignable to T.
+
+
+ The
+ initial value is a shorthand that is equivalent to inserting the
+ assignment id := E at the beginning of the executable
+ part of the block.
+ If several variables have initial values, their assignments are inserted
+ in the order they are declared. For example:
+ initializes i and j to the same arbitrary value
+ in [0..5];
+ it is equivalent to:
+ If a sequence of identifiers share the same type and initial value,
+ id can be a list of identifiers separated by commas. Such
+ a list is shorthand for a list in which the type and
+ initial value are repeated for each identifier.
+ That is:
+ is shorthand for:
+ This means that E is evaluated n times.
+
+
+
+ If B is an expression of type BOOLEAN
+ and S is a statement:
+ is shorthand for:
+
+
+ A WITH statement has the form:
+ where id is an identifier, e an expression,
+ and S a statement.
+ The statement declares id with scope S as an
+ alias for the variable e or as a readonly name for
+ the value e. The expression e is evaluated once, at entry
+ to the WITH statement.
+
+
+ The statement is like the procedure call P(e), where P
+ is declared as:
+ If e is a
+ writable designator,
+ mode is VAR; otherwise,
+ mode is READONLY.
+ The only difference
+ between the WITH statement and the call P(e) is that free
+ variables, RETURNs, and EXITs that occur in the WITH
+ statement are interpreted in the context of the WITH statement,
+ not in the context of P.
+
+
+ A
+ single WITH can contain multiple bindings, which are evaluated
+ sequentially. That is:
+ is equivalent to:
+
+
+ A Word.T w represents a sequence of Word.Size bits
+ w_0, ..., w_(Word.Size-1).
+ It also represents the unsigned number SUM (w_i * 2^i).
+ Finally, it also represents a signed INTEGER by some
+ implementation-dependent encoding (for example, two's complement).
+ The built-in operations of the language deal with the signed value;
+ the operations in this interface deal with the unsigned value or with
+ the bit sequence.
+
+
+ Here are the arithmetic operations on unsigned words:
+
+
+ And here are the logical operations on bit sequences:
+
+
+ And here are additional operations on bit sequences:
+
+
+ For all i such that both i and i - n
+ are in the range
+ [0..Word.Size - 1], bit i of the result equals
+ bit i - n of x.
+ The other bits of the result are 0.
+ Thus shifting by n > 0 is like multiplying by 2^n.
+
+
+ Since Modula-3 has no exponentiation operator, Word.Shift(1, n)
+ is the usual way of writing 2^n in a constant expression.
+
+
+ Bit i of the result is bit ((i - n) MOD Word.Size)
+ of x.
+
+
+ Take n bits from x, with bit i as the
+ least significant bit, and return them as the least significant
+ n bits of a word whose other bits are 0.
+ A checked runtime error if n + i > Word.Size.
+
+
+ Result of replacing n bits of x,
+ with bit i as the least
+ significant bit, by the least significant n bits of y.
+ The other bits of x are unchanged. A checked runtime
+ error if n + i > Word.Size.
+
+
+ This simple parsing library reads an LL grammar at run time and
+ calls user defined actions when specified grammar events are found.
+ It is used by the obliq interpreter.
+ Parser generators and other parsing libraries and programs.
+ Compilers, interpreters, parsing, and programming tools.
+ This library complements the Core library with
+ a base set of data structures, algorithms,
+ input/output, operating system access, and runtime support modules.
+ A subset of the interfaces implemented in the m3core and
+ libm3 libraries was carefully selected, reviewed and
+ documented by the interface police in the technical
+ report Some Useful Modula-3 Interfaces.
+
+
+ Grant Of License. Digital Equipment Corporation, having a principal
+ office at 146 Main Street, Maynard, MA 01754 ("DIGITAL") grants to
+ you ("LICENSEE") the non-exclusive, non-transferable, royalty free
+ right to use, modify, reproduce and distribute SRC Modula-3 ("SOFTWARE")
+ subject to the terms set forth herein. Any distribution of SOFTWARE
+ shall include this Digital License Agreement in human readable form.
+
+ Title to Intellectual Property and Software. Subject to the limited
+ rights and licenses granted under this License Agreement, all rights,
+ title and interests including patent, copyright, and trademark rights
+ in SOFTWARE are and shall remain vested in DIGITAL to the exclusion
+ of LICENSEE. DIGITAL represents and warrants that DIGITAL has the
+ legal right to grant such licenses as are expressly granted under
+ this Agreement.
+
+ Copyright. The SOFTWARE is owned by DIGITAL or its suppliers and is
+ protected by United Stats copyright laws and international treaty
+ provisions. Therefore, you must treat the SOFTWARE like any other
+ copyrighted material (e.g., a book or musical recording) except
+ that you may use the SOFTWARE as provided in this Digital License
+ Agreement.
+
+ Improvements. LICENSEE hereby grants to DIGITAL a non-exclusive,
+ non-transferable, royalty free right to use, modify, reproduce
+ and distribute with the right to sublicense at any tier, any
+ improvements, enhancements, extensions, or modifications that
+ LICENSEE make to SOFTWARE, provided such are returned to DIGITAL
+ by LICENSEE.
+
+ DISCLAIMER OF WARRANTY. Because the SOFTWARE is a research work and
+ not a released product, it is provided "AS IS" WITHOUT WARRANTY OF ANY
+ KIND AND WITHOUT ANY SUPPORT SERVICES. EXCEPT AS SPECIFICALLY PROVIDED
+ ABOVE IN SECTION 2, DIGITAL FURTHER DISCLAIMS ALL OTHER EXPRESS OR
+ IMPLIED WARRANTIES OF MERCHANTABILITY OR OF FITNESS FOR A PARTICULAR
+ PURPOSE. THE ENTIRE RISK ARISING OUT OF THE USE OR PERFORMANCE OF
+ THE SOFTWARE REMAINS WITH YOU.
+
+ Limitation of Liability. IN NO EVENT SHALL DIGITAL OR ITS SUPPLIERS BE
+ LIABLE IN AN AMOUNT THAT EXCEEDS THE LICENSE FEE PAID BY LICENSEE FOR
+ ANY DAMAGES (INCLUDING, WITH LIMITATION, DAMAGES FOR LOSS OF BUSINESS
+ PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER
+ PECUNIARY LOSS), REGARDLESS OF THE FORM OF CLAIM OR ACTIONS, ARISING
+ OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE OR DOCUMENTATION,
+ EVEN IF DIGITAL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ BECAUSE SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY
+ FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES, THE ABOVE LIMITATION MAY NOT
+ APPLY TO YOU.
+
+ Acknowledgement of Allocation of Risk. LICENSEE acknowledges and agrees
+ that the fees charged by DIGITAL in this Agreement reflect the allocation
+ of risks provided by the foregoing limitation of liability. LICENSEE
+ acknowledges and represents that it has read and understands these
+ allocations of risk limiting the liability of DIGITAL and that it
+ understands that a modification of the allocation of risks set forth
+ in this agreement would affect the fees charged by DIGITAL, and that
+ LICENSEE, in consideration of such fees, agrees to such allocations
+ of risk.
+
+ LICENSEE INDEMNIFICATION. LICENSEE SHALL INDEMNIFY DIGITAL AGAINST
+ ALL COSTS AND DAMAGE JUDGEMENTS, INCLUDING ATTORNEY'S FEES AND COSTS
+ OF DEFENSE, INCURRED BECAUSE OF CLAIMS OF DAMAGE ARISING FROM LICENSEE'S
+ POSSESSION OR USE OR INABILITY TO USE SOFTWARE.
+
+ GOVERNMENT RESTRICTED RIGHTS. The SOFTWARE and documentation are provided
+ with RESTRICTED RIGHTS. Use duplication, or disclosure by the Government
+ is subject restrictions as set forth in subparagraph (c)(1)(ii) of The
+ Rights in Technical Data and Computer Software clause in DFARS
+ 252.227-7013, or subparagraphs (c)(i) and (2) of the Commercial Computer
+ Software -- Restricted Rights at 48 CFR 52.227-19, as applicable.
+ Manufacturer is Digital Equipment Corporation, 130 Lytton Avenue,
+ Palo Alto, CA 94301-1044.
+
+ Severability. If any provision of the Agreement is held illegal or
+ unenforceable by any court of competent jurisdiction, such provision
+ shall be deemed separable from the remaining provisions of this Agreement
+ and shall not affect or impair the validity or enforceability of the
+ remaining provisions of this Agreement.
+
+ Governing Law. This Agreement is governed by the laws of the
+ Commonwealth of Massachusetts.
+
+ Publicity. You my not use the name of DIGITAL in any advertisement,
+ press release or other publicity with reference to SRC Modula-3
+ without prior written consent of DIGITAL.
+
+ Should you have any questions concerning this Agreement, or if you
+ desire to contact Digital for any reason, please do so via E-mail:
+ M3-REQUEST@SRC.DEC.COM.
+
+ This manual builds on, and incorporates, the work of many people.
+ We've borrowed many ideas from the literature, as documented in the
+ references. But many other people have helped us design, implement,
+ and refine the specific interfaces published in this manual:
+
+ Lyle Ramshaw orchestrated a redesign of the Fmt and Lex
+ interfaces and the addition of the ToDecimal and
+ FromDecimal procedures to the Float generic interface. David
+ Goldberg and Jorge Stolfi consulted. Luca Cardelli designed the first
+ version of Lex (which he called Sift).
+
+ Atom, List, Sx, and Table are similar to
+ Modula-2+ versions designed by John Ellis. Jim Meehan collaborated on
+ the design of Sx. Eric Muller and Jorge Stolfi explored the use
+ of object types and generic interfaces for abstractions such as
+ tables.
+
+ Wr and Rd were designed by Mark R. Brown and Greg Nelson
+ and closely follow the design of the Modula-2+ streams package.
+
+ Pathname borrows from an earlier version written by Eric Muller.
+
+ Jim Horning and John Guttag wrote formal Larch specifications of
+ File.T and its subtypes, and in the process asked questions leading
+ to substantial improvements to the specifications in this manual.
+
+ Mick Jordan helped refine the operating-system interfaces and wrote
+ the first implementations of them.
+
+ WeakRef was greatly improved through long and spirited
+ discussions involving Luca Cardelli, Dave Detlefs, John Ellis, John
+ DeTreville, Mick Jordan, Bill Kalsow, Mark Manasse, Ted Wobber, and
+ Garret Swart. John DeTreville provided the implementation.
+
+ John DeTreville collaborated on the design of RTCollector and
+ the other runtime interfaces.
+
+ Mary-Claire van Leunen encouraged us to begin.
+
+ Finally, this manual was greatly improved by the group of people who
+ read earlier drafts and participated in a running discussion on an
+ electronic bulletin board: Ed Balkovich, Andrew Birrell, Hans Boehm,
+ Marc H. Brown, Mike Burrows, Luca Cardelli, Michel Dagenais, Alan
+ Demers, Dave Detlefs, Mike Dixon, John DeTreville, Steve Freeman,
+ Michel Gangnet, David Goldberg, Judy Hall, Dave Hanson, Carl Hauser,
+ Allan Heydon, Chuck Jerian, Butler Lampson, Mark Manasse, Eric Muller,
+ Hal Murray, David Nichols, Sharon Perl, Dave Redell, Eric Roberts,
+ Robert Sedgewick, Mike Spreitzer, Garret Swart, Samuel Weber, and Ted
+ Wobber.
+
Index: m3/pm3/libs/libm3/src/html/algorithm.html
diff -c /dev/null m3/pm3/libs/libm3/src/html/algorithm.html:1.1
*** /dev/null Tue Feb 10 23:32:06 1998
--- m3/pm3/libs/libm3/src/html/algorithm.html Tue Feb 10 22:44:45 1998
***************
*** 0 ****
--- 1,15 ----
+
+ The standard instances are named IntArraySort and
+ TextArraySort. (There are no instances for Atom.T or
+ REFANY since these types don't have a standard total order.)
+
+
+ Note that the interfaces Text, Real, LongReal,
+ Extended, and Atom (which were presented in the main body of
+ this report) provide Equal, Hash, and Compare
+ procedures.
Index: m3/pm3/libs/libm3/src/html/float.html
diff -c /dev/null m3/pm3/libs/libm3/src/html/float.html:1.1
*** /dev/null Tue Feb 10 23:32:06 1998
--- m3/pm3/libs/libm3/src/html/float.html Tue Feb 10 22:44:46 1998
***************
*** 0 ****
--- 1,86 ----
+
+ For definitions of the terms used in the floating-point interfaces,
+ see the ANSI/IEEE Standard 754-1985, IEEE Standard for Binary
+ Floating-Point Arithmetic.
+ floating-point
+ IEEE floating-point
+
+ The interfaces Real, LongReal, and Extended
+ define constant
+ attributes of the three built-in floating-point types:
+
+ floating-point
+ representation
+
+
+
+ The specification is the same for all three interfaces:
+
+
+ Base is the base of the floating-point representation for T.
+
+ Precision is the number of base-Base digits of precision for T.
+
+ MaxFinite is the maximum finite value in T. For non-IEEE
+ implementations, this is the same as LAST(T).
+
+ MinPos is the minimum positive value in T.
+
+ MinPosNormal is the minimum positive normal value in T; it
+ differs from MinPos only for implementations (like IEEE) with
+ denormalized numbers.
+
+ MaxExpDigits is the smallest integer with the property that
+ every finite number of type T can be written in base-10
+ scientific notation using an exponent with at most MaxExpDigits.
+
+ MaxSignifDigits is the smallest integer with the property that
+ for every point x along the number line, the two
+ floating-decimal numbers with MaxSignifDigits closest to x are
+ closer to each other than are the two closest numbers of type T.
+
+ Typically,
+
+
+ Modula-3 invites you to structure your program as a set of modules
+ interconnected via interfaces. Each interface typically corresponds
+ to an abstract data type. Some of these abstractions are particular
+ to the program at hand, but others are more general. This manual
+ describes a collection of interfaces defining abstractions that SRC's
+ programmers have found useful over a number of years of experience
+ with Modula-3 and its precursors.
+ abstraction
+
+ This manual concentrates on basic abstractions such as the standard
+ interfaces required or recommended by the Modula-3 language
+ definition, various data structures, portable operating-system
+ functions, and control of the Modula-3 runtime. For building
+ distributed systems, see
+ [NetObj] .
+ For building user interfaces,
+ see
+ [Trestle] ,
+ [VBTkit] ,
+ and [FormsVBT] .
+
+
+ We generally give the name T to the main type in an interface. For
+ example, the main type in the Date interface is Date.T.
+
+ type
+ naming conventions for
+
+
+ naming conventions
+ types
+
+
+ T type
+ T type
+
+
+ type
+ T
+ T
+
+
+ Most object types have a method that is responsible for initializing
+ the object. By convention, this method is named init, and returns
+ the object after initializing it, so that the object can be
+ initialized and used in an expression at the same time: for example,
+
+
+ initializing an object
+
+
+ init method
+ initmethod
+
+ If there are several different ways to initialize the object, there
+ will be several methods. The most basic will be named init and the
+ others will receive descriptive names. For example, Sequence.T.init
+ initializes an empty sequence; Sequence.T.fromArray initializes a
+ sequence from an array.
+
+ Many of our types are ``abstract'' in the sense that they define the
+ methods of a type, but not their implementations. Various subtypes of
+ the abstract type define different methods corresponding to different
+ instances of the abstract type. For example, the type Rd.T is a
+ abstract reader (a stream of input characters). Its subtype
+ FileRd.T is a reader whose source is a file; its subtype TextRd.T
+ is a reader whose source is a text string.
+
+ abstract type
+
+
+ subtype
+
+
+ If you allocate an object of an abstract type and attempt to use it,
+ you will almost certainly get a checked runtime error, since its
+ methods will be NIL. Therefore, you must read the interfaces to
+ find out which types are abstract and which are concrete. The typical
+ pattern is that an abstract type does not have an init method, but
+ each of its concrete instances does. This allows different subtypes
+ to be initialized differently. For example, FileRd.T has an init
+ method that takes a file; TextRd.T has an init method that takes a
+ text; and Rd.T has no init method at all.
+
+ For some abstract types we choose to honor one of its subtypes as a
+ ``default implementation''. For example, we provide a hash table
+ implementation as the default for the abstract type Table.T. In
+ this case we vary the naming convention: instead of a separate
+ interface HashTable defining the concrete type HashTable.T as a
+ subtype of Table.T, we declare the default concrete type in the same
+ interface with the abstract type and give it the name Default. Thus
+ Table.T and Table.Default are respectively the abstract table type
+ and its default implementation via hash tables. If you want to
+ allocate a table you must allocate a Table.Default, not a Table.T.
+ On the other hand, if you are defining a procedure that requires a
+ table as a parameter, you probably want to declare the parameter as a
+ Table.T, not a Table.Default, to avoid excluding other table
+ implementations.
+
+ Default type
+ Default type
+
+
+ type
+ Default
+ Default
+
+
+ We use abstract types only when they seem advantageous. Thus the type
+ Sequence.T, which represents an extensible sequence, could have been
+ an abstract type, since different implementations are easy to imagine.
+ But engineering considerations argue against multiple implementations,
+ so we declared Sequence.T as a concrete type.
+
+
+ The specification of a Modula-3 interface must explain how to use the
+ interface in a multithreaded program. When not otherwise specified,
+ each procedure or method is atomic: it transforms an initial
+ state to a final state with no intermediate states that can be
+ observed by other threads.
+
+ concurrency
+
+
+ atomic execution
+ of procedures and methods
+
+
+ monitored data structure
+
+
+ Alternatively, a data structure (the state of an entire interface, or
+ of a particular instance of an object type) can be specified as
+ unmonitored, in which case the procedures and methods operating on it
+ are not necessarily atomic. In this case it is the client's
+ responsibility to ensure that multiple threads are not accessing the
+ data structure at the same time---or more precisely, that this happens
+ only if all the concurrent accesses are read-only operations. Thus for
+ an unmonitored data structure, the specification must state which
+ procedures or methods are read-only.
+
+ If all operations are read-only, there is no difference between
+ monitored and unmonitored data structures.
+
+
+ The procedures and methods defined in this manual are not guaranteed
+ to work with aliased VAR parameters.
+
+ aliasing of VAR parameters
+ aliasing of VAR parameters
+
+
+
+ It is often useful for an exception to include a parameter providing
+ debugging information of use to the programmer, especially when the
+ exception signals abstraction failure. Different implementations of
+ an abstract type may wish to supply different debugging information.
+ By convention, we use the type AtomList.T for this purpose. The
+ first element of the list is an error code; the specification of the
+ subsequent elements is deferred to the subtypes. Portable modules
+ should treat the entire parameter as an opaque type.
+
+ An implementation module can minimize the probability of collision by
+ prefixing its module name to each atom that it includes in the list.
+
+
+ Several of the interfaces in this manual are generic. Unless
+ otherwise specified, standard instances of these interfaces are
+ provided for all meaningful combinations of the formal imports ranging
+ over Atom, Integer, Refany, and Text.
+
+ standard instances of generic interfaces
+
+
+ For each interface that is likely to be used as a generic parameter,
+ we define procedures Equal, Compare, and Hash.
+
+ The procedure Equal must compute an equivalence relation on the
+ values of the type; for example, Text.Equal(t, s) tests whether t
+ and s represent the same string. (This is different from t = s,
+ which tests whether t and s are the same reference.)
+
+ Equal procedure
+ Equal procedure
+
+
+ If there is a natural total order on a type, then we define a
+ Compare procedure to compute it, as follows:
+
+ Compare procedure
+ Compare procedure
+
+
+
+ (Technically, Compare represents a total order on the equivalence
+ classes of the type with respect to Equal.) If there is no natural
+ order, we define a Compare procedure that causes a checked runtime
+ error. This allows you to instantiate generic routines that require
+ an order (such as sorting routines), but requires you to pass a
+ compare procedure as an explicit argument when calling the generic
+ routine.
+
+ The function Hash is a hash function mapping values of a type T to
+ values of type Word.T. This means that (1) it is time-invariant,
+ (2) if t1 and t2 are values of type T such that Equal(t1, t2),
+ then Hash(t1) = Hash(t2), and (3) its range is distributed uniformly
+ throughout Word.T.
+
+ Hash procedure
+ Hash procedure
+
+
+ Note that it is not valid to use LOOPHOLE(r, INTEGER) as a hash
+ function for a reference r, since this is not time-invariant on
+ implementations that use copying garbage collectors.
+
+ hashing references
+
+
+
+ The specifications in this manual are written informally but
+ precisely, using basic mathematical concepts. For completeness, here
+ are definitions of these concepts.
+
+ A set is a collection of elements, without consideration of
+ ordering or duplication: two sets are equal if and only if they
+ contain the same elements.
+
+ set
+
+
+ If X and Y are sets, a map m from X to Y uniquely
+ determines for each x in X an element y in Y; we write y =
+ m(x). We refer to the set X as the domain of m, or
+ dom(m) for short, and the set Y as the range of m. A
+ partial map from X to Y is a map from some subset of X to Y.
+
+ map
+
+
+ function: map
+
+
+ domain
+
+
+ range
+
+
+ If X is a set, a relation R on X is a set of ordered pairs
+ (x, y) with x and y elements of X. We write x R y if
+ (x, y) is an element of R.
+
+ relation
+
+
+ A relation R on X is reflexive if x R x for every x in
+ X; it is symmetric if x R y implies that y R x for every
+ x, y in X; it is transitive if x R y and y R z imply
+ x R z for every x, y, z in X; and it is an equivalence
+ relation if it is reflexive, symmetric, and transitive.
+
+ equivalence relation
+
+
+ relation
+ equivalence
+
+
+ A relation R on X is antisymmetric if for every x and y
+ in X, x = y whenever both x R y and y R x; R is a total
+ order if it is reflexive, antisymmetric, transitive, and if, for
+ every x and y in X, either x R y or y R x.
+
+ total order
+
+
+ relation
+ total order
+
+
+ If x and y are elements of a set X that is totally ordered by a
+ relation R, we define the interval [x..y] as the set of all
+ z in X such that x R z and z R y. Note that the notation
+ doesn't mention R, which is usually clear from the context (e.g.,
+ lower or equal for numbers). We say [x..y] is closed at its upper and
+ lower endpoints because it includes x and y. Half-open and open
+ intervals exclude one or both endpoints; notationally we substitute a
+ parenthesis for the corresponding bracket, for example [x..y) or
+ (x..y).
+
+ interval
+
+
+ A sequence s is a map whose domain is a set of consecutive
+ integers. In other words, if dom(s) is not empty, there are
+ integers l and u, with l<=u, such that dom(s) is [l..u]. We
+ often write s[i] instead of s(i), to emphasize the similarity to a
+ Modula-3 array. If the range of s is Y, we refer to s as a
+ sequence of Y's. The length of a sequence s, or len(s),
+ is the number of elements in dom(s).
+
+ sequence
+
+
+ In the specifications, we often speak of assigning to an element of a
+ sequence or map, which is really a shorthand for replacing the
+ sequence or map with a suitable new one. That is, assigning m(i) :=
+ x is like assigning m := m', where dom(m') is the union of
+ dom(m) and {i}, where m'(i) = x, and where m'(j) = m(j) for
+ all j different from i and in dom(m).
+
+ If s is a finite sequence, and R is a total order on the range of
+ s, then sorting s means to reorder its elements so that for
+ every pair of indexes i and j in dom(s), s[i] R s[j] whenever
+ i <= j. We say that a particular sorting algorithm is stable
+ if it preserves the original order of elements that are equivalent
+ under R.
+
+ sorting
+
+
+ stability of sorting algorithm
+
+
+
Index: m3/pm3/libs/libm3/src/html/io.html
diff -c /dev/null m3/pm3/libs/libm3/src/html/io.html:1.1
*** /dev/null Tue Feb 10 23:32:06 1998
--- m3/pm3/libs/libm3/src/html/io.html Tue Feb 10 22:44:46 1998
***************
*** 0 ****
--- 1,36 ----
+
+ The interfaces Wr and Rd provide object-oriented output
+ and input streams, called writers and readers. These were
+ invented by Stoy and Strachey in 1972
+ [OS6part2] .
+ The versions
+ presented here are slight modifications of the versions in the first
+ Modula-3 book [SPwM3] .
+ We also present related interfaces for
+ obtaining writers and readers connected to texts or files (
+ TextWr, TextRd, FileWr, and FileRd), for accessing
+ standard streams (Stdio), and for performing I/O in simple
+ programs (IO). The interfaces FileWr and FileRd
+ supersede the interface FileStream in
+ [SPwM3] .
+
+
+ I/O
+ buffered streams
+
+
+ stream
+
+
+
+ The interfaces in this section provide access to operating system
+ facilities: timekeeping, files, pathnames, directories, and processes.
+ The interfaces are intended to be implementable at least on POSIX
+ [POSIX] and Win32
+ [Win32] systems.
+
+
+ The interfaces RealFloat, LongRealFloat, and ExtendedFloat
+ define operations that depend on the floating-point representation.
+ Each one is an instance of a generic interface Float:
+
+ floating-point
+ operations
+
+
+
+ The remaining interfaces in this section provide the low-level
+ features needed to implement pickles and network objects. Most
+ programmers won't directly use any of these interfaces.
+
+
+ This section presents the interfaces required by every Modula-3
+ implementation. The versions included here have some minor changes
+ and additions to the versions in [SPwM3] .
+
+ Text provides operations on text strings.
+
+ Thread provides synchronization primitives for multiple
+ threads of control.
+
+ Word provides operations on unsigned words.
+
+ Real, LongReal, and ExtendedReal define the
+ properties of the three floating-point types; for example, their
+ bases and ranges.
+
+ RealFloat, LongRealFloat, and ExtendedFloat
+ provide numerical operations related to the floating-point
+ representation; for example, extracting the exponent of a number.
+
+ FloatMode provides operations for testing (and possibly
+ setting) the behavior of the implementation in response to numeric
+ conditions; for example, overflow.
+
+ This section also presents two related interfaces provided by SRC
+ Modula-3 and recommended to other implementers, but not required:
+
+ Lex provides for parsing numbers and other data from an
+ input stream.
+
+ Fmt provides for textual formatting of numbers and other data.
+
+ The standard instances are named AtomSeq, IntSeq,
+ RefSeq, and TextSeq.
+
+
+ The standard instances are named AtomList, IntList,
+ RefList, and TextList.
+
+
+ The standard instances are named AtomListSort,
+ IntListSort, RefListSort, and TextListSort.
+ AtomListSort and RefListSort are useful only if you supply a
+ non-default comparison procedure.
+
+
+ The standard instances are named xyTbl, for all combinations of
+ x and y in the set {Atom, Int, Ref, Text}. The
+ instances with x = Ref are useful only if you define a subtype
+ overriding the keyHash and keyEqual methods.
+
+
+ The standard instances are named SortedxyTbl, for all
+ combinations of x and y in the set {Atom, Int, Ref,
+ Text}. The instances with x = Atom and x = Ref are
+ useful only if you define a subtype overriding the keyCompare
+ method.
+
+ This manual describes a collection of interfaces defining abstractions
+ that SRC's programmers have found useful over a number of years of
+ experience with Modula-3 and its precursors. We hope the interfaces
+ will be useful as a ``starter kit'' of abstractions, and as a model
+ for designing and specifying abstractions in Modula-3.
+ This library contains the Modula-3 required interfaces,
+ core runtime services (garbage collection,
+ threads, runtime checking) and supporting modules. It encapsulates almost
+ all the platform specific code.
+ A few mature and commonly used interfaces also belong to m3core.
+
+ This section contains general purpose libraries for Data Structures,
+ memory management, input output, operating system access, and miscellaneous
+ other topics not covered in the other sections.
+ This section contains electronic mail related applications and libraries.
+ Network objects offer transparent remote method invocation on objects.
+ Network objects are simpler to use than remote procedure calls because
+ objects store the remote connection information, and the runtime handles
+ automatically the external data representation used to exchange
+ parameters during remote calls.
+ The package server updates several remote package repositories in
+ a coherent manner.
+ This section contains network related applications and libraries.
+ This section contains internet protocol (TCP/IP) related libraries.
+ This section contains World Wide Web libraries and applications.
+ A printable version of this documentation is available
- [m3doc] This system organizes the documentation of Modula-3 packages.
The documentation consists in HTML hypertext files and Modula-3 interfaces
--- 24,29 ----
Index: m3/pm3/text/sgmltools/m3doc/src/m3doc.tmpl
diff -c m3/pm3/text/sgmltools/m3doc/src/m3doc.tmpl:1.3 m3/pm3/text/sgmltools/m3doc/src/m3doc.tmpl:1.4
*** m3/pm3/text/sgmltools/m3doc/src/m3doc.tmpl:1.3 Thu Jan 29 10:31:48 1998
--- m3/pm3/text/sgmltools/m3doc/src/m3doc.tmpl Tue Feb 10 22:41:38 1998
***************
*** 54,60 ****
if defined("_all")
htmlFiles += src_file
end
! _install_src(src_file,dest,"0644")
end
end
--- 54,60 ----
if defined("_all")
htmlFiles += src_file
end
! _install_file(nm,dest,"0644","")
end
end
***************
*** 92,104 ****
end
end
! m3docOldM3Hooks = before_do_m3_hooks
!
! proc before_do_m3_hooks() is
! m3docOldM3Hooks()
if callSgmlConv checkExec(sgmlConvCmd,[],"") end
if callM3Sgml checkExec(m3SgmlCmd,[],"") end
end
readonly proc HtmlRoot (nm) is
if USE_M3DOC
--- 92,103 ----
end
end
! proc m3doc_hook() is
if callSgmlConv checkExec(sgmlConvCmd,[],"") end
if callM3Sgml checkExec(m3SgmlCmd,[],"") end
end
+
+ add_m3_hook(m3doc_hook)
readonly proc HtmlRoot (nm) is
if USE_M3DOC
Index: m3/pm3/text/sgmltools/sgml/src/index.html
diff -c m3/pm3/text/sgmltools/sgml/src/index.html:1.1.1.1 m3/pm3/text/sgmltools/sgml/src/index.html:1.2
*** m3/pm3/text/sgmltools/sgml/src/index.html:1.1.1.1 Sat Jan 17 09:26:50 1998
--- m3/pm3/text/sgmltools/sgml/src/index.html Tue Feb 10 22:41:43 1998
***************
*** 19,27 ****
A printable version of this documentation is available
- [sgml]
This library reads SGML document types definitions and parses SGML files
--- 19,24 ----
Index: m3/pm3/text/sgmltools/sgmlconv/src/Main.m3
diff -c m3/pm3/text/sgmltools/sgmlconv/src/Main.m3:1.2 m3/pm3/text/sgmltools/sgmlconv/src/Main.m3:1.3
*** m3/pm3/text/sgmltools/sgmlconv/src/Main.m3:1.2 Thu Jan 29 10:32:05 1998
--- m3/pm3/text/sgmltools/sgmlconv/src/Main.m3 Tue Feb 10 22:41:48 1998
***************
*** 23,29 ****
IMPORT SGML, SGMLPrint, Stdio, Params, Text, Wr, Rd, Thread, TextIntTbl,
TextWr, TextRd, Fmt, Lex, OSError, FileRd, FileWr, TextSeq, IntSeq,
! Pathname;
TYPE
Translate = SGML.Application OBJECT
--- 23,29 ----
IMPORT SGML, SGMLPrint, Stdio, Params, Text, Wr, Rd, Thread, TextIntTbl,
TextWr, TextRd, Fmt, Lex, OSError, FileRd, FileWr, TextSeq, IntSeq,
! Pathname, Process, FS, File, RegularFile;
TYPE
Translate = SGML.Application OBJECT
***************
*** 92,97 ****
--- 92,98 ----
markedSectionEnd := MarkedSectionEndF;
ignoredChars := IgnoredCharsF;
generalEntity := GeneralEntityF;
+ error := ErrorProc;
openEntityChange:= OpenEntityChangeF;
END;
***************
*** 212,222 ****
BEGIN
END GeneralEntity;
! PROCEDURE ErrorProc(self: Translate; READONLY e: SGML.ErrorEvent) =
VAR
position := self.getDetailedLocation(e.pos);
BEGIN
! Wr.PutText(Stdio.stderr,"ERROR: " & e.message & " in file " &
position.filename & " line " & Fmt.Int(position.lineNumber) &
" column " & Fmt.Int(position.columnNumber));
IF position.entityName # NIL THEN
--- 213,231 ----
BEGIN
END GeneralEntity;
! PROCEDURE ErrorProc(self: SGML.Application; READONLY e: SGML.ErrorEvent) =
VAR
position := self.getDetailedLocation(e.pos);
+ msg: TEXT;
BEGIN
! IF e.type <= SGML.ErrorType.Warning THEN
! msg := "WARNING";
! ELSE
! msg := "ERROR";
! INC(nbErrors);
! END;
!
! Wr.PutText(Stdio.stderr,msg & ": " & e.message & " in file " &
position.filename & " line " & Fmt.Int(position.lineNumber) &
" column " & Fmt.Int(position.columnNumber));
IF position.entityName # NIL THEN
***************
*** 260,265 ****
--- 269,282 ----
valid, plus, found: BOOLEAN;
action: Special;
BEGIN
+ IF verbose >= 2 THEN
+ WITH position = self.getDetailedLocation(e.pos) DO
+ Wr.PutText(Stdio.stdout,"In file " & position.filename & " line " &
+ Fmt.Int(position.lineNumber) & " column " &
+ Fmt.Int(position.columnNumber) & "\n");
+ END;
+ END;
+
IF self.math AND (NOT self.skip) AND
HTMLtoTeXtbl[self.tagStack.gethi()].action = Special.MathArgs THEN
Wr.PutText(self.wr,"{");
***************
*** 1634,1639 ****
--- 1651,1664 ----
action: SpecialF;
n: INTEGER;
BEGIN
+ IF verbose >= 2 THEN
+ WITH position = self.getDetailedLocation(e.pos) DO
+ Wr.PutText(Stdio.stdout,"In file " & position.filename & " line " &
+ Fmt.Int(position.lineNumber) & " column " &
+ Fmt.Int(position.columnNumber) & "\n");
+ END;
+ END;
+
INC(self.depth);
name := e.gi;
***************
*** 1707,1728 ****
DEC(self.depth);
END EndElementF;
! (* Two adjustments are required for hypertext references: links to other
packages must account for the hierarchy being flattened upon installation,
some files are translated upon translation and their extension changes
! accordingly. The updated value of the hypertext reference is changed
in place within "e". *)
! PROCEDURE AdjustHref(<*UNUSED*>self: HTMLtoHTML;
! READONLY e: SGML.StartElementEvent) =
VAR
! href: TEXT;
hrefLen, extLen: CARDINAL;
pathseq, hrefseq, newseq: TextSeq.T;
! pkgNamePos := -1;
BEGIN
IF NOT GetAttributeValue(e.attributes,"HREF",href) THEN RETURN; END;
(* The package hierarchy gets flattened in the installation. Links
must be redirected appropriately when the -path option is set and
we have a relative link which points outside of the current package. *)
--- 1732,1807 ----
DEC(self.depth);
END EndElementF;
! (* Three adjustments are required for hypertext references: links to other
packages must account for the hierarchy being flattened upon installation,
some files are translated upon translation and their extension changes
! accordingly, and links to directories may need to point to the index.html
! file within. The updated value of the hypertext reference is changed
in place within "e". *)
! VAR error: TEXT; (* The optimizer does not see exceptions and tries to
! be smart with local variables... *)
!
! PROCEDURE AdjustHref(self: HTMLtoHTML; READONLY e: SGML.StartElementEvent) =
VAR
! href, newref: TEXT;
hrefLen, extLen: CARDINAL;
pathseq, hrefseq, newseq: TextSeq.T;
! pkgNamePos, dashPos := -1;
! status: File.Status;
BEGIN
IF NOT GetAttributeValue(e.attributes,"HREF",href) THEN RETURN; END;
+ IF Text.FindChar(href,'#') = 0 THEN RETURN; END; (* internal link *)
+
+ (* Local links (without a ':') are checked to see if they are valid and
+ if they refer to a directory. *)
+
+ IF Text.FindChar(href,':') < 0 THEN
+ TRY
+ (* Local links must be relative *)
+
+ error := "incorrect HREF (non relative link) ";
+ IF Pathname.Absolute(href) THEN RAISE OSError.E(NIL); END;
+
+ (* Extract the file name (up to '#') and check if it exists relative
+ to the prefix of the input file name (inPrefix). *)
+
+ error := "incorrect HREF ";
+
+ dashPos := Text.FindChar(href,'#');
+ IF dashPos >= 0 THEN
+ status :=FS.Status(Pathname.Join(inPrefix,Text.Sub(href,0,dashPos)));
+ ELSE
+ status := FS.Status(Pathname.Join(inPrefix,href));
+ END;
+
+ (* The file exists but is a directory. In that case, a tag address
+ ('#') is not acceptable. Perhaps the directory contains an
+ index.html file to which we should point. *)
+
+ IF status.type = FS.DirectoryFileType THEN
+ IF dashPos >= 0 THEN RAISE OSError.E(NIL); END;
+
+ newref := Pathname.Join(href,"index",".html");
+ error := NIL;
+ status := FS.Status(Pathname.Join(inPrefix,newref));
+
+ (* If there is an index.html, check that it is a regular file *)
+
+ error := "invalid HREF (not a regular file) ";
+ IF status.type # RegularFile.FileType THEN RAISE OSError.E(NIL);END;
+ href := newref;
+ END;
+ EXCEPT
+ | OSError.E =>
+ IF error # NIL THEN
+ self.error(SGML.ErrorEvent{0,SGML.ErrorType.Warning,error
+ & href});
+ END;
+ END;
+ END;
+
(* The package hierarchy gets flattened in the installation. Links
must be redirected appropriately when the -path option is set and
we have a relative link which points outside of the current package. *)
***************
*** 1750,1756 ****
added to get out of the current package. *)
IF newseq # NIL THEN
! newseq.addhi(hrefseq.getlo()); (* initial NIL arc *)
newseq.addhi(Pathname.Parent); (* get out of the package dir *)
FOR i := 1 TO pathseq.size() - 1 DO
IF NOT Text.Equal(hrefseq.get(i),Pathname.Parent) THEN
--- 1829,1835 ----
added to get out of the current package. *)
IF newseq # NIL THEN
! newseq.addhi(hrefseq.remlo()); (* initial NIL arc *)
newseq.addhi(Pathname.Parent); (* get out of the package dir *)
FOR i := 1 TO pathseq.size() - 1 DO
IF NOT Text.Equal(hrefseq.get(i),Pathname.Parent) THEN
***************
*** 1895,1900 ****
--- 1974,1980 ----
IF file = 0 THEN
in := FileRd.Open(arg);
inName := arg;
+ inPrefix := Pathname.Prefix(inName);
ELSIF file = 1 THEN
out := FileWr.Open(arg);
outName := arg;
***************
*** 1913,1921 ****
--- 1993,2008 ----
options.defaultDoctype := "HTML";
ELSIF Text.Equal (arg, "-report") THEN
report := TRUE;
+ ELSIF Text.Equal (arg, "-keep") THEN
+ discard := FALSE;
ELSIF Text.Equal (arg, "-v") THEN
options.enableWarning := NEW(REF ARRAY OF TEXT,1);
options.enableWarning[0] := "all";
+ verbose := 1;
+ ELSIF Text.Equal (arg, "-vv") THEN
+ options.enableWarning := NEW(REF ARRAY OF TEXT,1);
+ options.enableWarning[0] := "all";
+ verbose := 2;
ELSIF Text.Equal (arg, "-r") THEN
IF currentParam + 1 >= Params.Count THEN
RAISE UsageError("Missing argument for -r");
***************
*** 1962,1972 ****
END;
VAR
replacements := NEW(TextSeq.T).init();
dtdDirs := NEW(TextSeq.T).init();
in: Rd.T;
out: Wr.T;
! inName, outName: TEXT;
patterns: REF ARRAY OF Pattern;
options: SGML.ParserOptions;
firstParser, parser: SGML.Parser := NIL;
--- 2049,2060 ----
END;
VAR
+ verbose := 0;
replacements := NEW(TextSeq.T).init();
dtdDirs := NEW(TextSeq.T).init();
in: Rd.T;
out: Wr.T;
! inName, outName, inPrefix: TEXT;
patterns: REF ARRAY OF Pattern;
options: SGML.ParserOptions;
firstParser, parser: SGML.Parser := NIL;
***************
*** 1976,1987 ****
--- 2064,2080 ----
rds := NEW(REF ARRAY OF Rd.T,1);
path: TEXT;
report := FALSE;
+ nbErrors: CARDINAL;
+ discard, noErrors := TRUE;
BEGIN
TRY
WHILE ParseOptions() DO
files[0] := inName;
rds[0] := in;
+ IF verbose > 0 THEN
+ Wr.PutText(Stdio.stdout,"sgmlconv: " & inName & " -> " &outName& "\n");
+ END;
IF parser = NIL THEN
parser := NEW(SGML.Parser);
***************
*** 1996,2011 ****
ELSIF Text.Equal(conversion,"htmlhtml") THEN
converter := NEW(HTMLtoHTML, wr := out).init();
END;
EVAL parser.run(converter);
Rd.Close(in);
Wr.Close(out);
END;
EXCEPT
| UsageError(t) =>
Wr.PutText(Stdio.stderr,
t & "\n? usage: sgmlconv [-htmltex|-htmlhtml] [-r old new] [-path p]... " &
! "[-dtd dtdSearchPath] [-report] [infile] [outfile]\n");
| Rd.Failure =>
Wr.PutText(Stdio.stderr,"? Unable to read file\n");
END;
END Main.
--- 2089,2123 ----
ELSIF Text.Equal(conversion,"htmlhtml") THEN
converter := NEW(HTMLtoHTML, wr := out).init();
END;
+
+ nbErrors := 0;
EVAL parser.run(converter);
Rd.Close(in);
Wr.Close(out);
+
+ IF nbErrors # 0 THEN
+ noErrors := FALSE;
+ IF discard AND out # Stdio.stdout THEN
+ FS.DeleteFile(outName);
+ END;
+ END;
END;
EXCEPT
| UsageError(t) =>
Wr.PutText(Stdio.stderr,
t & "\n? usage: sgmlconv [-htmltex|-htmlhtml] [-r old new] [-path p]... " &
! "[-dtd dtdSearchPath] [-report] [-v] [-vv] [-keep] [infile]" &
! " [outfile]\n");
| Rd.Failure =>
Wr.PutText(Stdio.stderr,"? Unable to read file\n");
+ | OSError.E =>
+ Wr.PutText(Stdio.stderr,"Error while processing " & inName & " to " &
+ outName & "\n");
END;
+ IF noErrors = FALSE THEN Process.Exit(1); END;
END Main.
+
+
+
+
+
Index: m3/pm3/text/src/index.html
diff -c /dev/null m3/pm3/text/src/index.html:1.1.1.1
*** /dev/null Tue Feb 10 23:33:03 1998
--- m3/pm3/text/src/index.html Sat Jan 31 14:47:15 1998
***************
*** 0 ****
--- 1,39 ----
+ This section contains text and documentation processing libraries and
+ tools.
+
--- 57,63 ----
move even more functionality into Modula-3 code. Here is a whish
list. I will not have time in the foreseeable future to do
any of it. Volunteers are more than welcome. Thanks to
! Lennart Staflin <lenst@lysator.liu.se> for converting the xemacs menus
to emacs and miscellaneous elisp code improvements.
Index: m3/pm3/language/modula3/m3tools/pp/src/index.html
diff -c /dev/null m3/pm3/language/modula3/m3tools/pp/src/index.html:1.2
*** /dev/null Tue Feb 10 23:31:51 1998
--- m3/pm3/language/modula3/m3tools/pp/src/index.html Tue Feb 10 22:58:34 1998
***************
*** 0 ****
--- 1,326 ----
+
+
+
Pretty printing
+
+
+ m3pp [options] [file]
+
+
+ Options
+
+
+
+
+
+ 1: AlongFunctionCall(
+ withLongParameters, likeThisOne, andThisOne);
+
+ 2: AlongFunctionCall(withLongParameters, likeThisOne,
+ andThisOne);
+
+
+
+ CONST
+ maxElements = 3;
+ (* limit for number of elements *)
+ PROCEDURE AddOne(e: INTEGER);
+
+
+ CONST
+ maxElements = 3;
+ (* Add an element. *)
+ PROCEDURE AddOne(e: INTEGER);
+
+
+ CONST
+ maxElements = 3;
+
+ (* Add an element. *)
+ PROCEDURE AddOne(e: INTEGER);
+
+ Features
+
+ Syntax errors
+
+ Exceptions
+
+ Bugs
+
+ Authors
+
+
+ Last modified on Thu Jan 4 11:08:00 PST 1996 by heydon
+ modified on Fri Apr 22 11:28:06 PDT 1994 by kalsow
+ modified on Mon Aug 19 14:46:51 1991 by Nichols@xerox.com
+ modified on Thu Dec 21 01:33:47 1989 by muller
+
+
+
+
+
Index: m3/pm3/language/modula3/m3tools/pp/src/m3makefile
diff -c m3/pm3/language/modula3/m3tools/pp/src/m3makefile:1.2 m3/pm3/language/modula3/m3tools/pp/src/m3makefile:1.3
*** m3/pm3/language/modula3/m3tools/pp/src/m3makefile:1.2 Mon Sep 29 18:45:52 1997
--- m3/pm3/language/modula3/m3tools/pp/src/m3makefile Tue Feb 10 22:58:34 1998
***************
*** 34,39 ****
--- 34,42 ----
module ("NewFormatter")
implementation ("Main")
+ import("m3doc")
+ HtmlFile("index")
+
Program ("m3pp")
ManPage ("m3pp",1)
Index: m3/pm3/language/modula3/m3tools/pp/src/flex-bison/m3makefile
diff -c m3/pm3/language/modula3/m3tools/pp/src/flex-bison/m3makefile:1.3 m3/pm3/language/modula3/m3tools/pp/src/flex-bison/m3makefile:1.4
*** m3/pm3/language/modula3/m3tools/pp/src/flex-bison/m3makefile:1.3 Wed Dec 3 13:12:33 1997
--- m3/pm3/language/modula3/m3tools/pp/src/flex-bison/m3makefile Tue Feb 10 22:58:40 1998
***************
*** 14,23 ****
%
if defined ("_all")
! if stale ("y.tab.o", "../src/flex-bison/y.tab.c")
! or stale ("y.tab.o", "../src/flex-bison/lex.yy.c")
! or stale ("y.tab.o", "../src/hash.h")
! or stale ("y.tab.o", "../src/lex_help.h")
delete_file ("y.tab.o")
end
end
--- 14,23 ----
%
if defined ("_all")
! if stale ("y.tab.o", ".." & SL & "src" & SL & "flex-bison" & SL & "y.tab.c")
! or stale ("y.tab.o",".." & SL & "src" & SL & "flex-bison" & SL & "lex.yy.c")
! or stale ("y.tab.o", ".." & SL & "src" & SL & "hash.h")
! or stale ("y.tab.o", ".." & SL & "src" & SL & "lex_help.h")
delete_file ("y.tab.o")
end
end
Index: m3/pm3/language/modula3/m3tools/pp/src/lex-yacc/m3makefile
diff -c m3/pm3/language/modula3/m3tools/pp/src/lex-yacc/m3makefile:1.2 m3/pm3/language/modula3/m3tools/pp/src/lex-yacc/m3makefile:1.3
*** m3/pm3/language/modula3/m3tools/pp/src/lex-yacc/m3makefile:1.2 Mon Sep 29 18:47:50 1997
--- m3/pm3/language/modula3/m3tools/pp/src/lex-yacc/m3makefile Tue Feb 10 22:58:43 1998
***************
*** 14,23 ****
%
if defined ("_all")
! if stale ("y.tab.o", "../src/lex-yacc/y.tab.c")
! or stale ("y.tab.o", "../src/lex-yacc/lex.yy.c")
! or stale ("y.tab.o", "../src/hash.h")
! or stale ("y.tab.o", "../src/lex_help.h")
delete_file ("y.tab.o")
end
end
--- 14,23 ----
%
if defined ("_all")
! if stale ("y.tab.o", ".." & SL & "src" & SL & "lex-yacc" & SL & "y.tab.c")
! or stale ("y.tab.o", ".." & SL & "src" & SL & "lex-yacc" & SL & "lex.yy.c")
! or stale ("y.tab.o", ".." & SL & "src" & SL & "hash.h")
! or stale ("y.tab.o", ".." & SL & "src" & SL & "lex_help.h")
delete_file ("y.tab.o")
end
end
Index: m3/pm3/language/modula3/m3tools/showheap/src/index.html
diff -c /dev/null m3/pm3/language/modula3/m3tools/showheap/src/index.html:1.2
*** /dev/null Tue Feb 10 23:31:52 1998
--- m3/pm3/language/modula3/m3tools/showheap/src/index.html Tue Feb 10 22:58:47 1998
***************
*** 0 ****
--- 1,84 ----
+
+
+ showheap
+
+
+ foo @M3showheap
+
+
+
+
+ shownew
+
+
+ foo @M3shownew
+
+
+ foo @M3shownew @M3update=5
+
+
+
+
+
Index: m3/pm3/language/modula3/m3tools/shownew/src/m3makefile
diff -c m3/pm3/language/modula3/m3tools/shownew/src/m3makefile:1.2 m3/pm3/language/modula3/m3tools/shownew/src/m3makefile:1.3
*** m3/pm3/language/modula3/m3tools/shownew/src/m3makefile:1.2 Tue Jan 28 12:24:33 1997
--- m3/pm3/language/modula3/m3tools/shownew/src/m3makefile Tue Feb 10 22:58:51 1998
***************
*** 10,15 ****
--- 10,18 ----
module ("ZIO")
implementation ("ShowNew")
+
+ HtmlFile("index")
+
Program ("shownew")
ManPage ("shownew", 1)
Index: m3/pm3/language/modula3/m3tools/showthread/src/index.html
diff -c /dev/null m3/pm3/language/modula3/m3tools/showthread/src/index.html:1.2
*** /dev/null Tue Feb 10 23:31:54 1998
--- m3/pm3/language/modula3/m3tools/showthread/src/index.html Tue Feb 10 22:58:54 1998
***************
*** 0 ****
--- 1,53 ----
+
+
+ showthread
+
+
+ foo @M3showthread
+
+
+ - running: currently running
+ - alive: can run, but is not currently running
+ - waiting: waiting for a condition to be signaled
+ - locking: waiting for a mutex to be released
+ - pausing: pausing for some time (via Thread.Pause)
+ - blocking: waiting for I/O activity (via SchedulerPosix.IOWait)
+ - dying: the thread returned, but nobody joined it yet
+
+
+
+
+
Index: m3/pm3/language/modula3/m3tools/showthread/src/m3makefile
diff -c m3/pm3/language/modula3/m3tools/showthread/src/m3makefile:1.2 m3/pm3/language/modula3/m3tools/showthread/src/m3makefile:1.3
*** m3/pm3/language/modula3/m3tools/showthread/src/m3makefile:1.2 Tue Jan 28 12:24:33 1997
--- m3/pm3/language/modula3/m3tools/showthread/src/m3makefile Tue Feb 10 22:58:55 1998
***************
*** 7,12 ****
--- 7,15 ----
import ("ui")
implementation ("Main")
+
+ HtmlFile("index")
+
Program ("showthread")
ManPage ("showthread", 1)
Index: m3/pm3/language/modula3/m3tools/src/index.html
diff -c /dev/null m3/pm3/language/modula3/m3tools/src/index.html:1.1.1.1
*** /dev/null Tue Feb 10 23:31:54 1998
--- m3/pm3/language/modula3/m3tools/src/index.html Sat Jan 31 14:47:13 1998
***************
*** 0 ****
--- 1,64 ----
+
+
+ Ecole Polytechnique
+ C.P. 6079, Succ. Centre-Ville
+ Montreal, Quebec, H3C 3A7
+ 18 January 1998
+ tools
+ modula-3
+ programming
+ performance
+ analysis
+ wide audience
+ Modula-3 Programming tools
+
+
+
+
+
+
Index: m3/pm3/language/modula3/m3tools/src/m3makefile
diff -c /dev/null m3/pm3/language/modula3/m3tools/src/m3makefile:1.2
*** /dev/null Tue Feb 10 23:31:54 1998
--- m3/pm3/language/modula3/m3tools/src/m3makefile Tue Feb 10 22:58:58 1998
***************
*** 0 ****
--- 1,7 ----
+
+ import("m3doc")
+
+ HtmlFile("index")
+
+ OtherPackage("m3tools")
+
Index: m3/pm3/language/modula3/src/index.html
diff -c /dev/null m3/pm3/language/modula3/src/index.html:1.2
*** /dev/null Tue Feb 10 23:31:54 1998
--- m3/pm3/language/modula3/src/index.html Tue Feb 10 22:59:02 1998
***************
*** 0 ****
--- 1,52 ----
+
+
+ Ecole Polytechnique
+ C.P. 6079, Succ. Centre-Ville
+ Montreal, Quebec, H3C 3A7
+ 18 January 1998
+ programming language
+ object oriented
+ thread
+ garbage collection
+ wide audience
+ Modula-3 a simple and efficient object oriented language
+
+
+
+
+
+
+
+
+
Index: m3/pm3/language/modula3/src/m3makefile
diff -c /dev/null m3/pm3/language/modula3/src/m3makefile:1.2
*** /dev/null Tue Feb 10 23:31:54 1998
--- m3/pm3/language/modula3/src/m3makefile Tue Feb 10 22:59:03 1998
***************
*** 0 ****
--- 1,10 ----
+
+ import("m3doc")
+
+ HtmlFile("index")
+
+ include_dir("m3defn")
+ include_dir("discussion")
+
+ OtherPackage("modula3")
+
Index: m3/pm3/language/modula3/src/discussion/Figure1.gif
Index: m3/pm3/language/modula3/src/discussion/Figure1.juno
diff -c /dev/null m3/pm3/language/modula3/src/discussion/Figure1.juno:1.1.1.1
*** /dev/null Tue Feb 10 23:31:54 1998
--- m3/pm3/language/modula3/src/discussion/Figure1.juno Sat Jan 31 14:47:13 1998
***************
*** 0 ****
--- 1,96 ----
+ CONST
+ Hue = (Color.BlueHue + Color.CyanHue) / 2,
+ Gap = 5,
+ FrameSz = 20,
+ BgColor = Color.FromHSV(Color.YellowHue, 0.5,
+ 0.7);
+
+ PROC c := Blue(v) IS
+ c := Color.FromHSV(Hue, v, 1)
+ END;
+
+ PROC FillAndStroke(c) IS
+ SAVE PS IN PS.SetColor(c); PS.Fill() END;
+ PS.Stroke()
+ END;
+
+ PROC Label(a, b, c, txt) IS
+ IF
+ VAR
+ d ~ (2.3299086, -4.7832956) REL (a, b),
+ e ~ (3.1381466, -4.389609) REL (a, b),
+ f ~ (2.7340276, -4.5864525) REL (a, b)
+ IN
+ d = Geometry.HorVer(a, c) AND
+ e = Geometry.HorVer(b, c) AND
+ f = Geometry.Mid(d, e) ->
+ TypeLinesL.West(f, txt)
+ END
+ FI
+ END;
+
+ UI TextTool(Label);
+
+ PROC Annotation(a, b, c, d, txt) IS
+ IF
+ VAR
+ e ~ (1.862029, -1.933767) REL (a, b),
+ f ~ (1.0278038, -2.3056452) REL (a, b),
+ g ~ (1.4449164, -2.119706) REL (a, b),
+ h ~ (3.0628786, -5.7492385) REL (a, b),
+ dx, dy
+ IN
+ e = Geometry.HorVer(b, c) AND
+ f = Geometry.HorVer(a, c) AND
+ g = Geometry.Mid(f, e) AND
+ h = Geometry.HorVer(g, d) ->
+ TypeLinesL.West(h, txt);
+ dx, dy :=
+ TextList.Size(TextList.FromText(txt));
+ Arrow.Straight(R2.PlusX(h, dx + Gap), g)
+ END
+ FI
+ END;
+
+ UI TextTool(Annotation);
+
+ PROC Frame(sw, ne) IS
+ Rect.Draw(R2.Minus(sw, (FrameSz, FrameSz)),
+ R2.Plus(ne, (FrameSz, FrameSz)));
+ FillAndStroke(BgColor)
+ END;
+
+ UI PointTool(Frame);
+
+ PROC Cmd0() IS
+ IF
+ VAR
+ a = (53.774113, -22.754675), b = (163.19518, 86.94581),
+ c ~ (151.07706, 50.37898), d ~ (138.95895, 13.812153),
+ e = R2.Plus(a, (12.118114, -7.5848923)),
+ f ~ (-117.394196, -22.754675)
+ IN
+ Geometry.CongX(d, c, c, b) AND
+ Geometry.CongY(b, c, c, d) AND
+ Geometry.CongY(c, d, d, a) AND
+ Geometry.CongX(a, e, c, b) AND
+ f HOR a ->
+ PS.SetWidth(1.5);
+ Frame(f, b);
+ Rect.Draw(a, b);
+ FillAndStroke(Blue(1));
+ Rect.Draw(a, c);
+ FillAndStroke(Blue(0.6));
+ Rect.Draw(a, d);
+ FillAndStroke(Blue(0.2));
+ PS.SetFont("Helvetica", PS.Big);
+ Label(b, c, e, "private:");
+ Label(c, d, e, "protected:");
+ Label(d, a, e, "public:");
+ Annotation(d, a, a, f, "All code");
+ Annotation(c, d, a, f, "Subclasses");
+ Annotation(b, c, a, f,
+ "Class implementation\n" & "and friend procedures")
+ END
+ FI
+ END;
Index: m3/pm3/language/modula3/src/discussion/Figure2.gif
Index: m3/pm3/language/modula3/src/discussion/Figure2.juno
diff -c /dev/null m3/pm3/language/modula3/src/discussion/Figure2.juno:1.1.1.1
*** /dev/null Tue Feb 10 23:31:54 1998
--- m3/pm3/language/modula3/src/discussion/Figure2.juno Sat Jan 31 14:47:13 1998
***************
*** 0 ****
--- 1,132 ----
+ CONST
+ BoxBorder = 4,
+ Hue = (Color.BlueHue + Color.CyanHue) / 2,
+ FrameSz = 20,
+ BgColor = Color.FromHSV(Color.YellowHue,
+ 0.5, 0.7);
+
+ PROC c := Blue(v) IS
+ c := Color.FromHSV(Hue, v, 1)
+ END;
+
+ PROC FillAndStroke(c) IS
+ SAVE PS IN PS.SetColor(c); PS.Fill() END;
+ PS.Stroke()
+ END;
+
+ PROC Frame(sw, ne) IS
+ Rect.Draw(R2.Minus(sw, (FrameSz, FrameSz)),
+ R2.Plus(ne, (FrameSz, FrameSz)));
+ FillAndStroke(BgColor)
+ END;
+
+ UI PointTool(Frame);
+
+ PROC ne := NE(c, txt) IS
+ VAR w, h IN
+ w, h :=
+ TextList.Size(TextList.FromText(txt));
+ ne :=
+ R2.Plus(c,
+ (w / 2 + BoxBorder,
+ h / 2 + BoxBorder))
+ END
+ END;
+
+ PROC BoxC(c, txt) IS
+ VAR ne IN
+ ne := NE(c, txt); BoxCC(c, ne, txt)
+ END
+ END;
+
+ UI TextTool(BoxC);
+
+ PROC BoxEast(p, txt) IS
+ VAR w, h, c IN
+ w, h :=
+ TextList.Size(TextList.FromText(txt));
+ c := R2.PlusX(p, -(w / 2 + BoxBorder));
+ BoxC(c, txt)
+ END
+ END;
+
+ UI TextTool(BoxEast);
+
+ PROC BoxWest(p, txt) IS
+ VAR w, h, c IN
+ w, h :=
+ TextList.Size(TextList.FromText(txt));
+ c := R2.PlusX(p, w / 2 + BoxBorder);
+ BoxC(c, txt)
+ END
+ END;
+
+ UI TextTool(BoxWest);
+
+ PROC BoxCEast(c, e, txt) IS
+ VAR ne IN
+ ne := NE(c, txt);
+ IF
+ VAR ne2 = Geometry.HorVer(ne, e) IN
+ BoxCC(c, ne2, txt)
+ END
+ FI
+ END
+ END;
+
+ UI TextTool(BoxCEast);
+
+ PROC BoxCC(c, ne, txt) IS
+ Rect.DrawC(c, ne);
+ FillAndStroke(Blue(0.6));
+ TypeLinesC.Center(c, txt)
+ END;
+
+ PROC Cmd0() IS
+ IF
+ VAR
+ a ~ (-134.0566, -25.030142), b ~ (124.21063, 147.90538),
+ c = (-9.694486, 136.33688), d ~ (-75.08494, 86.340324),
+ e ~ (55.695965, 86.340324), f ~ (-9.694486, 36.343758),
+ g ~ (82.55463, 86.340324), h ~ (82.55463, -13.652805),
+ i ~ (46.957676, -13.652805), j ~ (-16.359444, 86.340324),
+ k ~ (-3.0295274, 86.340324), l = (73.46604, 170.66006),
+ m ~ (-134.0566, 85.709274), n ~ (124.21063, 89.501724),
+ o = (62.105316, 147.90538), p = (63.62008, -25.030142)
+ IN
+ d HOR e AND
+ d HOR g AND
+ i HOR h AND
+ c VER f AND
+ g VER h AND
+ Geometry.CongX(d, f, f, e) AND
+ Geometry.CongY(c, d, d, f) AND
+ Geometry.CongY(d, f, f, i) AND
+ j HOR d AND
+ e HOR k AND
+ Geometry.CongX(j, f, f, k) AND
+ m VER a AND
+ n VER b AND
+ o HOR b AND
+ a HOR p ->
+ PS.SetWidth(1.5);
+ Frame(a, b);
+ PS.MoveTo(c);
+ PS.LineTo(d);
+ PS.LineTo(f);
+ PS.LineTo(e);
+ PS.LineTo(c);
+ PS.LineTo(f);
+ PS.LineTo(i);
+ PS.MoveTo(g);
+ PS.LineTo(h);
+ PS.Stroke();
+ PS.SetFont("Helvetica-Bold", PS.Medium);
+ BoxEast(j, "AssocClass.Group");
+ BoxWest(k, "UnsafeAssoc.Group");
+ BoxWest(i, "MUTEX");
+ BoxCEast(c, l, "Association.Group");
+ BoxCEast(f, l, "AssocClass.GroupPrivate")
+ END
+ FI
+ END;
Index: m3/pm3/language/modula3/src/discussion/m3makefile
diff -c /dev/null m3/pm3/language/modula3/src/discussion/m3makefile:1.1.1.1
*** /dev/null Tue Feb 10 23:31:54 1998
--- m3/pm3/language/modula3/src/discussion/m3makefile Sat Jan 31 14:47:13 1998
***************
*** 0 ****
--- 1,4 ----
+
+ HtmlFile("partialRev")
+ HtmlTextFile("Figure1.gif")
+ HtmlTextFile("Figure2.gif")
Index: m3/pm3/language/modula3/src/discussion/partialRev.html
diff -c /dev/null m3/pm3/language/modula3/src/discussion/partialRev.html:1.2
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/discussion/partialRev.html Tue Feb 10 22:59:07 1998
***************
*** 0 ****
--- 1,905 ----
+
+
+ Partial Revelation and Modula-3
+ Importing Only Necessary Class Features
+ by Steve Freeman
+ So What's the Problem?
+ ![[ Image for Figure 1 ]](Figure1.gif)
+ Figure 1: Access Control in C++.
+ Access to each level of privacy includes
+ access to all the less private levels.An Associations Example
+
+
+ class Item {
+ public:
+ Group* MemberOf() const {return group_; };
+ private:
+ Group* group_;
+ friend void Group::AddItem(Item*); // allows methods to access
+ friend void Group::RemoveItem(Item*); // the group_ field
+ };
+
+ class Group {
+ public:
+ void AddItem(Item* item);
+ void RemoveItem(Item* item);
+ const ItemSet& Items() const {return itemSet_; };
+ private:
+ ItemSet itemSet_; // a collection class to hold a set of items
+ };
+
+
+
+ void Group::AddItem(Item* item) {
+ item->group_ = this;
+ itemSet_.Add(item);
+ }
+
+
+
+ class AbstractItem {
+ public:
+ virtual AbstractGroup* MemberOf() const = 0;
+ };
+ AbstractItem* CreateItem();
+ class AbstractGroup {
+ public:
+ virtual void AddItem(AbstractItem* item) = 0;
+ virtual void RemoveItem(AbstractItem* item) = 0;
+ virtual const ItemSet& Items() const = 0;
+ };
+ AbstractGroup* CreateGroup(...);
+
+
+
+ class ConcreteItem: public AbstractItem {
+ public:
+ AbstractGroup* MemberOf() const {return group_; };
+ private:
+ AbstractGroup* group_;
+ friend void ConcreteGroup::AddItem(AbstractItem*);
+ friend void ConcreteGroup::RemoveItem(AbstractItem*);
+ };
+ AbstractItem* CreateItem() {
+ return (AbstractItem*)new ConcreteItem;
+ };
+
+
+
+ class Item: public AbstractItem {
+ public:
+ Item() { impl_ = CreateItem(); };
+ ~Item() { delete impl_; };
+ Group* MemberOf() const { return impl_->MemberOf(); };
+ AbstractItem* Implementation() const { return impl_; };
+ private:
+ AbstractItem* impl_;
+ };
+
+
+
+ class ITEM
+ export
+ member_of -- this method available to everyone
+ set_group{GROUP}, clear_group{GROUP} -- methods available to class GROUP
+ feature
+ mygroup: GROUP;
+ member_of: GROUP is do Result := mygroup end;
+ set_group(g: GROUP) is do mygroup := g end;
+ clear_group is forget(mygroup) end;
+ end -- ITEM
+
+
+
+ with Items; use Items;
+ package Association is
+ -- visible section
+ type Item is private;
+ type Item_ptr is access all Item'Class;
+ type Group is private;
+ type Group_ptr is access all Group'Class;
+ procedure AddItem(G: Group_ptr; I Item_ptr);
+ procedure RemoveItem(G: Group_ptr; I Item_ptr);
+ function Items(G: in Group'Class) return Items.List;
+ private
+ -- private to implementation
+ type Item is tagged record
+ group: Group_ptr;
+ end record;
+ type Group is tagged record
+ Items : Items.Set;
+ end record;
+ end Association;
+
+
+
+
+
+ Modula-3 Basics
+
+
+ INTERFACE Association;
+
+ IMPORT List;
+
+ TYPE
+ Item <: AbstractItem;
+ AbstractItem = OBJECT METHODS
+ memberOf(): Group;
+ END;
+
+ Group <: AbstractGroup;
+ AbstractGroup = OBJECT METHODS
+ addItem(item: Item);
+ removeItem(item: Item);
+ items(): List.T;
+ END;
+
+ END Association.
+
+
+
+ MODULE Association;
+
+ IMPORT Set;
+
+ REVEAL
+ Item = AbstractItem BRANDED OBJECT
+ group: Group;
+ OVERRIDES
+ memberOf := ItemMemberOf;
+ END;
+
+ PROCEDURE ItemMemberOf(self: Item): Group =
+ BEGIN RETURN self.group; END ItemMemberOf;
+
+ REVEAL
+ Group = AbstractGroup BRANDED OBJECT
+ itemSet: Set.T;
+ OVERRIDES
+ addItem := GroupAddItem;
+ removeItem := GroupRemoveItem;
+ items := GroupItems;
+ END;
+
+ PROCEDURE GroupAddItem(self: Group; item: Item) =
+ BEGIN self.itemSet.add(item); END;
+
+ PROCEDURE GroupRemoveItem(self: Group; item: Item) =
+ BEGIN self.itemSet.remove(item); END;
+
+ PROCEDURE GroupItems(self: Group): Set.T =
+ BEGIN RETURN self.itemSet.makeList(); END;
+
+ BEGIN (* empty module initialization block *)
+ END Association.
+
+
+
+ IMPORT Association;
+
+ TYPE
+ LogGroup = Association.Group OBJECT OVERRIDES
+ addItem := LogGroupAddItem;
+ END;
+
+ PROCEDURE LogGroupAddItem(self: LogGroup; item: Assocation.Item) =
+ BEGIN
+ (* log the addition, then directly call the parent method *)
+ LogAddition(self, item);
+ Association.Group.addItem(self, item);
+ END;
+
+
+ Partitioning an Object Definition
+ Beyond Simple Encapsulation: Associations Revisited
+
+ INTERFACE Assocation;
+
+ IMPORT List;
+
+ TYPE Item <: ROOT;
+ (* ROOT is the ancestor of all garbage-collected objects *)
+
+ TYPE Group <: ROOT;
+
+ PROCEDURE MemberOf(i: Item): Group;
+ PROCEDURE AddItem(g: Group; i: Item);
+ PROCEDURE RemoveItem(g: Group; i: Item);
+ PROCEDURE ItemList(g: Group): List.T;
+ PROCEDURE NewItem(g: Group): Item;
+ (* Blocks until a new item arrives, then returns
+ the most recent addition. *)
+
+ END Assocation.
+
+
+
+ INTERFACE AssocClass;
+
+ IMPORT Association, List;
+
+ TYPE ItemPrivate <: ROOT;
+
+ REVEAL
+ Association.Item = ItemPrivate BRANDED OBJECT METHODS
+ memberOf(): Association.Group;
+ setGroup(g: Association.Group);
+ END;
+
+ TYPE GroupPrivate <: ROOT;
+
+ REVEAL
+ Association.Group = GroupPrivate BRANDED OBJECT METHODS
+ addItem(i: Association.Item);
+ removeItem(i: Association.Item);
+ itemList(): List.T;
+ END;
+
+ END AssocClass.
+
+
+
+ INTERFACE AssocImpl;
+
+ IMPORT Association;
+
+ TYPE
+ Item <: Association.Item;
+ Group <: Assocation.Group;
+
+ END AssocImpl.
+
+
+
+ MODULE AssocImpl;
+
+ IMPORT Association, AssocClass, List, Set;
+
+ REVEAL
+ Item = Association.Item BRANDED OBJECT
+ group: Assocation.Group := NIL;
+ OVERRIDES
+ memberOf := MemberOf;
+ setGroup := SetGroup;
+ END;
+
+ REVEAL
+ Group = Association.Group BRANDED OBJECT
+ set: Set.T := NIL;
+ OVERRIDES
+ addItem := AddItem;
+ removeItem := RemoveItem;
+ itemList := ItemList;
+ END;
+
+
+
+ PROCEDURE AddItem(self: Group; item: Association.Item) =
+ BEGIN
+ IF self.set = NIL THEN self.set := NEW(Set.T); END;
+ self.set.add(item);
+ END AddItem;
+
+
+ Exposing Unsafe Features
+
+ Association.AddItem(group, item1);
+ Association.AddItem(group, item2);
+ Association.AddItem(group, item3);
+
+
+
+ LOCK group DO
+ UnsafeAddItem(group, item1);
+ UnsafeAddItem(group, item2);
+ UnsafeAddItem(group, item3);
+ NotifyNewItem(group, item3);
+ END;
+
+
+
+ UNSAFE INTERFACE UnsafeAssoc;
+
+ IMPORT Association;
+
+ REVEAL Association.Item <: MUTEX;
+
+ PROCEDURE UnsafeMemberOf(i: Association.Item): Association.Group;
+ PROCEDURE UnsafeSetGroup(i: Assocation.Item; g: Assocation.Group);
+
+ REVEAL Association.Group <: MUTEX;
+
+ PROCEDURE UnsafeAddItem(g: Association.Group; i: Association.Item);
+ PROCEDURE UnsafeRemoveItem(g: Assocation.Group; i: Association.Item);
+ PROCEDURE UnsafeItemList(g: Association.Group): List.T;
+ PROCEDURE NotifyNewItem(g: Association.Group; i: Association.Item);
+
+ END UnsafeAssoc.
+
+
+
+ UNSAFE MODULE Association EXPORTS Association, AssocClass, UnsafeAssoc;
+
+ IMPORT Thread;
+
+ (* These two revelations are extensions of those in UnsafeAssoc, so
+ they start with a mutex *)
+
+ REVEAL
+ ItemPrivate = MUTEX BRANDED OBJECT
+ (* no further features *)
+ END;
+
+ GroupPrivate = MUTEX BRANDED OBJECT
+ cond: Thread.Condition := NIL; (* for threads waiting for new items *)
+ lastAddition: Item := NIL; (* the last item added *)
+ END;
+
+
+
+ PROCEDURE UnsafeAddItem(group: Assocation.Group; item: Association.Item) =
+ BEGIN
+ group.addItem(item);
+ item.setGroup(group);
+ END UnsafeAddItem;
+
+ (* etc *)
+
+ PROCEDURE NotifyNewItem(group: Assocation.Group; item: Association.Item) =
+ BEGIN
+ group.lastAddition := item;
+ Thread.Broadcast(group.cond);
+ END NotifyNewItem;
+
+
+
+ PROCEDURE AddItem(group: Group; item: Item) =
+ BEGIN
+ LOCK g DO
+ UnsafeAddItem(group, item);
+ NotifyNewItem(group, item);
+ END;
+ END AddItem;
+
+ (* etc *)
+
+ PROCEDURE NewItem(group: Group): Item =
+ VAR oldItem: Item; BEGIN
+ LOCK group DO
+ oldItem := group.lastAddition;
+ (* wait until a new item has been added to the group *)
+ WHILE oldItem = group.lastAddition DO
+ Thread.Wait(group.cond, group);
+ END;
+ RETURN group.lastAddition;
+ END;
+ END NewItem;
+
+ BEGIN (* empty module initialization block *)
+ END Association.
+
+
+ Summary
+ ![[ Image for Figure 2 ]](Figure2.gif)
+ Figure 2: The Group type hierarchy
+ as defined in the interfaces; subtypes
+ are shown above their parent types.Acknowledgments
+ About the author
+ About this article
+ Acknowledgments
+
+
+ Last modified on Wed Apr 3 09:39:14 PST 1996 by heydon
+ modified on Thu Apr 14 11:56:41 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/apply.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/apply.html:1.1.1.1
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/apply.html Sat Jan 31 14:47:13 1998
***************
*** 0 ****
--- 1,19 ----
+
+
+ Function application
+
+ Last modified on Wed Apr 3 09:39:13 PST 1996 by heydon
+ modified on Mon Apr 18 14:00:21 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/arithmetic.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/arithmetic.html:1.2
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/arithmetic.html Tue Feb 10 22:59:13 1998
***************
*** 0 ****
--- 1,183 ----
+
+
+ Arithmetic operations
+
+ prefix + (x: INTEGER) : INTEGER
+ + (x: Float) : Float
+
+
+ infix + (x,y: INTEGER) : INTEGER
+ (x,y: Float) : Float
+ (x,y: Set) : Set
+
+
+ prefix - (x: INTEGER) : INTEGER
+ (x: Float) : Float
+
+ infix - (x,y: INTEGER) : INTEGER
+ (x,y: Float) : Float
+ (x,y: Set) : Set
+
+
+ infix * (x,y: INTEGER) : INTEGER
+ (x,y: Float) : Float
+ (x,y: Set) : Set
+
+
+ infix / (x,y: Float) : Float
+ (x,y: Set) : Set
+
+
+ infix DIV (x,y: INTEGER) : INTEGER
+ infix MOD (x,y: INTEGER) : INTEGER
+ MOD (x, y: Float) : Float
+
+
+ ABS (x: INTEGER) : INTEGER
+ (x: Float) : Float
+
+
+ FLOAT (x: INTEGER; T: Type := REAL): T
+ (x: Float; T: Type := REAL): T
+
+
+ FLOOR (x: Float) : INTEGER
+
+ CEILING (x: Float) : INTEGER
+
+
+ ROUND (r: Float) : INTEGER
+
+ TRUNC (r: Float) : INTEGER
+
+
+ MAX, MIN (x,y: Ordinal) : Ordinal
+ (x,y: Float) : Float
+
+
+ Last modified on Wed Apr 3 09:39:13 PST 1996 by heydon
+ modified on Mon Apr 18 14:00:35 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/arrays.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/arrays.html:1.2
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/arrays.html Tue Feb 10 22:59:13 1998
***************
*** 0 ****
--- 1,112 ----
+
+
+ Array types
+
+ TYPE T = ARRAY Index OF Element
+
+
+ VAR a := ARRAY [1..3] OF REAL {1.0, 2.0, 3.0};
+ VAR b: ARRAY [-1..1] OF REAL := a;
+
+
+ ARRAY Index_1, ..., Index_n OF Element
+
+
+ ARRAY Index_1 OF ... OF ARRAY Index_n OF Element
+
+
+ TYPE T = ARRAY OF Element
+
+
+ TYPE
+ Transform = ARRAY [1..3], [1..3] OF REAL;
+ Vector = ARRAY OF REAL;
+ SkipTable = ARRAY CHAR OF INTEGER
+
+
+
+ Last modified on Wed Apr 3 09:39:13 PST 1996 by heydon
+ modified on Mon Apr 18 14:00:43 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/assign.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/assign.html:1.2
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/assign.html Tue Feb 10 22:59:14 1998
***************
*** 0 ****
--- 1,103 ----
+
+
+ Assignment
+
+
+
+
+
+ v := e
+
+
+ VAR
+ x: REFANY;
+ a: REF INTEGER;
+ b: REF BOOLEAN;
+
+ a := b; (* static error *)
+ x := a; (* no possible error *)
+ a := x (* possible checked runtime error *)
+
+
+ VAR
+ x: ADDRESS;
+ a: UNTRACED REF INTEGER;
+ b: UNTRACED REF BOOLEAN;
+
+ a := b; (* static error *)
+ x := a; (* no possible error *)
+ a := x (* static error in safe modules *)
+
+
+ Last modified on Wed Apr 3 09:39:12 PST 1996 by heydon
+ modified on Mon Apr 18 14:00:50 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/authors.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/authors.html:1.1.1.1
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/authors.html Sat Jan 31 14:47:13 1998
***************
*** 0 ****
--- 1,59 ----
+
+
+ About the authors
+
+
+ Last modified on Wed Apr 3 09:39:12 PST 1996 by heydon
+ modified on Thu Apr 14 12:21:23 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/block.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/block.html:1.2
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/block.html Tue Feb 10 22:59:14 1998
***************
*** 0 ****
--- 1,28 ----
+
+
+ Blocks
+
+ Decls BEGIN S END
+
+
+ Last modified on Wed Apr 3 09:39:12 PST 1996 by heydon
+ modified on Mon Apr 18 14:00:59 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/boolops.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/boolops.html:1.2
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/boolops.html Tue Feb 10 22:59:14 1998
***************
*** 0 ****
--- 1,33 ----
+
+
+ Boolean operations
+
+ prefix NOT (p: BOOLEAN) : BOOLEAN
+ infix AND (p,q: BOOLEAN) : BOOLEAN
+ infix OR (p,q: BOOLEAN) : BOOLEAN
+
+
+ Last modified on Wed Apr 3 09:39:11 PST 1996 by heydon
+ modified on Mon Apr 18 14:01:10 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/builtin.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/builtin.html:1.2
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/builtin.html Tue Feb 10 22:59:14 1998
***************
*** 0 ****
--- 1,30 ----
+
+
+ Predeclared opaque types
+
+ TEXT <: REFANY
+ MUTEX <: ROOT
+
+
+ Last modified on Wed Apr 3 09:39:11 PST 1996 by heydon
+ modified on Mon Apr 18 14:01:18 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/calls.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/calls.html:1.2
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/calls.html Tue Feb 10 22:59:14 1998
***************
*** 0 ****
--- 1,116 ----
+
+
+ Procedure calls
+
+ P(Bindings)
+
+
+ PROCEDURE(ch: CHAR; n: INTEGER := 0)
+
+
+ P('a', 0)
+ P('a')
+ P(ch := 'a')
+ P(n := 0, ch := 'a')
+ P('a', n := 0)
+
+
+ o.m(Bindings)
+
+
+ (o's m method) (o, Bindings)
+
+
+
+ Last modified on Wed Apr 3 09:39:11 PST 1996 by heydon
+ modified on Mon Apr 18 14:01:32 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/case.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/case.html:1.2
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/case.html Tue Feb 10 22:59:14 1998
***************
*** 0 ****
--- 1,42 ----
+
+
+ Case
+
+ CASE Expr OF
+ L_1 => S_1
+ | ...
+ | L_n => S_n
+ ELSE S_0
+ END
+
+
+ Last modified on Wed Apr 3 09:39:10 PST 1996 by heydon
+ modified on Mon Apr 18 14:01:42 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/constants.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/constants.html:1.2
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/constants.html Tue Feb 10 22:59:14 1998
***************
*** 0 ****
--- 1,25 ----
+
+
+ Constants
+
+ CONST id: T = C
+
+
+ Last modified on Wed Apr 3 09:39:10 PST 1996 by heydon
+ modified on Fri Apr 15 13:44:22 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/constexpr.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/constexpr.html:1.2
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/constexpr.html Tue Feb 10 22:59:14 1998
***************
*** 0 ****
--- 1,33 ----
+
+
+ Constant Expressions
+
+ Last modified on Wed Apr 3 09:39:10 PST 1996 by heydon
+ modified on Mon Apr 18 13:46:48 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/construct.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/construct.html:1.2
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/construct.html Tue Feb 10 22:59:14 1998
***************
*** 0 ****
--- 1,65 ----
+
+
+ Set, array, and record constructors
+
+ S{e_1, ..., e_n}
+
+
+ A{e_1, ..., e_n}
+
+
+ R{Bindings}
+
+
+ Last modified on Wed Apr 3 09:39:10 PST 1996 by heydon
+ modified on Mon Apr 18 14:02:28 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/conventions.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/conventions.html:1.2
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/conventions.html Tue Feb 10 22:59:14 1998
***************
*** 0 ****
--- 1,62 ----
+
+
+ Conventions for describing operations
+
+ ORD (x: Ordinal): INTEGER
+
+
+ ABS (x: INTEGER) : INTEGER
+ (x: Float) : Float
+
+
+ BYTESIZE (T: Type): CARDINAL
+
+
+ FIRST (T: FixedArrayType): IndexType(T)
+
+
+ Last modified on Wed Apr 3 09:39:09 PST 1996 by heydon
+ modified on Fri Apr 15 15:24:37 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/decls.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/decls.html:1.2
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/decls.html Tue Feb 10 22:59:15 1998
***************
*** 0 ****
--- 1,57 ----
+
+
+ Declarations
+
+
+ Decls BEGIN S END
+
+
+
+
+
+ Last modified on Tue Oct 3 17:20:24 PDT 1995 by heydon
+ modified on Mon Apr 18 13:47:55 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/defns.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/defns.html:1.1.1.1
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/defns.html Sat Jan 31 14:47:13 1998
***************
*** 0 ****
--- 1,67 ----
+
+
+ Definitions
+
+ Last modified on Wed Apr 3 09:39:09 PST 1996 by heydon
+ modified on Thu Apr 14 14:29:42 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/designators.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/designators.html:1.2
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/designators.html Tue Feb 10 22:59:15 1998
***************
*** 0 ****
--- 1,134 ----
+
+
+ Designators
+
+
+
+
+
+
+
+
+
+
+ Last modified on Wed Apr 3 09:39:09 PST 1996 by heydon
+ modified on Mon Apr 18 14:02:39 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/eval.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/eval.html:1.2
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/eval.html Tue Feb 10 22:59:15 1998
***************
*** 0 ****
--- 1,25 ----
+
+
+ Eval
+
+ EVAL e
+
+
+ EVAL Thread.Fork(p)
+
+
+
+ Last modified on Wed Apr 3 09:39:08 PST 1996 by heydon
+ modified on Fri Apr 15 08:36:48 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/example.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/example.html:1.1.1.1
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/example.html Sat Jan 31 14:47:13 1998
***************
*** 0 ****
--- 1,61 ----
+
+
+ Example module and interface
+
+ INTERFACE Stack;
+ TYPE T <: REFANY;
+ PROCEDURE Create(): T;
+ PROCEDURE Push(VAR s: T; x: REAL);
+ PROCEDURE Pop(VAR s: T): REAL;
+ END Stack.
+
+ MODULE Stack;
+ REVEAL T = BRANDED OBJECT item: REAL; link: T END;
+ PROCEDURE Create(): T = BEGIN RETURN NIL END Create;
+
+ PROCEDURE Push(VAR s: T; x: REAL) =
+ BEGIN
+ s := NEW(T, item := x, link := s)
+ END Push;
+
+ PROCEDURE Pop(VAR s: T): REAL =
+ VAR res: REAL;
+ BEGIN
+ res := s.item; s := s.link; RETURN res
+ END Pop;
+
+ BEGIN
+ END Stack.
+
+
+ INTERFACE Stack (* ... as before ... *) END Stack.
+
+ INTERFACE StackRep; IMPORT Stack;
+ REVEAL Stack.T = BRANDED OBJECT item: REAL; link: Stack.T END
+ END StackRep.
+
+ MODULE Stack; IMPORT StackRep;
+ (* Push, Pop, and Create as before *)
+ BEGIN
+ END Stack.
+
+
+ Last modified on Wed Apr 3 09:39:08 PST 1996 by heydon
+ modified on Mon Apr 18 13:26:15 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/exceptions.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/exceptions.html:1.2
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/exceptions.html Tue Feb 10 22:59:15 1998
***************
*** 0 ****
--- 1,26 ----
+
+
+ Exceptions
+
+ EXCEPTION id(T)
+
+
+ Last modified on Wed Apr 3 09:39:08 PST 1996 by heydon
+ modified on Fri Apr 15 13:49:33 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/exit.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/exit.html:1.2
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/exit.html Tue Feb 10 22:59:15 1998
***************
*** 0 ****
--- 1,44 ----
+
+
+ Exit
+
+ EXIT
+
+
+ LOOP
+ TRY
+ TRY EXIT FINALLY RAISE E END
+ EXCEPT
+ E => (*skip*)
+ END
+ END
+
+
+
+ Last modified on Wed Apr 3 09:39:07 PST 1996 by heydon
+ modified on Fri Apr 15 08:53:02 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/exprs.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/exprs.html:1.2
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/exprs.html Tue Feb 10 22:59:15 1998
***************
*** 0 ****
--- 1,51 ----
+
+
+ Expressions
+
+
+
+
+
+ Last modified on Tue Oct 3 19:13:52 PDT 1995 by heydon
+ modified on Fri Apr 15 15:21:09 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/float-intf.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/float-intf.html:1.2
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/float-intf.html Tue Feb 10 22:59:15 1998
***************
*** 0 ****
--- 1,132 ----
+
+
+ The RealFloat, LongFloat and ExtendedFloat interfaces
+
+ INTERFACE RealFloat = Float(Real) END RealFloat.
+ INTERFACE LongFloat = Float(LongReal) END LongFloat.
+ INTERFACE ExtendedFloat = Float(Extended) END ExtendedFloat.
+
+
+
+ GENERIC INTERFACE Float(R); TYPE T = R.T;
+
+
+ PROCEDURE Scalb(x: T; n: INTEGER): T;
+
+
+ PROCEDURE Logb(x: T): T;
+
+
+ PROCEDURE ILogb(x: T): INTEGER;
+
+
+ PROCEDURE NextAfter(x, y: T): T;
+
+
+ PROCEDURE CopySign(x, y: T): T;
+
+
+ PROCEDURE Finite(x: T): BOOLEAN;
+
+
+ PROCEDURE IsNaN(x: T): BOOLEAN;
+
+
+ PROCEDURE Sign(x: T): [0..1];
+
+
+ PROCEDURE Differs(x, y: T): BOOLEAN;
+
+
+ PROCEDURE Unordered(x, y: T): BOOLEAN;
+
+
+ PROCEDURE Sqrt(x: T): T;
+
+
+ TYPE IEEEClass =
+ {SignalingNaN, QuietNaN, Infinity, Normal, Denormal, Zero};
+
+
+
+ PROCEDURE Class(x: T): IEEEClass;
+
+
+ END Float.
+
+
+
+ Last modified on Wed Apr 3 09:39:07 PST 1996 by heydon
+ modified on Thu Jun 1 08:10:14 PDT 1995 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/floatmode.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/floatmode.html:1.2
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/floatmode.html Tue Feb 10 22:59:15 1998
***************
*** 0 ****
--- 1,164 ----
+
+
+ The FloatMode interface
+
+ INTERFACE FloatMode;
+
+ CONST IEEE: BOOLEAN = ...;
+
+
+ EXCEPTION Failure;
+
+
+ TYPE RoundingMode =
+ {NearestElseEven, TowardMinusInfinity, TowardPlusInfinity,
+ TowardZero, NearestElseAwayFromZero, IBM370, Other};
+
+
+ CONST RoundDefault: RoundingMode = ...;
+
+
+ PROCEDURE SetRounding(md: RoundingMode) RAISES {Failure};
+
+
+ PROCEDURE GetRounding(): RoundingMode;
+
+
+ TYPE Flag =
+ {Invalid, Inexact, Overflow, Underflow,
+ DivByZero, IntOverflow, IntDivByZero};
+
+
+
+
+
+
+ CONST NoFlags = SET OF Flags {};
+
+
+
+ PROCEDURE GetFlags(): SET OF Flag;
+
+
+ PROCEDURE SetFlags(s: SET OF Flag): SET OF Flag RAISES{Failure};
+
+
+ PROCEDURE ClearFlag(f: Flag);
+
+
+ EXCEPTION
+ Trap(Flag);
+
+ TYPE
+ Behavior = {Trap, SetFlag, Ignore};
+
+
+
+
+
+ PROCEDURE SetBehavior(f: Flag; b: Behavior) RAISES {Failure};
+
+
+ PROCEDURE GetBehavior(f: Flag): Behavior;
+
+
+ END FloatMode.
+
+
+ Last modified on Wed Apr 3 09:39:06 PST 1996 by heydon
+ modified on Thu Jun 1 08:10:29 PDT 1995 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/floats.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/floats.html:1.1.1.1
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/floats.html Sat Jan 31 14:47:13 1998
***************
*** 0 ****
--- 1,22 ----
+
+
+ Floating-point types
+
+ Last modified on Wed Apr 3 09:39:06 PST 1996 by heydon
+ modified on Mon Apr 18 14:03:08 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/for.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/for.html:1.2
*** /dev/null Tue Feb 10 23:31:55 1998
--- m3/pm3/language/modula3/src/m3defn/for.html Tue Feb 10 22:59:15 1998
***************
*** 0 ****
--- 1,67 ----
+
+
+ For
+
+ FOR id := first TO last BY step DO S END
+
+
+ VAR
+ i := ORD(first); done := ORD(last); delta := step;
+ BEGIN
+ IF delta >= 0 THEN
+ WHILE i <= done DO
+ WITH id = VAL(i, T) DO S END; INC(i, delta)
+ END
+ ELSE
+ WHILE i >= done DO
+ WITH id = VAL(i, T) DO S END; INC(i, delta)
+ END
+ END
+ END
+
+
+ Last modified on Wed Apr 3 09:39:06 PST 1996 by heydon
+ modified on Mon Apr 18 14:03:17 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/generics.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/generics.html:1.2
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/generics.html Tue Feb 10 22:59:15 1998
***************
*** 0 ****
--- 1,149 ----
+
+
+ Generics
+
+ GENERIC INTERFACE G(F_1, ..., F_n);
+ Body
+ END G.
+
+
+ INTERFACE I = G(A_1, ..., A_n) END I.
+
+
+ INTERFACE I;
+ IMPORT A_1 AS F_1, ..., A_n AS F_n;
+ Body
+ END I.
+
+
+ GENERIC MODULE G(F_1, ..., F_n);
+ Body
+ END G.
+
+
+ MODULE I EXPORTS E = G(A_1, ..., A_n) END I.
+
+
+ MODULE I EXPORTS E;
+ IMPORT A_1 AS F_1, ..., A_n AS F_n;
+ Body
+ END I.
+
+
+ GENERIC INTERFACE Stack(Elem);
+ (* where Elem.T is not an open array type. *)
+ TYPE T <: REFANY;
+ PROCEDURE Create(): T;
+ PROCEDURE Push(VAR s: T; x: Elem.T);
+ PROCEDURE Pop(VAR s: T): Elem.T;
+ END Stack.
+
+ GENERIC MODULE Stack(Elem);
+
+ REVEAL
+ T = BRANDED OBJECT n: INTEGER; a: REF ARRAY OF Elem.T END;
+
+ PROCEDURE Create(): T =
+ BEGIN RETURN NEW(T, n := 0, a := NIL) END Create;
+
+ PROCEDURE Push(VAR s: T; x: Elem.T) =
+ BEGIN
+ IF s.a = NIL THEN
+ s.a := NEW(REF ARRAY OF Elem.T, 5)
+ ELSIF s.n > LAST(s.a^) THEN
+ WITH temp = NEW(REF ARRAY OF Elem.T, 2 * NUMBER(s.a^)) DO
+ FOR i := 0 TO LAST(s.a^) DO temp[i] := s.a[i] END;
+ s.a := temp
+ END
+ END;
+ s.a[s.n] := x;
+ INC(s.n)
+ END Push;
+
+ PROCEDURE Pop(VAR s: T): Elem.T =
+ BEGIN DEC(s.n); RETURN s.a[s.n] END Pop;
+
+ BEGIN
+ END Stack.
+
+
+ INTERFACE Integer; TYPE T = INTEGER; END Integer.
+ INTERFACE IntStack = Stack(Integer) END IntStack.
+ MODULE IntStack = Stack(Integer) END IntStack.
+
+
+ INTERFACE String; TYPE T = ARRAY OF CHAR; END String.
+ INTERFACE StringStack = Stack(String) END StringStack.
+ MODULE StringStack = Stack(String) END StringStack.
+
+
+ Last modified on Wed Apr 3 09:39:52 PST 1996 by heydon
+ modified on Mon Apr 18 14:03:26 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/if.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/if.html:1.1.1.1
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/if.html Sat Jan 31 14:47:13 1998
***************
*** 0 ****
--- 1,40 ----
+
+
+ If
+
+ IF B_1 THEN S_1
+ ELSIF B_2 THEN S_2
+ ...
+ ELSIF B_n THEN S_n
+ ELSE S_0
+ END
+
+
+ Last modified on Wed Apr 3 09:39:07 PST 1996 by heydon
+ modified on Mon Apr 18 14:03:35 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/imports.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/imports.html:1.2
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/imports.html Tue Feb 10 22:59:15 1998
***************
*** 0 ****
--- 1,60 ----
+
+
+ Import statements
+
+ IMPORT I AS J
+
+
+ FROM I IMPORT N
+
+
+ IMPORT I AS J, J AS I; FROM I IMPORT N
+
+
+ IMPORT J AS I, K AS I;
+
+
+ Last modified on Wed Apr 3 09:39:05 PST 1996 by heydon
+ modified on Mon Apr 18 13:27:38 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/incdec.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/incdec.html:1.2
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/incdec.html Tue Feb 10 22:59:16 1998
***************
*** 0 ****
--- 1,38 ----
+
+
+ Inc and Dec
+
+ INC(v, n)
+ DEC(v, n)
+
+
+ WITH x = v DO x := VAL(ORD(x) + n, T) END
+ WITH x = v DO x := VAL(ORD(x) - n, T) END
+
+
+ Last modified on Wed Apr 3 09:39:05 PST 1996 by heydon
+ modified on Mon Apr 18 14:03:44 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/init.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/init.html:1.2
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/init.html Tue Feb 10 22:59:16 1998
***************
*** 0 ****
--- 1,37 ----
+
+
+ Initialization
+
+
+
+ Last modified on Wed Apr 3 09:39:04 PST 1996 by heydon
+ modified on Mon Apr 18 13:28:21 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/interfaces.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/interfaces.html:1.2
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/interfaces.html Tue Feb 10 22:59:16 1998
***************
*** 0 ****
--- 1,29 ----
+
+
+ Interfaces
+
+ INTERFACE id;
+ Imports;
+ Decls
+ END id.
+
+
+ Last modified on Wed Apr 3 09:39:04 PST 1996 by heydon
+ modified on Mon Apr 18 14:04:10 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/intfs.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/intfs.html:1.2
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/intfs.html Tue Feb 10 22:59:16 1998
***************
*** 0 ****
--- 1,58 ----
+
+
+ Required interfaces
+
+
+
+
+
+ Last modified on Tue Oct 3 17:26:49 PDT 1995 by heydon
+ modified on Thu Jun 1 08:11:44 PDT 1995 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/intro.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/intro.html:1.2
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/intro.html Tue Feb 10 22:59:16 1998
***************
*** 0 ****
--- 1,523 ----
+
+
+ Introduction
+
+
+ History
+ Perspective
+ Features
+ Interfaces
+ Objects
+ Generics
+ Threads
+ Safety
+ Garbage Collection
+ Exceptions
+ Type system
+ Simplicity
+
+ Last modified on Wed Apr 3 09:24:01 PST 1996 by heydon
+ modified on Fri May 27 11:16:25 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/lock.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/lock.html:1.2
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/lock.html Tue Feb 10 22:59:16 1998
***************
*** 0 ****
--- 1,30 ----
+
+
+ Lock
+
+ LOCK mu DO S END
+
+
+ WITH m = mu DO
+ Thread.Acquire(m);
+ TRY S FINALLY Thread.Release(m) END
+ END
+
+
+ Last modified on Wed Apr 3 09:39:03 PST 1996 by heydon
+ modified on Mon Apr 18 14:04:17 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/loop.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/loop.html:1.2
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/loop.html Tue Feb 10 22:59:16 1998
***************
*** 0 ****
--- 1,25 ----
+
+
+ Loop
+
+ LOOP S END
+
+
+ TRY S; S; S; ... EXCEPT exit-exception => (*skip*) END
+
+
+
+ Last modified on Wed Apr 3 09:39:51 PST 1996 by heydon
+ modified on Mon Apr 18 14:04:28 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/m3.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/m3.html:1.2
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/m3.html Tue Feb 10 22:59:16 1998
***************
*** 0 ****
--- 1,50 ----
+
+
+ Modula-3: Language definition
+
+
+
+
+ Last modified on Tue Dec 5 09:47:57 PST 1995 by heydon
+ modified on Wed Apr 27 11:43:11 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/m3index.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/m3index.html:1.1.1.1
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/m3index.html Sat Jan 31 14:47:13 1998
***************
*** 0 ****
--- 1,490 ----
+
+
+ Index
+
+ # operator, *
+ & operator, *
+ (* *) (comment), *
+ * operator, *
+ + operator, *
+ - operator, *
+ . operator, *
+ .. in set and array constructors, * *
+ / operator, *
+ <* *> (pragma), *
+ <: declaration, * *
+ = operator, *
+ ^ operator, *
+
+
+ A
+ ABS, *
+ abstract type, *
+ Ada programming language, * * *
+ addition, *
+ ADDRESS, *
+ ADDRESS, assignment of, * *
+ ADR, *
+ ADRSIZE, *
+ aggregate, see records or arrays
+ Algol programming language, *
+ aliasing, of VAR parameters, *
+ alignment, see packed types
+ allocated type, *
+ allocation, *
+ AND, *
+ arithmetic operations, *
+ arrays, *
+ arrays, assigning, * * * * * * * * * *
+ ASCII, see ISO-Latin-1
+ assignable, *
+ assignable, READONLY/VALUE formals, * * * * * * * * * *
+ assignment statements, *
+ automatic dereferencing, *
+
+
+ B
+ B programming language, *
+ backslash, in literals, *
+ base type, *
+ BCPL programming language, *
+ binding power, of operators, *
+ bindings, in procedure call, *
+ bit operations, *
+ BITS FOR, * * * *
+ BITSIZE, *
+ Bliss programming language, *
+ block, *
+ block, module, * * *
+ body, of procedure, *
+ BOOLEAN, *
+ BOOLEAN, operations on, *
+ BRANDED, *
+ BYTESIZE, *
+
+
+ C
+ C programming language, *
+ C++ programming language, *
+ call, procedure, *
+ CARDINAL, *
+ carriage return, in literals, *
+ CASE statement, *
+ case, in keywords, * *
+ Cedar programming language, *
+ CEILING, *
+ CHAR, *
+ character literals, * *
+ checked runtime error, * * * * * * * * * * * * * * * * * * *
+ circularities, in imports lists, * *
+ CLU programming language, *
+ coercions, checked, * *
+ comments, *
+ comments, tokenizing, *
+ comparison operation, *
+ complete revelation, *
+ concatenating texts, *
+ concrete types, *
+ constant expression, * *
+ constants, *
+ constants, declarations, * * *
+ constructors, array, * * *
+ contain (value in type), *
+ conversion, enumerations and integers, * *
+ covers, for procedure signatures, *
+ cyclic imports, *
+
+
+ D
+ dangling pointer, *
+ data record, of object, *
+ deallocation, *
+ DEC, *
+ DEC, on addresses (unsafe), *
+ declaration, *
+ declaration, recursive, * *
+ default values, in record fields, * * *
+ delimiters, complete list, *
+ dereferencing, *
+ designators, *
+ designators, operators allowed in, * * *
+ dimension, *
+ DISPOSE, *
+ DIV, *
+ division by zero, *
+ division, real, *
+ double quote, in literals, *
+
+
+ E
+ element type, of array, *
+ empty type, *
+ enumerations, *
+ enumerations, first and last elements, * * * *
+ environment, of procedure, *
+ equality operator, *
+ errors, static and runtime, *
+ escape sequences, in literals, *
+ EVAL, *
+ example, pathological, * *
+ exceptions, * *
+ exceptions, RAISE, * * * * * *
+ EXIT, *
+ exit-exception, * * *
+ expanded definition (of type), *
+ exporting an interface, *
+ EXPORTS clause, *
+ expression, * *
+ expression, constant, * * *
+ EXTENDED, *
+ EXTENDED, literals, *
+ EXTERNAL, *
+
+
+ F
+ FALSE, *
+ field selection, records/objects, *
+ fields, of record, *
+ FIRST, *
+ fixed arrays, * * *
+ FLOAT, *
+ floating point numbers, *
+ floating-point interfaces, *
+ FLOOR, *
+ Fmt interface, *
+ FOR statement, *
+ fork (of a thread), *
+ form feed, in literals, *
+ formatting data as texts, *
+ FROM ... IMPORT, *
+ function procedures, * * *
+
+
+ G
+ garbage collection, * *
+ generic interface, * * *
+ generics, * *
+
+
+ H
+ handlers, for exceptions, *
+ hash tables, see Table interface *
+ hexadecimal literal, *
+
+
+ I
+ identifiers, *
+ identifiers, lexical structure, * * * * *
+ IF, *
+ import cycle, *
+ imports, *
+ IN (a set), *
+ INC, * *
+ index type, of array, *
+ inheritance, *
+ initialization, during allocation, * * * *
+ INLINE, *
+ INTEGER, *
+ interfaces, * *
+ interfaces, exporting, * * * *
+ intersection, set, *
+ intrinsically safe, *
+ ISO-Latin-1, *
+ ISTYPE, *
+
+
+ J
+ join (of a thread), *
+
+
+ K
+ keyword binding, *
+ keywords, complete list, *
+
+
+ L
+ LAST, *
+ Lisp programming language, *
+ literals, character, * * * *
+ local procedures, * * *
+ location, *
+ LOCK statement, *
+ LONGREAL, *
+ LONGREAL, literals, *
+ LOOP, *
+ LOOPHOLE, *
+
+
+ M
+ main module, *
+ masked field, *
+ MAX, *
+ member (value in type), *
+ Mesa programming language, *
+ method suite, *
+ methods, *
+ methods, declaring, * * * *
+ MIN, *
+ ML programming language, *
+ MOD, *
+ mode, see parameter mode
+ Modula-2 programming language, *
+ Modula-3 Abstract Syntax Trees, *
+ modules, * *
+ modules, initialization, * *
+ monitor, *
+ multi-dimensional arrays, *
+ multiplication, *
+ MUTEX, * *
+
+
+ N
+ NARROW, *
+ NEW, *
+ newline, in literals, *
+ NIL, *
+ normal outcome, *
+ NOT, *
+ NULL, *
+ NUMBER, *
+ numbers, literal, *
+
+
+ O
+ Oberon programming language, *
+ objects, * *
+ objects, accessing fields and methods, * * * * * * * * *
+ octal literal, *
+ opaque types, *
+ open arrays, * * * * *
+ operators, complete list, * * *
+ OR, *
+ ORD, *
+ order (<, >, ...), * *
+ ordinal types, * * * *
+ overflow, *
+ overloading, of operation, *
+ overriding, * *
+
+
+ P
+ package, see module
+ packed types, * *
+ parameter mode, * *
+ partial expansion (of type), * * *
+ partially opaque type, * *
+ Pascal programming language, *
+ persistent storage, see Pkl interface *
+ Pkl (pickle) interface, *
+ pointer, see reference
+ positional binding, *
+ pragmas, *
+ precedence, of operators, *
+ procedural operator, *
+ procedure call, *
+ procedures, *
+ procedures, RETURN, * * * * * * * * * * * * *
+ process algebra, *
+ process, see thread
+ program, definition of, *
+ proper procedure, *
+
+
+ Q
+ qualified identifier, *
+
+
+ R
+ RAISE, *
+ RAISES, *
+ raises set, of procedure, *
+ RAISES, dangling, * *
+ readonly designator, * *
+ READONLY parameters, *
+ REAL, *
+ real division, *
+ REAL, conversions to, * * *
+ records, *
+ records, constructors for, * * *
+ recursive declarations, *
+ REFANY, *
+ reference class, *
+ references, *
+ references, TYPECASE, * * * * * * * *
+ referent, * *
+ reflexive relation, *
+ relational operators, *
+ remainder, see MOD
+ REPEAT statement, *
+ required interfaces, *
+ result type, of procedure, *
+ RETURN, *
+ return-exception, * *
+ REVEAL, *
+ revelations, *
+ revelations, imported, *
+ ROOT, *
+ ROUND, *
+ rounding of arithmetic operations, *
+ runtime error, *
+
+
+ S
+ safety, * *
+ scale factors, in numeric literals, *
+ scope, *
+ scope, block statement, * * * * * * * * * * *
+ selection of fields, *
+ sequential composition, *
+ sets, *
+ sets, IN operator, * * * * * * * *
+ shape, of array, *
+ shared variables, *
+ sign inversion, *
+ signature, * *
+ signature, covers, *
+ single quote, in literals, *
+ size, of type, *
+ Smalltalk programming language, *
+ statements, *
+ static error, * *
+ storage allocation, * * *
+ strings, *
+ strings, see texts *
+ structural equivalence, *
+ SUBARRAY, *
+ subranges, *
+ subranges, subtyping rules, *
+ subscript operator, *
+ subset operation, *
+ subtraction, *
+ subtype relation, *
+ supertype (subtyping relation), *
+ symmetric set difference, *
+ syntax, *
+
+
+ T
+ tab, in literals, *
+ Table interface, *
+ task, see thread
+ termination of program, *
+ TEXT, *
+ Text interface, *
+ texts, *
+ texts, concatenating, * * *
+ Thread creation, *
+ threads, *
+ tokenizing, *
+ top-level procedure, *
+ Topaz system, *
+ traced, object types, * * *
+ transitive relation, *
+ TRUE, *
+ TRUNC, *
+ TRY EXCEPT, * *
+ type, * * * * *
+ type, assignable, * * * * * * * *
+ TYPECASE, *
+ TYPECODE, *
+
+
+ U
+ unchecked runtime errors, * *
+ undefined procedure, *
+ underflow, *
+ union, of sets, *
+ UNSAFE, *
+ unsafe features, *
+ unsigned integers, * *
+ UNTRACED ROOT, *
+ UNTRACED, in reference declarations, * *
+
+
+ V
+ VAL, *
+ value, *
+ VALUE parameters, * *
+ VAR declarations, * * *
+ variables, * *
+ variables, initialization, * * *
+ variant records, *
+ visibility, see scope
+
+
+ W
+ WHILE statement, *
+ WITH statement, *
+ Word interface, *
+ word size, of type, *
+ writable designator, * *
+
+
+ X
Y
Z
+ zero, division by, *
+
+
+
+ Last modified on Wed Apr 3 09:39:04 PST 1996 by heydon
+ modified on Mon Apr 18 14:48:58 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/m3makefile
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/m3makefile:1.1.1.1
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/m3makefile Sat Jan 31 14:47:13 1998
***************
*** 0 ****
--- 1,81 ----
+ HtmlFile("acks")
+ HtmlFile("apply")
+ HtmlFile("arithmetic")
+ HtmlFile("arrays")
+ HtmlFile("assign")
+ HtmlFile("authors")
+ HtmlFile("block")
+ HtmlFile("boolops")
+ HtmlFile("builtin")
+ HtmlFile("calls")
+ HtmlFile("case")
+ HtmlFile("constants")
+ HtmlFile("constexpr")
+ HtmlFile("construct")
+ HtmlFile("conventions")
+ HtmlFile("decls")
+ HtmlFile("defns")
+ HtmlFile("designators")
+ HtmlFile("eval")
+ HtmlFile("example")
+ HtmlFile("exceptions")
+ HtmlFile("exit")
+ HtmlFile("exprs")
+ HtmlFile("float-intf")
+ HtmlFile("floatmode")
+ HtmlFile("floats")
+ HtmlFile("for")
+ HtmlFile("generics")
+ HtmlFile("if")
+ HtmlFile("imports")
+ HtmlFile("incdec")
+ HtmlFile("init")
+ HtmlFile("interfaces")
+ HtmlFile("intfs")
+ HtmlFile("intro")
+ HtmlFile("lock")
+ HtmlFile("loop")
+ HtmlFile("m3")
+ HtmlFile("m3index")
+ HtmlFile("modules")
+ HtmlFile("new")
+ HtmlFile("nil")
+ HtmlFile("numbers")
+ HtmlFile("objects")
+ HtmlFile("opaques")
+ HtmlFile("opsyntax")
+ HtmlFile("ordinal")
+ HtmlFile("packed")
+ HtmlFile("procedures")
+ HtmlFile("procs")
+ HtmlFile("raise")
+ HtmlFile("real-intf")
+ HtmlFile("records")
+ HtmlFile("recursion")
+ HtmlFile("refs")
+ HtmlFile("relations")
+ HtmlFile("repeat")
+ HtmlFile("return")
+ HtmlFile("revelations")
+ HtmlFile("safety")
+ HtmlFile("sequence")
+ HtmlFile("sets")
+ HtmlFile("stmts")
+ HtmlFile("subtypes")
+ HtmlFile("syntax")
+ HtmlFile("text-intf")
+ HtmlFile("textops")
+ HtmlFile("texts")
+ HtmlFile("thread-intf")
+ HtmlFile("tryexcept")
+ HtmlFile("tryfinally")
+ HtmlFile("type-decl")
+ HtmlFile("typecase")
+ HtmlFile("typeops")
+ HtmlFile("types")
+ HtmlFile("units")
+ HtmlFile("unsafe")
+ HtmlFile("variables")
+ HtmlFile("while")
+ HtmlFile("with")
+ HtmlFile("word-intf")
Index: m3/pm3/language/modula3/src/m3defn/modules.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/modules.html:1.2
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/modules.html Tue Feb 10 22:59:16 1998
***************
*** 0 ****
--- 1,94 ----
+
+
+ Modules
+
+ MODULE id EXPORTS Interfaces;
+ Imports;
+ Block id.
+
+
+ INTERFACE I;
+ PROCEDURE X(); ...
+
+ INTERFACE J;
+ PROCEDURE X(); ...
+
+ MODULE M EXPORTS I, J;
+ PROCEDURE X() = ...;
+
+
+ INTERFACE I;
+ PROCEDURE X(); ...
+
+ MODULE M EXPORTS I;
+ FROM I IMPORT X;
+ PROCEDURE X() = ...;
+
+
+ INTERFACE I;
+ PROCEDURE X(...); ...
+
+ MODULE M EXPORTS I;
+ IMPORT I;
+ PROCEDURE X(...) = ...;
+
+
+ Last modified on Wed Apr 3 09:39:03 PST 1996 by heydon
+ modified on Mon Apr 18 14:04:34 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/new.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/new.html:1.2
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/new.html Tue Feb 10 22:59:16 1998
***************
*** 0 ****
--- 1,82 ----
+
+
+ New
+
+ NEW(T, ...)
+
+
+ NEW(T, n_1, ..., n_k)
+
+
+ NEW(T, Bindings)
+
+
+ NEW(T OBJECT OVERRIDES m := P END).
+
+
+
+ Last modified on Wed Apr 3 09:39:02 PST 1996 by heydon
+ modified on Mon Apr 18 14:04:40 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/nil.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/nil.html:1.1.1.1
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/nil.html Sat Jan 31 14:47:13 1998
***************
*** 0 ****
--- 1,19 ----
+
+
+ Nil
+
+ Last modified on Wed Apr 3 09:39:02 PST 1996 by heydon
+ modified on Mon Apr 18 14:04:47 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/numbers.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/numbers.html:1.1.1.1
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/numbers.html Sat Jan 31 14:47:13 1998
***************
*** 0 ****
--- 1,70 ----
+
+
+ Numeric literals
+
+ Last modified on Wed Apr 3 09:39:02 PST 1996 by heydon
+ modified on Mon Apr 18 14:04:55 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/objects.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/objects.html:1.2
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/objects.html Tue Feb 10 22:59:17 1998
***************
*** 0 ****
--- 1,244 ----
+
+
+ Object types
+
+ ROOT The traced object type with no fields or methods
+ UNTRACED ROOT The untraced object type with no fields or methods
+
+
+ TYPE T = ST OBJECT
+ Fields
+ METHODS
+ Methods
+ OVERRIDES
+ Overrides
+ END
+
+
+ m sig := proc
+
+
+ m := proc
+
+
+ TYPE
+ A = OBJECT a: INTEGER; METHODS p() END;
+ AB = A OBJECT b: INTEGER END;
+
+ PROCEDURE Pa(self: A) = ... ;
+ PROCEDURE Pab(self: AB) = ... ;
+
+
+ TYPE T1 = AB OBJECT OVERRIDES p := Pab END
+
+
+ TYPE T2 = A OBJECT OVERRIDES p := Pa END
+
+
+ TYPE T3 = AB OBJECT OVERRIDES p := Pa END
+
+
+ TYPE T4 = A OBJECT OVERRIDES p := Pab END
+
+
+ TYPE
+ A = OBJECT METHODS m() := P END;
+ B = A OBJECT OVERRIDES m := Q END;
+ C = A OBJECT METHODS m() := Q END;
+
+ VAR
+ a := NEW(A); b := NEW(B); c := NEW(C);
+
+
+ a.m() activates P(a)
+ b.m() activates Q(b)
+ c.m() activates Q(c)
+
+
+ NARROW(b, A).m() activates Q(b)
+ NARROW(c, A).m() activates P(c)
+
+
+ TYPE
+ Queue = RECORD head, tail: QueueElem END;
+ QueueElem = OBJECT link: QueueElem END;
+
+ PROCEDURE Insert (VAR q: Queue; x: QueueElem);
+ PROCEDURE Delete (VAR q: Queue): QueueElem;
+ PROCEDURE Clear (VAR q: Queue);
+
+
+ TYPE
+ IntQueueElem = QueueElem OBJECT val: INTEGER END;
+ VAR
+ q: Queue;
+ x: IntQueueElem;
+ ...
+ Clear(q);
+ x := NEW(IntQueueElem, val := 6);
+ Insert(q, x);
+ ...
+ x := Delete(q)
+
+
+ Last modified on Wed Apr 3 09:39:02 PST 1996 by heydon
+ modified on Thu Sep 15 10:44:33 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/opaques.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/opaques.html:1.2
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/opaques.html Tue Feb 10 22:59:17 1998
***************
*** 0 ****
--- 1,37 ----
+
+
+ Opaque types
+
+ TYPE T <: U
+
+
+ Last modified on Wed Apr 3 09:39:01 PST 1996 by heydon
+ modified on Mon Apr 18 14:05:14 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/opsyntax.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/opsyntax.html:1.2
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/opsyntax.html Tue Feb 10 22:59:17 1998
***************
*** 0 ****
--- 1,54 ----
+
+
+ Operation syntax
+
+ x.a infix dot
+ f(x) a[i] T{x} applicative (, [, {
+ p^ postfix ^
+ + - prefix arithmetics
+ * / DIV MOD infix arithmetics
+ + - & infix arithmetics
+ = # < <= >= > IN infix relations
+ NOT prefix NOT
+ AND infix AND
+ OR infix OR
+
+
+ M.F(x) (M.F)(x) dot before application
+ Q(x)^ (Q(x))^ application before ^
+ - p^ - (p^) ^ before prefix -
+ - a * b (- a) * b prefix - before *
+ a * b - c (a * b) - c * before infix -
+ x IN s - t x IN (s - t) infix - before IN
+ NOT x IN s NOT (x IN s) IN before NOT
+ NOT p AND q (NOT p) AND q NOT before AND
+ A OR B AND C A OR (B AND C) AND before OR
+
+
+ Last modified on Wed Apr 3 09:39:01 PST 1996 by heydon
+ modified on Fri Apr 15 15:29:56 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/ordinal.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/ordinal.html:1.2
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/ordinal.html Tue Feb 10 22:59:17 1998
***************
*** 0 ****
--- 1,93 ----
+
+
+ Ordinal types
+
+ TYPE T = {id_1, id_2, ..., id_n}
+
+
+ TYPE T = [Lo..Hi]
+
+
+ INTEGER All integers represented by the implementation
+ CARDINAL Behaves just like the subrange [0..LAST(INTEGER)]
+ BOOLEAN The enumeration {FALSE, TRUE}
+ CHAR An enumeration containing at least 256 elements
+
+
+ TYPE
+ T1 = {A, B, C};
+ T2 = {A, B, C};
+ U1 = [T1.A..T1.C];
+ U2 = [T1.A..T2.C]; (* sic *)
+ V = {A, B}
+
+
+ Last modified on Wed Apr 3 09:39:00 PST 1996 by heydon
+ modified on Mon Apr 18 15:32:23 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/packed.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/packed.html:1.2
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/packed.html Tue Feb 10 22:59:17 1998
***************
*** 0 ****
--- 1,36 ----
+
+
+ Packed types
+
+ TYPE T = BITS n FOR Base
+
+
+ ARRAY [0..255] OF BITS 1 FOR BOOLEAN
+
+
+ Last modified on Wed Apr 3 09:39:01 PST 1996 by heydon
+ modified on Mon Apr 18 14:05:35 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/procedures.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/procedures.html:1.2
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/procedures.html Tue Feb 10 22:59:17 1998
***************
*** 0 ****
--- 1,42 ----
+
+
+ Procedures
+
+ PROCEDURE id sig = B id
+
+ PROCEDURE id sig
+
+
+ Last modified on Wed Apr 3 09:39:00 PST 1996 by heydon
+ modified on Mon Apr 18 14:05:44 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/procs.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/procs.html:1.2
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/procs.html Tue Feb 10 22:59:17 1998
***************
*** 0 ****
--- 1,157 ----
+
+
+ Procedure types
+
+
+
+ TYPE T = PROCEDURE sig
+
+
+ (formal_1; ...; formal_n): R RAISES S
+
+
+
+
+ Mode Name: Type := Default
+
+
+
+
+ Mode v_1, ..., v_n: Type := Default
+
+
+ Mode v_1: Type := Default; ...; Mode v_n: Type := Default
+
+
+
+
+ PROCEDURE P(txt: TEXT := "P") =
+ BEGIN
+ Wr.PutText(Stdio.stdout, txt)
+ END P;
+
+ VAR q: PROCEDURE(txt: TEXT := "Q") := P;
+
+
+ TYPE
+ Integrand = PROCEDURE (x: REAL): REAL;
+ Integrator = PROCEDURE(f: Integrand; lo, hi: REAL): REAL;
+
+ TokenIterator = PROCEDURE(VAR t: Token) RAISES {TokenError};
+
+ RenderProc = PROCEDURE(
+ scene: REFANY;
+ READONLY t: Transform := Identity)
+
+
+ TYPE T = PROCEDURE (): (PROCEDURE ()) RAISES {}
+
+
+
+ Last modified on Wed Apr 3 09:39:00 PST 1996 by heydon
+ modified on Mon Dec 19 08:18:44 PST 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/raise.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/raise.html:1.2
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/raise.html Tue Feb 10 22:59:17 1998
***************
*** 0 ****
--- 1,30 ----
+
+
+ Raise
+
+ RAISE e
+
+
+ RAISE e(x)
+
+
+ Last modified on Wed Apr 3 09:38:59 PST 1996 by heydon
+ modified on Mon Apr 18 14:06:00 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/real-intf.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/real-intf.html:1.1.1.1
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/real-intf.html Sat Jan 31 14:47:13 1998
***************
*** 0 ****
--- 1,81 ----
+
+
+ The Real, LongReal and Extended interfaces
+
+ INTERFACE Real; TYPE T = REAL;
+ CONST
+ Base: INTEGER = ...;
+ Precision: INTEGER = ...;
+ MaxFinite: T = ...;
+ MinPos: T = ...;
+ MinPosNormal: T = ...;
+ END Real.
+
+
+ INTERFACE LongReal; TYPE T = LONGREAL;
+ CONST
+ Base: INTEGER = ...;
+ Precision: INTEGER = ...;
+ MaxFinite: T = ...;
+ MinPos: T = ...;
+ MinPosNormal: T = ...;
+ END LongReal.
+
+
+ INTERFACE Extended; TYPE T = EXTENDED;
+ CONST
+ Base: INTEGER = ...;
+ Precision: INTEGER = ...;
+ MaxFinite: T = ...;
+ MinPos: T = ...;
+ MinPosNormal: T = ...;
+ END Extended.
+
+
+ Last modified on Wed Apr 3 09:38:59 PST 1996 by heydon
+ modified on Thu Jun 1 08:12:25 PDT 1995 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/records.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/records.html:1.2
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/records.html Tue Feb 10 22:59:17 1998
***************
*** 0 ****
--- 1,88 ----
+
+
+ Record types
+
+ TYPE T = RECORD FieldList END
+
+
+ fieldName: Type := default
+
+
+ f_1, ..., f_m: Type := default
+
+
+ f_1: Type := default; ...; f_m: Type := default
+
+
+ TYPE
+ Time = RECORD
+ seconds: INTEGER;
+ milliseconds: [0..999]
+ END;
+
+ Alignment = {Left, Center, Right};
+
+ TextWindowStyle = RECORD
+ align := Alignment.Center;
+ font := Font.Default;
+ foreground := Color.Black;
+ background := Color.White;
+ margin, border := 2
+ END
+
+
+ Last modified on Wed Apr 3 09:38:59 PST 1996 by heydon
+ modified on Mon Apr 18 14:06:17 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/recursion.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/recursion.html:1.1.1.1
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/recursion.html Sat Jan 31 14:47:13 1998
***************
*** 0 ****
--- 1,63 ----
+
+
+ Recursive declarations
+
+ TYPE
+ List = REF RECORD x: REAL; link: List END;
+ T = PROCEDURE(n: INTEGER; p: T);
+ XList = X OBJECT link: XList END;
+ CONST N = BYTESIZE(REF ARRAY [0..N] OF REAL);
+ PROCEDURE P(b: BOOLEAN) = BEGIN IF b THEN P(NOT b) END END P;
+ EXCEPTION E(PROCEDURE () RAISES {E});
+ VAR v: REF ARRAY [0..BYTESIZE(v)] OF INTEGER;
+
+
+ TYPE
+ T = RECORD x: T END;
+ U = OBJECT METHODS m() := U.m END;
+ CONST N = N+1;
+ REVEAL I.T = I.T BRANDED OBJECT END;
+ VAR v := P(); PROCEDURE P(): ARRAY [0..LAST(v)] OF T;
+
+
+ VAR n := BITSIZE(n);
+ REVEAL T <: T;
+
+
+ Last modified on Wed Apr 3 09:38:58 PST 1996 by heydon
+ modified on Mon Apr 18 14:06:26 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/refs.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/refs.html:1.2
*** /dev/null Tue Feb 10 23:31:56 1998
--- m3/pm3/language/modula3/src/m3defn/refs.html Tue Feb 10 22:59:17 1998
***************
*** 0 ****
--- 1,91 ----
+
+
+ Reference types
+
+ TYPE T = REF Type
+
+
+ TYPE T = UNTRACED REF Type
+
+
+ REFANY Contains all traced references
+ ADDRESS Contains all untraced references
+ NULL Contains only NIL
+
+
+ TYPE TextLine = REF ARRAY OF CHAR;
+
+ ControllerHandle = UNTRACED REF RECORD
+ status: BITS 8 FOR [0..255];
+ filler: BITS 12 FOR [0..0];
+ pc: BITS 12 FOR [0..4095]
+ END;
+
+ T = BRANDED "ANSI-M3-040776" REF INTEGER;
+
+ Apple = BRANDED REF INTEGER;
+ Orange = BRANDED REF INTEGER;
+
+
+
+ Last modified on Wed Apr 3 09:38:58 PST 1996 by heydon
+ modified on Mon Apr 18 15:32:31 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/relations.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/relations.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/relations.html Tue Feb 10 22:59:18 1998
***************
*** 0 ****
--- 1,78 ----
+
+
+ Relations
+
+ infix =, # (x, y: Any): BOOLEAN
+
+
+ infix <=, >= (x,y: Ordinal) : BOOLEAN
+ (x,y: Float) : BOOLEAN
+ (x,y: ADDRESS) : BOOLEAN
+ (x,y: Set) : BOOLEAN
+
+
+ infix >, < (x,y: Ordinal) : BOOLEAN
+ (x,y: Float) : BOOLEAN
+ (x,y: ADDRESS) : BOOLEAN
+ (x,y: Set) : BOOLEAN
+
+
+ infix IN (e: Ordinal; s: Set): BOOLEAN
+
+
+ Last modified on Wed Apr 3 09:38:58 PST 1996 by heydon
+ modified on Mon Apr 18 14:06:39 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/repeat.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/repeat.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/repeat.html Tue Feb 10 22:59:18 1998
***************
*** 0 ****
--- 1,25 ----
+
+
+ Repeat
+
+ REPEAT S UNTIL B
+
+
+ LOOP S; IF B THEN EXIT END END
+
+
+
+ Last modified on Wed Apr 3 09:38:57 PST 1996 by heydon
+ modified on Mon Apr 18 14:06:46 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/return.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/return.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/return.html Tue Feb 10 22:59:18 1998
***************
*** 0 ****
--- 1,58 ----
+
+
+ Return
+
+ RETURN
+
+
+ RETURN Expr
+
+
+ TRY B EXCEPT return-exception => (*skip*) END
+
+
+ TRY
+ B; (error: no returned value)
+ EXCEPT
+ return-exception (v) => (the result becomes v)
+ END
+
+
+
+ Last modified on Wed Apr 3 09:38:57 PST 1996 by heydon
+ modified on Mon Apr 18 14:06:52 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/revelations.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/revelations.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/revelations.html Tue Feb 10 22:59:18 1998
***************
*** 0 ****
--- 1,84 ----
+
+
+ Revelations
+
+ REVEAL T <: V
+
+
+ REVEAL T = V
+
+
+ INTERFACE I; TYPE T <: ROOT; PROCEDURE P(x:T): T; END I.
+
+ INTERFACE IClass; IMPORT I; REVEAL I.T <: MUTEX; END IClass.
+
+ INTERFACE IRep; IMPORT I;
+ REVEAL I.T = MUTEX BRANDED OBJECT count: INTEGER END;
+ END IRep.
+
+ Last modified on Wed Apr 3 09:38:57 PST 1996 by heydon
+ modified on Mon Apr 18 14:06:59 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/safety.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/safety.html:1.1.1.1
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/safety.html Sat Jan 31 14:47:13 1998
***************
*** 0 ****
--- 1,36 ----
+
+
+ Safety
+
+ Last modified on Wed Apr 3 09:38:56 PST 1996 by heydon
+ modified on Mon Apr 18 14:07:05 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/sequence.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/sequence.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/sequence.html Tue Feb 10 22:59:18 1998
***************
*** 0 ****
--- 1,30 ----
+
+
+ Sequential composition
+
+ S_1; S_2
+
+
+ Last modified on Wed Apr 3 09:38:56 PST 1996 by heydon
+ modified on Mon Apr 18 14:07:12 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/sets.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/sets.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/sets.html Tue Feb 10 22:59:18 1998
***************
*** 0 ****
--- 1,34 ----
+
+
+ Set types
+
+ TYPE T = SET OF Base
+
+
+ {} {0} {1} {0,1}
+
+
+ Last modified on Wed Apr 3 09:38:56 PST 1996 by heydon
+ modified on Mon Apr 18 14:07:20 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/stmts.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/stmts.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/stmts.html Tue Feb 10 22:59:18 1998
***************
*** 0 ****
--- 1,77 ----
+
+
+ Statements
+
+
+
+
+
+ Last modified on Wed Apr 3 09:38:55 PST 1996 by heydon
+ modified on Fri Apr 15 08:41:20 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/subtypes.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/subtypes.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/subtypes.html Tue Feb 10 22:59:18 1998
***************
*** 0 ****
--- 1,121 ----
+
+
+ Subtyping rules
+
+ (ARRAY OF)^m ARRAY J_1 OF ... ARRAY J_n OF
+ ARRAY K_1 OF ... ARRAY K_p OF T
+ <: (ARRAY OF)^m (ARRAY OF)^n
+ ARRAY I_1 OF ... ARRAY I_p OF T
+
+ if NUMBER(I_i) = NUMBER(K_i) for i = 1, ..., p.
+
+
+ NULL <: REF T <: REFANY
+ NULL <: UNTRACED REF T <: ADDRESS
+
+
+ NULL <: PROCEDURE(A): R RAISES S for any A, R, and S.
+
+
+ PROCEDURE(A): Q RAISES E <: PROCEDURE(B): R RAISES F
+ if signature "(B): R RAISES F" covers signature "(A): Q RAISES E".
+
+
+ ROOT <: REFANY
+ UNTRACED ROOT <: ADDRESS
+ NULL <: T OBJECT ... END <: T
+
+
+ BITS n FOR T <: T and T <: BITS n FOR T
+
+
+ T <: T for all T
+ T <: U and U <: V implies T <: V for all T, U, V.
+
+
+ TYPE
+ T = [0..255];
+ U = BITS 8 FOR [0..255];
+ AT = ARRAY OF T;
+ AU = ARRAY OF U;
+
+
+ Last modified on Wed Apr 3 09:38:55 PST 1996 by heydon
+ modified on Mon Apr 18 14:07:28 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/syntax.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/syntax.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/syntax.html Tue Feb 10 22:59:18 1998
***************
*** 0 ****
--- 1,331 ----
+
+
+ Syntax
+
+ Keywords
+
+ AND DO FROM NOT REPEAT UNTIL
+ ANY ELSE GENERIC OBJECT RETURN UNTRACED
+ ARRAY ELSIF IF OF REVEAL VALUE
+ AS END IMPORT OR ROOT VAR
+ BEGIN EVAL IN OVERRIDES SET WHILE
+ BITS EXCEPT INTERFACE PROCEDURE THEN WITH
+ BRANDED EXCEPTION LOCK RAISE TO
+ BY EXIT LOOP RAISES TRY
+ CASE EXPORTS METHODS READONLY TYPE
+ CONST FINALLY MOD RECORD TYPECASE
+ DIV FOR MODULE REF UNSAFE
+
+ Reserved identifiers
+
+ ABS BYTESIZE EXTENDED INTEGER MIN NUMBER TEXT
+ ADDRESS CARDINAL FALSE ISTYPE MUTEX ORD TRUE
+ ADR CEILING FIRST LAST NARROW REAL TRUNC
+ ADRSIZE CHAR FLOAT LONGREAL NEW REFANY TYPECODE
+ BITSIZE DEC FLOOR LOOPHOLE NIL ROUND VAL
+ BOOLEAN DISPOSE INC MAX NULL SUBARRAY
+
+ Operators
+
+ + < # = ; .. :
+ - > { } | := <:
+ * <= ( ) ^ , =>
+ / >= [ ] . &
+
+ Comments
+ Pragmas
+ Conventions for syntax
+
+ X Y X followed by Y
+ X|Y X or Y.
+ [X] X or empty
+ {X} A possibly empty sequence of X's
+ X&Y X or Y or X Y
+
+ Compilation unit productions
+
+ Compilation = [UNSAFE] (Interface | Module) | GenInf | GenMod.
+
+ Interface = INTERFACE Id ";" {Import} {Decl} END Id "."
+ | INTERFACE Id "=" Id GenActls END Id ".".
+ Module = MODULE Id [EXPORTS IdList] ";" {Import} Block Id "."
+ | MODULE Id [EXPORTS IdList] "=" Id GenActls END Id ".".
+
+ GenInf = GENERIC INTERFACE Id GenFmls ";" {Import} {Decl} END Id ".".
+ GenMod = GENERIC MODULE Id GenFmls ";" {Import} Block Id ".".
+
+ Import = AsImport | FromImport.
+ AsImport = IMPORT ImportItem {"," ImportItem} ";".
+ FromImport = FROM Id IMPORT IdList ";".
+ Block = {Decl} BEGIN S END.
+ Decl = CONST {ConstDecl ";"}
+ | TYPE {TypeDecl ";"}
+ | EXCEPTION {ExceptionDecl ";"}
+ | VAR {VariableDecl ";"}
+ | ProcedureHead ["=" Block Id] ";"
+ | REVEAL {QualId ("=" | "<:") Type ";"}.
+
+ GenFmls = "(" [IdList] ")".
+ GenActls = "(" [IdList] ")".
+ ImportItem = Id | Id AS Id.
+ ConstDecl = Id [":" Type] "=" ConstExpr.
+ TypeDecl = Id ("=" | "<:") Type.
+ ExceptionDecl = Id ["(" Type ")"].
+ VariableDecl = IdList (":" Type & ":=" Expr).
+ ProcedureHead = PROCEDURE Id Signature.
+
+ Signature = "(" Formals ")" [":" Type] [RAISES Raises].
+ Formals = [ Formal {";" Formal} [";"] ].
+ Formal = [Mode] IdList (":" Type & ":=" ConstExpr).
+ Mode = VALUE | VAR | READONLY.
+ Raises = "{" [ QualId {"," QualId} ] "}" | ANY.
+
+ Statement productions
+
+ Stmt = AssignSt | Block | CallSt | CaseSt | ExitSt | EvalSt | ForSt
+ | IfSt | LockSt | LoopSt | RaiseSt | RepeatSt | ReturnSt
+ | TCaseSt | TryXptSt | TryFinSt | WhileSt | WithSt.
+
+ S = [ Stmt {";" Stmt} [";"] ].
+
+ AssignSt = Expr ":=" Expr.
+ CallSt = Expr "(" [Actual {"," Actual}] ")".
+ CaseSt = CASE Expr OF [Case] {"|" Case} [ELSE S] END.
+ ExitSt = EXIT.
+ EvalSt = EVAL Expr.
+ ForSt = FOR Id ":=" Expr TO Expr [BY Expr] DO S END.
+ IfSt = IF Expr THEN S {ELSIF Expr THEN S} [ELSE S] END.
+ LockSt = LOCK Expr DO S END.
+ LoopSt = LOOP S END.
+ RaiseSt = RAISE QualId ["(" Expr ")"].
+ RepeatSt = REPEAT S UNTIL Expr.
+ ReturnSt = RETURN [Expr].
+ TCaseSt = TYPECASE Expr OF [TCase] {"|" TCase} [ELSE S] END.
+ TryXptSt = TRY S EXCEPT [Handler] {"|" Handler} [ELSE S] END.
+ TryFinSt = TRY S FINALLY S END.
+ WhileSt = WHILE Expr DO S END.
+ WithSt = WITH Binding {"," Binding} DO S END.
+
+ Case = Labels {"," Labels} "=>" S.
+ Labels = ConstExpr [".." ConstExpr].
+ Handler = QualId {"," QualId} ["(" Id ")"] "=>" S.
+ TCase = Type {"," Type} ["(" Id ")"] "=>" S.
+ Binding = Id "=" Expr.
+ Actual = Type | [Id ":="] Expr .
+
+
+ Type productions
+
+ Type = TypeName | ArrayType | PackedType | EnumType | ObjectType
+ | ProcedureType | RecordType | RefType | SetType | SubrangeType
+ | "(" Type ")".
+
+ ArrayType = ARRAY [Type {"," Type}] OF Type.
+ PackedType = BITS ConstExpr FOR Type.
+ EnumType = "{" [IdList] "}".
+ ObjectType = [TypeName | ObjectType] [Brand] OBJECT Fields
+ [METHODS Methods] [OVERRIDES Overrides] END.
+ ProcedureType = PROCEDURE Signature.
+ RecordType = RECORD Fields END.
+ RefType = [UNTRACED] [Brand] REF Type.
+ SetType = SET OF Type.
+ SubrangeType = "[" ConstExpr ".." ConstExpr "]".
+
+ Brand = BRANDED [ConstExpr].
+ Fields = [ Field {";" Field} [";"] ].
+ Field = IdList (":" Type & ":=" ConstExpr).
+ Methods = [ Method {";" Method} [";"] ].
+ Method = Id Signature [":=" ConstExpr].
+ Overrides = [ Override {";" Override} [";"] ].
+ Override = Id ":=" ConstExpr .
+
+
+ Expression productions
+
+ ConstExpr = Expr.
+
+ Expr = E1 {OR E1}.
+ E1 = E2 {AND E2}.
+ E2 = {NOT} E3.
+ E3 = E4 {Relop E4}.
+ E4 = E5 {Addop E5}.
+ E5 = E6 {Mulop E6}.
+ E6 = {"+" | "-"} E7.
+ E7 = E8 {Selector}.
+ E8 = Id | Number | CharLiteral | TextLiteral
+ | Constructor | "(" Expr ")".
+
+ Relop = "=" | "#" | "<" | "<=" | ">" | ">=" | IN.
+ Addop = "+" | "-" | "&".
+ Mulop = "*" | "/" | DIV | MOD.
+
+ Selector = "^" | "." Id | "[" Expr {"," Expr} "]"
+ | "(" [ Actual {"," Actual} ] ")".
+
+ Constructor = Type "{" [ SetCons | RecordCons | ArrayCons ] "}".
+
+ SetCons = SetElt {"," SetElt}.
+ SetElt = Expr [".." Expr].
+ RecordCons = RecordElt {"," RecordElt}.
+ RecordElt = [Id ":="] Expr.
+ ArrayCons = Expr {"," Expr} ["," ".."].
+
+
+ Miscellaneous productions
+
+
+ IdList = Id {"," Id}.
+ QualId = Id ["." Id].
+ TypeName = QualId | ROOT | UNTRACED ROOT.
+
+ Token productions
+
+ Id = Letter {Letter | Digit | "_"}.
+
+ Literal = Number | CharLiteral | TextLiteral.
+
+ CharLiteral = "'" (PrintingChar | Escape | DQUOTE) "'".
+
+ TextLiteral = DQUOTE {PrintingChar | Escape | "'"} DQUOTE.
+
+ Escape = "\" "n" | "\" "t" | "\" "r" | "\" "f"
+ | "\" "\" | "\" "'" | "\" DQUOTE
+ | "\" OctalDigit OctalDigit OctalDigit.
+
+ Number = Digit {Digit}
+ | Digit {Digit} "_" HexDigit {HexDigit}
+ | Digit {Digit} "." Digit {Digit} [Exp].
+
+ Exp = ("E" | "e" | "D" | "d" | "X" | "x") ["+" | "-"] Digit {Digit}.
+
+ PrintingChar = Letter | Digit | OtherChar.
+
+ HexDigit = Digit | "A" | "B" | "C" | "D" | "E" | "F"
+ | "a" | "b" | "c" | "d" | "e" | "f".
+
+ Digit = "0" | "1" | ... | "9".
+
+ OctalDigit = "0" | "1" | ... | "7".
+
+ Letter = "A" | "B" | ... | "Z" | "a" | "b" | ... | "z".
+
+ OtherChar = " " | "!" | "#" | "$" | "%" | "&" | "(" | ")"
+ | "*" | "+" | "," | "-" | "." | "/" | ":" | ";"
+ | "<" | "=" | ">" | "?" | "@" | "[" | "]" | "^"
+ | "_" | "`" | "{" | "|" | "}" | "~"
+ | ExtendedChar
+
+ ExtendedChar = any char with ISO-Latin-1 code in [8_ 240..8_ 377].
+
+
+
+ Last modified on Wed Apr 3 09:38:55 PST 1996 by heydon
+ modified on Mon Dec 19 08:18:35 PST 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/text-intf.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/text-intf.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/text-intf.html Tue Feb 10 22:59:18 1998
***************
*** 0 ****
--- 1,87 ----
+
+
+ The Text interface
+
+ INTERFACE Text;
+
+ TYPE
+ T = TEXT;
+
+
+ PROCEDURE Cat(t, u: T): T;
+
+
+ PROCEDURE Equal(t, u: T): BOOLEAN;
+
+
+ PROCEDURE GetChar(t: T; i: CARDINAL): CHAR;
+
+
+ PROCEDURE Length(t: T): CARDINAL;
+
+
+ PROCEDURE Empty(t: T): BOOLEAN;
+
+
+ PROCEDURE Sub(t: T; start, length: CARDINAL): T;
+
+
+ PROCEDURE SetChars(VAR a: ARRAY OF CHAR; t: T);
+
+
+ PROCEDURE FromChar(ch: CHAR): T;
+
+
+ PROCEDURE FromChars(READONLY a: ARRAY OF CHAR): T;
+
+
+ PROCEDURE Hash(t: T): INTEGER;
+
+
+ END Text.
+
+
+
+ Last modified on Wed Apr 3 09:43:27 PST 1996 by heydon
+ modified on Thu Jun 1 08:12:38 PDT 1995 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/textops.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/textops.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/textops.html Tue Feb 10 22:59:19 1998
***************
*** 0 ****
--- 1,21 ----
+
+
+ Text operations
+
+ infix & (a,b: TEXT): TEXT
+
+
+ Last modified on Wed Apr 3 09:38:54 PST 1996 by heydon
+ modified on Mon Apr 18 14:07:42 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/texts.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/texts.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/texts.html Tue Feb 10 22:59:19 1998
***************
*** 0 ****
--- 1,43 ----
+
+
+ Text and character literals
+
+ \n newline (linefeed) \f form feed
+ \t tab \\ backslash
+ \r carriage return \" double quote
+ \' single quote \nnn char with code 8_nnn
+
+
+ Last modified on Wed Apr 3 09:38:54 PST 1996 by heydon
+ modified on Mon Apr 18 13:39:16 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/thread-intf.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/thread-intf.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/thread-intf.html Tue Feb 10 22:59:19 1998
***************
*** 0 ****
--- 1,123 ----
+
+
+ The Thread interface
+
+ INTERFACE Thread;
+
+ TYPE
+ T <: REFANY;
+ Mutex = MUTEX;
+ Condition <: ROOT;
+ Closure = OBJECT METHODS apply(): REFANY END;
+
+
+ PROCEDURE Fork(cl: Closure): T;
+
+
+ PROCEDURE Join(t: T): REFANY;
+
+
+ PROCEDURE Wait(m: Mutex; c: Condition);
+
+
+ PROCEDURE Acquire(m: Mutex);
+
+
+ PROCEDURE Release(m: Mutex);
+
+
+ PROCEDURE Broadcast(c: Condition);
+
+
+ PROCEDURE Signal(c: Condition);
+
+
+ PROCEDURE Self(): T;
+
+
+ EXCEPTION Alerted;
+
+
+ PROCEDURE Alert(t: T);
+
+
+ PROCEDURE TestAlert(): BOOLEAN;
+
+
+ PROCEDURE AlertWait(m: Mutex; c: Condition) RAISES {Alerted};
+
+
+ PROCEDURE AlertJoin(t: T): REFANY RAISES {Alerted};
+
+
+ CONST
+ AtomicSize = ...;
+
+
+ END Thread.
+
+
+
+ Last modified on Wed Apr 3 09:38:54 PST 1996 by heydon
+ modified on Thu Jun 1 08:12:48 PDT 1995 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/tryexcept.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/tryexcept.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/tryexcept.html Tue Feb 10 22:59:19 1998
***************
*** 0 ****
--- 1,73 ----
+
+
+ Try Except
+
+ TRY
+ Body
+ EXCEPT
+ id_1 (v_1) => Handler_1
+ | ...
+ | id_n (v_n) => Handler_n
+ ELSE Handler_0
+ END
+
+
+ id_1, ..., id_n => Handler
+
+
+ id_1 => Handler; ...; id_n => Handler
+
+
+ Last modified on Wed Apr 3 09:38:53 PST 1996 by heydon
+ modified on Mon Apr 18 14:08:03 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/tryfinally.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/tryfinally.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/tryfinally.html Tue Feb 10 22:59:19 1998
***************
*** 0 ****
--- 1,27 ----
+
+
+ Try Finally
+
+ TRY S_1 FINALLY S_2 END
+
+
+ Last modified on Wed Apr 3 09:38:53 PST 1996 by heydon
+ modified on Mon Apr 18 14:08:09 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/type-decl.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/type-decl.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/type-decl.html Tue Feb 10 22:59:19 1998
***************
*** 0 ****
--- 1,23 ----
+
+
+ Types
+
+ TYPE T = U
+
+
+ Last modified on Wed Apr 3 09:38:53 PST 1996 by heydon
+ modified on Mon Apr 18 14:08:17 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/typecase.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/typecase.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/typecase.html Tue Feb 10 22:59:19 1998
***************
*** 0 ****
--- 1,74 ----
+
+
+ Typecase
+
+ TYPECASE Expr OF
+ T_1 (v_1) => S_1
+ | ...
+ | T_n (v_n) => S_n
+ ELSE S_0
+ END
+
+
+ T_1, ..., T_n => S
+
+
+ T_1 => S | ... | T_n => S
+
+
+ PROCEDURE ToText(r: REFANY): TEXT =
+ (* Assume r = NIL or r^ is a BOOLEAN or INTEGER. *)
+ BEGIN
+ TYPECASE r OF
+ NULL => RETURN "NIL"
+ | REF BOOLEAN (rb) => RETURN Fmt.Bool(rb^)
+ | REF INTEGER (ri) => RETURN Fmt.Int(ri^)
+ END
+ END ToText;
+
+
+
+ Last modified on Wed Apr 3 09:38:52 PST 1996 by heydon
+ modified on Mon Apr 18 14:08:25 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/typeops.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/typeops.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/typeops.html Tue Feb 10 22:59:19 1998
***************
*** 0 ****
--- 1,135 ----
+
+
+ Type operations
+
+ ISTYPE (x: Reference; T: RefType) : BOOLEAN
+
+
+ NARROW (x: Reference; T: RefType): T
+
+
+ TYPECODE (T: RefType) : CARDINAL
+ (r: REFANY) : CARDINAL
+ (r: UNTRACED ROOT) : CARDINAL
+
+
+ ORD (element: Ordinal): INTEGER
+ VAL (i: INTEGER; T: OrdinalType): T
+
+
+ NUMBER (T: OrdinalType) : CARDINAL
+ (A: FixedArrayType) : CARDINAL
+ (a: Array) : CARDINAL
+
+
+ FIRST (T: OrdinalType) : BaseType(T)
+ (T: FloatType) : T
+ (A: FixedArrayType) : BaseType(IndexType(A))
+ (a: Array) : BaseType(IndexType(a))
+
+ LAST (T: OrdinalType) : BaseType(T)
+ (T: FloatType) : T
+ (A: FixedArrayType) : BaseType(IndexType(A))
+ (a: Array) : BaseType(IndexType(a))
+
+
+ BITSIZE (x: Any) : CARDINAL
+ (T: Type) : CARDINAL
+
+ BYTESIZE (x: Any) : CARDINAL
+ (T: Type) : CARDINAL
+
+ ADRSIZE (x: Any) : CARDINAL
+ (T: Type) : CARDINAL
+
+
+ Last modified on Wed Apr 3 09:38:52 PST 1996 by heydon
+ modified on Mon Apr 18 13:43:59 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/types.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/types.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/types.html Tue Feb 10 22:59:19 1998
***************
*** 0 ****
--- 1,82 ----
+
+
+ Types
+
+
+
+
+
+ Last modified on Wed Apr 3 09:38:54 PST 1996 by heydon
+ modified on Thu Apr 14 15:43:24 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/units.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/units.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/units.html Tue Feb 10 22:59:19 1998
***************
*** 0 ****
--- 1,82 ----
+
+
+ Modules and interfaces
+
+
+
+
+
+
+ Last modified on Tue Oct 3 17:29:56 PDT 1995 by heydon
+ modified on Mon Apr 18 13:44:15 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/unsafe.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/unsafe.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/unsafe.html Tue Feb 10 22:59:19 1998
***************
*** 0 ****
--- 1,115 ----
+
+
+ Unsafe operations
+
+
+ LOOPHOLE(e, T)
+
+
+ ADR (VAR x: Any) : ADDRESS
+
+ infix + (x: ADDRESS, y:INTEGER) : ADDRESS
+ infix - (x: ADDRESS, y:INTEGER) : ADDRESS
+ infix - (x,y: ADDRESS) : INTEGER
+
+
+ INC (VAR x: ADDRESS; n: INTEGER := 1)
+ DEC (VAR x: ADDRESS; n: INTEGER := 1)
+
+
+ DISPOSE (v)
+
+
+ Last modified on Wed Apr 3 09:38:52 PST 1996 by heydon
+ modified on Tue Jul 12 08:05:48 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/variables.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/variables.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/variables.html Tue Feb 10 22:59:20 1998
***************
*** 0 ****
--- 1,58 ----
+
+
+ Variables
+
+ VAR id: T := E
+
+
+ VAR i: [0..5] := j; j: [0..5] := i; BEGIN S END
+
+
+ VAR i: [0..5]; j: [0..5]; BEGIN i := j; j := i; S END
+
+
+
+ VAR v_1, ..., v_n: T := E
+
+
+ VAR v_1: T := E; ...; VAR v_n: T := E
+
+
+ Last modified on Wed Apr 3 09:38:51 PST 1996 by heydon
+ modified on Mon Apr 18 14:08:32 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/while.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/while.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/while.html Tue Feb 10 22:59:20 1998
***************
*** 0 ****
--- 1,25 ----
+
+
+ While
+
+ WHILE B DO S END
+
+
+ LOOP IF B THEN S ELSE EXIT END END
+
+
+
+ Last modified on Wed Apr 3 09:38:51 PST 1996 by heydon
+ modified on Mon Apr 18 14:08:38 PDT 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/with.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/with.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/with.html Tue Feb 10 22:59:20 1998
***************
*** 0 ****
--- 1,55 ----
+
+
+ With
+
+ WITH id = e DO S END
+
+
+ PROCEDURE P(mode id: type of e) = BEGIN S END P;
+
+
+ WITH id_1 = e_1, id_2 = e_2, ...
+
+
+ WITH id_1 = e_1 DO
+ WITH id_2 = e_2 DO ....
+
+
+
+ Last modified on Wed Apr 3 09:38:51 PST 1996 by heydon
+ modified on Mon Dec 19 08:18:03 PST 1994 by kalsow
+
+
+
Index: m3/pm3/language/modula3/src/m3defn/word-intf.html
diff -c /dev/null m3/pm3/language/modula3/src/m3defn/word-intf.html:1.2
*** /dev/null Tue Feb 10 23:31:57 1998
--- m3/pm3/language/modula3/src/m3defn/word-intf.html Tue Feb 10 22:59:20 1998
***************
*** 0 ****
--- 1,103 ----
+
+
+ The Word interface
+
+ INTERFACE Word;
+
+ TYPE T = INTEGER;
+
+ CONST Size = BITSIZE(T);
+
+
+ PROCEDURE Plus (x,y: T): T; (* (x + y) MOD 2^Word.Size *)
+ PROCEDURE Times (x,y: T): T; (* (x * y) MOD 2^Word.Size *)
+ PROCEDURE Minus (x,y: T): T; (* (x - y) MOD 2^Word.Size *)
+ PROCEDURE Divide(x,y: T): T; (* x DIV y *)
+ PROCEDURE Mod(x,y: T): T; (* x MOD y *)
+ PROCEDURE LT(x,y: T): BOOLEAN; (* x < y *)
+ PROCEDURE LE(x,y: T): BOOLEAN; (* x <= y *)
+ PROCEDURE GT(x,y: T): BOOLEAN; (* x > y *)
+ PROCEDURE GE(x,y: T): BOOLEAN; (* x >= y *)
+
+
+ PROCEDURE And(x,y: T): T; (* Bitwise AND of x and y *)
+ PROCEDURE Or (x,y: T): T; (* Bitwise OR of x and y *)
+ PROCEDURE Xor(x,y: T): T; (* Bitwise XOR of x and y *)
+ PROCEDURE Not (x: T): T; (* Bitwise complement of x *)
+
+
+ PROCEDURE Shift(x: T; n: INTEGER): T;
+
+
+ PROCEDURE Rotate(x: T; n: INTEGER): T;
+
+
+ PROCEDURE Extract(x: T; i, n: CARDINAL): T;
+
+
+ PROCEDURE Insert(x: T; y: T; i, n: CARDINAL): T;
+
+
+ END Word.
+
+
+
+ Last modified on Wed Apr 3 09:38:50 PST 1996 by heydon
+ modified on Thu Jun 1 08:12:58 PDT 1995 by kalsow
+
+
+
Index: m3/pm3/language/parsing/metasyntax/src/index.html
diff -c /dev/null m3/pm3/language/parsing/metasyntax/src/index.html:1.1.1.1
*** /dev/null Tue Feb 10 23:32:01 1998
--- m3/pm3/language/parsing/metasyntax/src/index.html Sat Jan 31 14:47:13 1998
***************
*** 0 ****
--- 1,36 ----
+
+
+ Ecole Polytechnique
+ C.P. 6079, Succ. Centre-Ville
+ Montreal, Quebec, H3C 3A7
+ 18 January 1998
+ parsing
+ LL
+ recursive descent
+ Meta Syntax parsing library
+
+
+
+
+
+
Index: m3/pm3/language/parsing/metasyntax/src/m3makefile
diff -c /dev/null m3/pm3/language/parsing/metasyntax/src/m3makefile:1.2
*** /dev/null Tue Feb 10 23:32:01 1998
--- m3/pm3/language/parsing/metasyntax/src/m3makefile Tue Feb 10 22:59:29 1998
***************
*** 0 ****
--- 1,7 ----
+
+ import("m3doc")
+
+ HtmlFile("index")
+
+ OtherPackage("metasyntax")
+
Index: m3/pm3/language/parsing/src/index.html
diff -c /dev/null m3/pm3/language/parsing/src/index.html:1.1.1.1
*** /dev/null Tue Feb 10 23:32:02 1998
--- m3/pm3/language/parsing/src/index.html Sat Jan 31 14:47:14 1998
***************
*** 0 ****
--- 1,30 ----
+
+
+ Ecole Polytechnique
+ C.P. 6079, Succ. Centre-Ville
+ Montreal, Quebec, H3C 3A7
+ 18 January 1998
+ parsing
+ Parsing tools
+
+
+
+
+
+
Index: m3/pm3/language/parsing/src/m3makefile
diff -c /dev/null m3/pm3/language/parsing/src/m3makefile:1.2
*** /dev/null Tue Feb 10 23:32:02 1998
--- m3/pm3/language/parsing/src/m3makefile Tue Feb 10 22:59:33 1998
***************
*** 0 ****
--- 1,7 ----
+
+ import("m3doc")
+
+ HtmlFile("index")
+
+ OtherPackage("parsing")
+
Index: m3/pm3/language/src/index.html
diff -c /dev/null m3/pm3/language/src/index.html:1.1.1.1
*** /dev/null Tue Feb 10 23:32:03 1998
--- m3/pm3/language/src/index.html Sat Jan 31 14:47:14 1998
***************
*** 0 ****
--- 1,42 ----
+
+
+ Ecole Polytechnique
+ C.P. 6079, Succ. Centre-Ville
+ Montreal, Quebec, H3C 3A7
+ 18 January 1998
+ programming
+ compiler
+ interpreter
+ parsing
+ wide audience
+ Compilers, interpreters, and parsing tools
+
+
+
+
+
+
Index: m3/pm3/language/src/m3makefile
diff -c /dev/null m3/pm3/language/src/m3makefile:1.2
*** /dev/null Tue Feb 10 23:32:03 1998
--- m3/pm3/language/src/m3makefile Tue Feb 10 22:59:37 1998
***************
*** 0 ****
--- 1,7 ----
+
+ import("m3doc")
+
+ HtmlFile("index")
+
+ OtherPackage("language")
+
Index: m3/pm3/language/tcl/test/src/src/m3makefile
diff -c m3/pm3/language/tcl/test/src/src/m3makefile:1.2 m3/pm3/language/tcl/test/src/src/m3makefile:1.3
*** m3/pm3/language/tcl/test/src/src/m3makefile:1.2 Tue Jan 28 12:24:37 1997
--- m3/pm3/language/tcl/test/src/src/m3makefile Tue Feb 10 22:59:41 1998
***************
*** 6,12 ****
% modified on Mon Apr 06 14:45:41 PDT 1992 by muller
! override ("tcl", "../../..")
import ("libm3")
import ("tcl")
--- 6,12 ----
% modified on Mon Apr 06 14:45:41 PDT 1992 by muller
! override ("tcl", path_of(".." & SL & ".." & SL & ".."))
import ("libm3")
import ("tcl")
Index: m3/pm3/libs/libm3/src/index.html
diff -c /dev/null m3/pm3/libs/libm3/src/index.html:1.1
*** /dev/null Tue Feb 10 23:32:04 1998
--- m3/pm3/libs/libm3/src/index.html Tue Feb 10 22:44:41 1998
***************
*** 0 ****
--- 1,122 ----
+
+
+ Ecole Polytechnique
+ C.P. 6079, Succ. Centre-Ville
+ Montreal, Quebec, H3C 3A7
+ 17 January 1998
+ Modula-3
+ library
+ wide audience
+ The Modula-3 Standard Library
+
+ Some Useful Modula-3 Interfaces
+
+ Data Structures
+
+
+
+
+ Algorithms
+
+
+
+ Input/Output and Operating System Access
+
+
+
+
+ Numerical Support
+
+
+
+
+ Miscellaneous
+
+
+
+
+
+
+
Index: m3/pm3/libs/libm3/src/m3makefile
diff -c m3/pm3/libs/libm3/src/m3makefile:1.2 m3/pm3/libs/libm3/src/m3makefile:1.3
*** m3/pm3/libs/libm3/src/m3makefile:1.2 Thu Nov 27 16:08:31 1997
--- m3/pm3/libs/libm3/src/m3makefile Tue Feb 10 22:44:41 1998
***************
*** 43,49 ****
include_dir ("pqueue")
include_dir ("sqrt")
! m3_option ("-times")
Library ("m3")
--- 43,51 ----
include_dir ("pqueue")
include_dir ("sqrt")
! import("m3doc")
! HtmlFile("index")
! include_dir("html")
Library ("m3")
Index: m3/pm3/libs/libm3/src/html/Bundle.i3
diff -c /dev/null m3/pm3/libs/libm3/src/html/Bundle.i3:1.1
*** /dev/null Tue Feb 10 23:32:05 1998
--- m3/pm3/libs/libm3/src/html/Bundle.i3 Tue Feb 10 23:09:21 1998
***************
*** 0 ****
--- 1,57 ----
+ (* Copyright (C) 1992, Digital Equipment Corporation *)
+ (* All rights reserved. *)
+ (* See the file COPYRIGHT for a full description. *)
+ (* Last modified on Mon Nov 8 16:50:30 PST 1993 by mcjones *)
+ (* modified on Thu Sep 10 20:48:51 PDT 1992 by mhb *)
+
+ (* A "Bundle.T", or bundle, is a collection of named byte string
+ values, where the names and values are represented as "TEXTs". The
+ usefulness of bundles stems from the existence of a program called
+ "m3bundle". This program accepts an arbitrary set of files and
+ produces the source code of a Modula-3 procedure that, when
+ compiled and executed, returns a bundle containing the contents of
+ the original files.
+
+ m3bundle program
+ m3bundle program
+
+ *)
+
+ INTERFACE Bundle;
+
+ TYPE T <: REFANY;
+
+ PROCEDURE Get(b: T; nm: TEXT): TEXT;
+ (* If an element of "b" has the name "nm", return its value.
+ Otherwise, return "NIL". *)
+
+ END Bundle.
+
+ (* To call "Bundle.Get", you need a value of type "Bundle.T". Given a
+ collection of files, the program "m3bundle" generates the source
+ code of an interface (".i3" file) and a module (".m3" file)
+ implementing that interface. The interface contains a single
+ procedure returning a bundle.
+
+ If you want to build a bundle with elements named "e1, ..., en"
+ corresponding to values currently in files with pathnames "p1, ...,
+ pN", you invoke "m3bundle" as follows:
+
+ | m3bundle -name Foo [-element e1 p1]...
+
+ "m3bundle" then produces an interface "Foo.i3" with this format:
+
+ | INTERFACE Foo;
+ | IMPORT Bundle;
+ | PROCEDURE Get(): Bundle.T;
+ | END Foo.
+
+ The call "Foo.Get()" returns a bundle "b" such that the call
+ "Bundle.Get(b, nm)" returns the contents of file "pi" at the time
+ "m3bundle" was invoked if "nm" equals one of the "ei" passed to
+ "m3bundle". Otherwise, "Bundle.Get(b, nm)" returns "NIL".
+
+ For more information about "m3bundle", consult its man page or
+ other system-specific documentation.
+
+ *)
Index: m3/pm3/libs/libm3/src/html/COPYRIGHT.html
diff -c /dev/null m3/pm3/libs/libm3/src/html/COPYRIGHT.html:1.1
*** /dev/null Tue Feb 10 23:32:05 1998
--- m3/pm3/libs/libm3/src/html/COPYRIGHT.html Tue Feb 10 22:44:45 1998
***************
*** 0 ****
--- 1,99 ----
+
+
+ Copyright: SRC Modula-3 Digital License Agreement
+
+
+
+
\ No newline at end of file
Index: m3/pm3/libs/libm3/src/html/FloatMode.i3
diff -c /dev/null m3/pm3/libs/libm3/src/html/FloatMode.i3:1.1
*** /dev/null Tue Feb 10 23:32:06 1998
--- m3/pm3/libs/libm3/src/html/FloatMode.i3 Tue Feb 10 23:09:21 1998
***************
*** 0 ****
--- 1,117 ----
+ (* Copyright (C) 1991, Digital Equipment Corporation *)
+ (* All rights reserved. *)
+ (* See the file COPYRIGHT for a full description. *)
+ (* Last modified on Fri Nov 5 15:14:54 PST 1993 by mcjones *)
+ (* modified on Thu Apr 29 15:51:04 PDT 1993 by muller *)
+ (* modified on Wed Sep 25 20:30:16 1991 by kalsow *)
+
+ (* The interface "FloatMode" allows you to test the behavior of
+ rounding and of numerical exceptions. On some implementations it
+ also allows you to change the behavior, on a per-thread basis. *)
+
+ INTERFACE FloatMode;
+
+ CONST IEEE: BOOLEAN = ...;
+ (* "TRUE" for fully compliant IEEE implementations. *)
+
+ EXCEPTION Failure;
+ (* Raised by attempts to set modes that are not supported by the
+ implementation. *)
+
+ TYPE RoundingMode =
+ {NearestElseEven, TowardMinusInfinity, TowardPlusInfinity,
+ TowardZero, NearestElseAwayFromZero, IBM370, Other};
+ (* Rounding modes. The first four are the IEEE modes.
+ A VAX always does "NearestElseAwayFromZero". *)
+
+ CONST RoundDefault: RoundingMode = ...;
+ (* Implementation-dependent: the default mode for rounding arithmetic
+ operations, used by a newly forked thread. This also specifies the
+ behavior of the "ROUND" operation in half-way cases. *)
+
+ PROCEDURE SetRounding(md: RoundingMode) RAISES {Failure};
+ (* Change the rounding mode for the calling thread to "md", or raise
+ the exception if this cannot be done. This affects the implicit
+ rounding in floating-point operations; it does not affect the
+ "ROUND" operation. Generally this can be done only on IEEE
+ implementations and only if "md" is an IEEE mode. *)
+
+ PROCEDURE GetRounding(): RoundingMode;
+ (* Return the rounding mode for the calling thread. *)
+
+ TYPE Flag = {Invalid, Inexact, Overflow, Underflow,
+ DivByZero, IntOverflow, IntDivByZero};
+
+ (* Associated with each thread is a set of boolean status flags
+ recording whether the condition represented by the flag has
+ occurred in the thread since the flag was last reset. The meaning
+ of the first five flags is defined precisely in the IEEE floating
+ point standard; roughly they mean:
+
+
+
+ "Invalid" = invalid argument to an operation.
+
+ "Inexact" = an operation produced an inexact result.
+
+ "Overflow" = a floating-point operation produced a result whose
+ absolute value is too large to be represented.
+
+ "Underflow" = a floating-point operation produced a result whose
+ absolute value is too small to be represented.
+
+ "DivByZero" = floating-point division by zero.
+
+
+ The meaning of the last two flags is:
+
+
+
+ "IntOverflow" = an integer operation produced a result outside the
+ representable range.
+
+ "IntDivByZero" = integer "DIV" or "MOD" by zero.
+
+ *)
+
+ CONST NoFlags = SET OF Flag {};
+
+ PROCEDURE GetFlags(): SET OF Flag;
+ (* Return the set of flags for the current thread. *)
+
+ PROCEDURE SetFlags(s: SET OF Flag)
+ : SET OF Flag RAISES {Failure};
+ (* Set the flags for the current thread to "s", and return their
+ previous values. *)
+
+ PROCEDURE ClearFlag(f: Flag);
+ (* Turn off the flag "f" for the current thread. *)
+
+ EXCEPTION Trap(Flag);
+
+ TYPE Behavior = {Trap, SetFlag, Ignore};
+
+ (* The behavior of an operation that causes one of the flag conditions
+ is either:
+
+
+
+ "Ignore" = return some result and do nothing.
+
+ "SetFlag" = return some result and set the condition flag. For
+ IEEE implementations, the result of the operation is defined by the
+ standard.
+
+ "Trap" = possibly set the condition flag; in any case raise the
+ "Trap" exception with the appropriate flag as the argument.
+
+ *)
+
+ PROCEDURE SetBehavior(f: Flag; b: Behavior) RAISES {Failure};
+ (* Set the behavior of the current thread for the flag "f" to be "b",
+ or raise "Failure" if this cannot be done. *)
+
+ PROCEDURE GetBehavior(f: Flag): Behavior;
+ (* Return the behavior of the current thread for the flag "f". *)
+
+ END FloatMode.
Index: m3/pm3/libs/libm3/src/html/acks.html
diff -c /dev/null m3/pm3/libs/libm3/src/html/acks.html:1.1
*** /dev/null Tue Feb 10 23:32:06 1998
--- m3/pm3/libs/libm3/src/html/acks.html Tue Feb 10 22:44:45 1998
***************
*** 0 ****
--- 1,53 ----
+ Acknowledgments
+ Algorithms
+
+
+ Basic Data Types
+
+
+ Real, LongReal, and Extended
+
+ INTERFACE Real; TYPE T = REAL;
+ CONST
+ Base: INTEGER = ...;
+ Precision: INTEGER = ...;
+ MaxFinite: T = ...;
+ MinPos: T = ...;
+ MinPosNormal: T = ...;
+ MaxExpDigits: INTEGER = ...;
+ MaxSignifDigits: INTEGER = ...;
+ END Real.
+
+ INTERFACE LongReal; TYPE T = LONGREAL;
+ CONST
+ Base: INTEGER = ...;
+ Precision: INTEGER = ...;
+ MaxFinite: T = ...;
+ MinPos: T = ...;
+ MinPosNormal: T = ...;
+ MaxExpDigits: INTEGER = ...;
+ MaxSignifDigits: INTEGER = ...;
+ END LongReal.
+
+ INTERFACE Extended; TYPE T = EXTENDED;
+ CONST
+ Base: INTEGER = ...;
+ Precision: INTEGER = ...;
+ MaxFinite: T = ...;
+ MinPos: T = ...;
+ MinPosNormal: T = ...;
+ MaxExpDigits: INTEGER = ...;
+ MaxSignifDigits: INTEGER = ...;
+ END Extended.
+
+
+
+
+
+ MaxExpDigits = CEILING(LOG_10(LOG_10(MaxFinite)))
+ MaxSignifDigits = CEILING(LOG_10(Base EXP Precision)) + 1.
+
Index: m3/pm3/libs/libm3/src/html/intro.html
diff -c /dev/null m3/pm3/libs/libm3/src/html/intro.html:1.1
*** /dev/null Tue Feb 10 23:32:06 1998
--- m3/pm3/libs/libm3/src/html/intro.html Tue Feb 10 22:44:46 1998
***************
*** 0 ****
--- 1,349 ----
+ Introduction
+ Naming conventions for types.
+
+ VAR s := NEW(Sequence.T).init();
+
+
+ Concurrency.
+ Aliasing.
+ Exception parameters for abstract types.
+ Standard generic instances.
+
+ PROCEDURE Compare(x, y: X): [-1..1];
+ (* Return
+ | -1 `if` x R y `and not` Equal(x, y)`,`
+ | 0 `if` Equal(x, y)`, and`
+ | 1 `if` y R x `and not` Equal(x, y)`.`
+ *)
+
+ Sets and relations.
+ I/O Streams
+
+
Index: m3/pm3/libs/libm3/src/html/m3makefile
diff -c /dev/null m3/pm3/libs/libm3/src/html/m3makefile:1.2
*** /dev/null Tue Feb 10 23:32:06 1998
--- m3/pm3/libs/libm3/src/html/m3makefile Tue Feb 10 23:11:36 1998
***************
*** 0 ****
--- 1,17 ----
+ HtmlFile("COPYRIGHT")
+ HtmlFile("acks")
+ HtmlFile("algorithm")
+ HtmlFile("basic")
+ HtmlFile("float")
+ HtmlFile("intro")
+ HtmlFile("io")
+ HtmlFile("os")
+ HtmlFile("realfloat")
+ HtmlFile("references")
+ HtmlFile("runtime")
+ HtmlFile("standard")
+ HtmlFile("structure")
+ HtmlFile("useful")
+ HtmlInterface("Bundle")
+ HtmlInterface("FloatMode")
+
Index: m3/pm3/libs/libm3/src/html/os.html
diff -c /dev/null m3/pm3/libs/libm3/src/html/os.html:1.1
*** /dev/null Tue Feb 10 23:32:06 1998
--- m3/pm3/libs/libm3/src/html/os.html Tue Feb 10 22:44:46 1998
***************
*** 0 ****
--- 1,24 ----
+ Operating System
+
+
Index: m3/pm3/libs/libm3/src/html/realfloat.html
diff -c /dev/null m3/pm3/libs/libm3/src/html/realfloat.html:1.1
*** /dev/null Tue Feb 10 23:32:06 1998
--- m3/pm3/libs/libm3/src/html/realfloat.html Tue Feb 10 22:44:46 1998
***************
*** 0 ****
--- 1,21 ----
+ RealFloat, LongRealFloat, and ExtendedFloat
+
+ INTERFACE RealFloat = Float(Real) END RealFloat.
+ INTERFACE LongFloat = Float(LongReal) END LongFloat.
+ INTERFACE ExtendedFloat = Float(Extended) END ExtendedFloat.
+
+
+
+
Index: m3/pm3/libs/libm3/src/html/references.html
diff -c /dev/null m3/pm3/libs/libm3/src/html/references.html:1.1
*** /dev/null Tue Feb 10 23:32:06 1998
--- m3/pm3/libs/libm3/src/html/references.html Tue Feb 10 22:44:46 1998
***************
*** 0 ****
--- 1,202 ----
+ References
+
+
+
+
Index: m3/pm3/libs/libm3/src/html/runtime.html
diff -c /dev/null m3/pm3/libs/libm3/src/html/runtime.html:1.1
*** /dev/null Tue Feb 10 23:32:06 1998
--- m3/pm3/libs/libm3/src/html/runtime.html Tue Feb 10 22:44:46 1998
***************
*** 0 ****
--- 1,19 ----
+ Runtime
+
+
+
+
+
Index: m3/pm3/libs/libm3/src/html/standard.html
diff -c /dev/null m3/pm3/libs/libm3/src/html/standard.html:1.1
*** /dev/null Tue Feb 10 23:32:06 1998
--- m3/pm3/libs/libm3/src/html/standard.html Tue Feb 10 22:44:47 1998
***************
*** 0 ****
--- 1,48 ----
+ Standard interfaces
+
+
+
+
+
+
+
Index: m3/pm3/libs/libm3/src/html/structure.html
diff -c /dev/null m3/pm3/libs/libm3/src/html/structure.html:1.1
*** /dev/null Tue Feb 10 23:32:06 1998
--- m3/pm3/libs/libm3/src/html/structure.html Tue Feb 10 22:44:47 1998
***************
*** 0 ****
--- 1,52 ----
+ Data Structures
+
+
+
+
+ 130 Lytton Avenue
+ Palo Alto, California 94301
+ December 25, 1993
+ text
+ io
+ system
+ algorithm
+ data structure
+ thread
+ runtime
+ mature
+ wide audience
+ reusable
+ Some Useful Modula-3 Interfaces
+
+
+
+
+
+
+
+
+
+ Ecole Polytechnique
+ C.P. 6079, Succ. Centre-Ville
+ Montreal, Quebec, H3C 3A7
+ 17 January 1998
+ Modula-3
+ library
+ wide audience
+ The Modula-3 Core Library
+
+ Required Interfaces
+
+
+
+
+ Useful Interfaces
+
+
+
+
+ Low level and platform dependent support functions
+
+
+
+
+
+
Index: m3/pm3/libs/m3core/src/m3makefile
diff -c m3/pm3/libs/m3core/src/m3makefile:1.1.1.1 m3/pm3/libs/m3core/src/m3makefile:1.2
*** m3/pm3/libs/m3core/src/m3makefile:1.1.1.1 Thu Jan 16 16:29:54 1997
--- m3/pm3/libs/m3core/src/m3makefile Tue Feb 10 22:45:03 1998
***************
*** 38,44 ****
include_dir ("weakref")
include_dir ("word")
! m3_option ("-times")
Library ("m3core")
--- 38,45 ----
include_dir ("weakref")
include_dir ("word")
! import("m3doc")
! HtmlFile("index")
Library ("m3core")
Index: m3/pm3/libs/m3core/src/unix/aix-3-2/Uexec.i3
diff -c m3/pm3/libs/m3core/src/unix/aix-3-2/Uexec.i3:1.1.1.1 m3/pm3/libs/m3core/src/unix/aix-3-2/Uexec.i3:1.2
*** m3/pm3/libs/m3core/src/unix/aix-3-2/Uexec.i3:1.1.1.1 Thu Jan 16 16:30:03 1997
--- m3/pm3/libs/m3core/src/unix/aix-3-2/Uexec.i3 Tue Feb 10 22:45:11 1998
***************
*** 48,63 ****
(* terminated process status *)
w_T = RECORD
w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
! w_Filler : BITS 16 FOR [0..16_FFFF]; END;
(* stopped process status *)
w_S = RECORD
! w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
w_Stopsig : BITS 8 FOR [0..16_FF]; (* signal that stopped us *)
! w_Filler : BITS 16 FOR [0..16_FFFF]; END;
(* union wait is a union of the three types above. We will use w_A
in the declarations and do a LOOPHOLE when necessary *)
--- 48,73 ----
(* terminated process status *)
w_T = RECORD
+ w_Filler : BITS 16 FOR [0..16_FFFF];
+ w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
+ w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
+ END;
+
+ (* M3 view of return code *)
+ w_M3 = RECORD
+ w_Filler : BITS 16 FOR [0..16_FFFF];
w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
+ w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
! END;
(* stopped process status *)
w_S = RECORD
! w_Filler : BITS 16 FOR [0..16_FFFF];
w_Stopsig : BITS 8 FOR [0..16_FF]; (* signal that stopped us *)
! w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
! END;
(* union wait is a union of the three types above. We will use w_A
in the declarations and do a LOOPHOLE when necessary *)
Index: m3/pm3/libs/m3core/src/unix/aix-ps2-1-2/Uexec.i3
diff -c m3/pm3/libs/m3core/src/unix/aix-ps2-1-2/Uexec.i3:1.1.1.1 m3/pm3/libs/m3core/src/unix/aix-ps2-1-2/Uexec.i3:1.2
*** m3/pm3/libs/m3core/src/unix/aix-ps2-1-2/Uexec.i3:1.1.1.1 Thu Jan 16 16:30:04 1997
--- m3/pm3/libs/m3core/src/unix/aix-ps2-1-2/Uexec.i3 Tue Feb 10 22:45:21 1998
***************
*** 53,58 ****
--- 53,65 ----
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+ (* M3 view of return code *)
+ w_M3 = RECORD
+ w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
+ w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
+ w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
+ w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+
(* stopped process status *)
w_S = RECORD
w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
Index: m3/pm3/libs/m3core/src/unix/freebsd-1/Uexec.i3
diff -c m3/pm3/libs/m3core/src/unix/freebsd-1/Uexec.i3:1.1.1.1 m3/pm3/libs/m3core/src/unix/freebsd-1/Uexec.i3:1.2
*** m3/pm3/libs/m3core/src/unix/freebsd-1/Uexec.i3:1.1.1.1 Thu Jan 16 16:30:04 1997
--- m3/pm3/libs/m3core/src/unix/freebsd-1/Uexec.i3 Tue Feb 10 22:45:26 1998
***************
*** 54,59 ****
--- 54,66 ----
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+ (* M3 view of return code *)
+ w_M3 = RECORD
+ w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
+ w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
+ w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
+ w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+
(* stopped process status *)
w_S = RECORD
w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
Index: m3/pm3/libs/m3core/src/unix/freebsd-2/Uexec.i3
diff -c m3/pm3/libs/m3core/src/unix/freebsd-2/Uexec.i3:1.1.1.1 m3/pm3/libs/m3core/src/unix/freebsd-2/Uexec.i3:1.2
*** m3/pm3/libs/m3core/src/unix/freebsd-2/Uexec.i3:1.1.1.1 Thu Jan 16 16:30:04 1997
--- m3/pm3/libs/m3core/src/unix/freebsd-2/Uexec.i3 Tue Feb 10 22:45:30 1998
***************
*** 53,58 ****
--- 53,65 ----
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+ (* M3 view of return code *)
+ w_M3 = RECORD
+ w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
+ w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
+ w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
+ w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+
(* stopped process status *)
w_S = RECORD
w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
Index: m3/pm3/libs/m3core/src/unix/hpux-7-0/Uexec.i3
diff -c m3/pm3/libs/m3core/src/unix/hpux-7-0/Uexec.i3:1.1.1.1 m3/pm3/libs/m3core/src/unix/hpux-7-0/Uexec.i3:1.2
*** m3/pm3/libs/m3core/src/unix/hpux-7-0/Uexec.i3:1.1.1.1 Thu Jan 16 16:30:08 1997
--- m3/pm3/libs/m3core/src/unix/hpux-7-0/Uexec.i3 Tue Feb 10 22:45:34 1998
***************
*** 48,63 ****
(* terminated process status *)
w_T = RECORD
w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
! w_Filler : BITS 16 FOR [0..16_FFFF]; END;
(* stopped process status *)
w_S = RECORD
! w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
w_Stopsig : BITS 8 FOR [0..16_FF]; (* signal that stopped us *)
! w_Filler : BITS 16 FOR [0..16_FFFF]; END;
(* union wait is a union of the three types above. We will use w_A
in the declarations and do a LOOPHOLE when necessary *)
--- 48,73 ----
(* terminated process status *)
w_T = RECORD
+ w_Filler : BITS 16 FOR [0..16_FFFF];
+ w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
+ w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
+ END;
+
+ (* M3 view of return code *)
+ w_M3 = RECORD
+ w_Filler : BITS 16 FOR [0..16_FFFF];
w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
+ w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
! END;
(* stopped process status *)
w_S = RECORD
! w_Filler : BITS 16 FOR [0..16_FFFF];
w_Stopsig : BITS 8 FOR [0..16_FF]; (* signal that stopped us *)
! w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
! END;
(* union wait is a union of the three types above. We will use w_A
in the declarations and do a LOOPHOLE when necessary *)
Index: m3/pm3/libs/m3core/src/unix/ibm-4-3/Uexec.i3
diff -c m3/pm3/libs/m3core/src/unix/ibm-4-3/Uexec.i3:1.1.1.1 m3/pm3/libs/m3core/src/unix/ibm-4-3/Uexec.i3:1.2
*** m3/pm3/libs/m3core/src/unix/ibm-4-3/Uexec.i3:1.1.1.1 Thu Jan 16 16:30:08 1997
--- m3/pm3/libs/m3core/src/unix/ibm-4-3/Uexec.i3 Tue Feb 10 22:45:37 1998
***************
*** 48,63 ****
(* terminated process status *)
w_T = RECORD
w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
! w_Filler : BITS 16 FOR [0..16_FFFF]; END;
(* stopped process status *)
w_S = RECORD
! w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
w_Stopsig : BITS 8 FOR [0..16_FF]; (* signal that stopped us *)
! w_Filler : BITS 16 FOR [0..16_FFFF]; END;
(* union wait is a union of the three types above. We will use w_A
in the declarations and do a LOOPHOLE when necessary *)
--- 48,73 ----
(* terminated process status *)
w_T = RECORD
+ w_Filler : BITS 16 FOR [0..16_FFFF];
+ w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
+ w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
+ END;
+
+ (* M3 view of return code *)
+ w_M3 = RECORD
+ w_Filler : BITS 16 FOR [0..16_FFFF];
w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
+ w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
! END;
(* stopped process status *)
w_S = RECORD
! w_Filler : BITS 16 FOR [0..16_FFFF];
w_Stopsig : BITS 8 FOR [0..16_FF]; (* signal that stopped us *)
! w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
! END;
(* union wait is a union of the three types above. We will use w_A
in the declarations and do a LOOPHOLE when necessary *)
Index: m3/pm3/libs/m3core/src/unix/irix-5.2/Uexec.i3
diff -c m3/pm3/libs/m3core/src/unix/irix-5.2/Uexec.i3:1.1.1.1 m3/pm3/libs/m3core/src/unix/irix-5.2/Uexec.i3:1.2
*** m3/pm3/libs/m3core/src/unix/irix-5.2/Uexec.i3:1.1.1.1 Thu Jan 16 16:30:09 1997
--- m3/pm3/libs/m3core/src/unix/irix-5.2/Uexec.i3 Tue Feb 10 22:45:40 1998
***************
*** 75,80 ****
--- 75,88 ----
w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
END;
+ (* M3 view of return code *)
+ w_M3 = RECORD
+ w_Filler : BITS 16 FOR [0..16_FFFF];
+ w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
+ w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
+ w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
+ END;
+
(* stopped process status *)
w_S = RECORD
w_Filler : BITS 16 FOR [0..16_FFFF];
Index: m3/pm3/libs/m3core/src/unix/linux/Uexec.i3
diff -c m3/pm3/libs/m3core/src/unix/linux/Uexec.i3:1.1.1.1 m3/pm3/libs/m3core/src/unix/linux/Uexec.i3:1.2
*** m3/pm3/libs/m3core/src/unix/linux/Uexec.i3:1.1.1.1 Thu Jan 16 16:30:09 1997
--- m3/pm3/libs/m3core/src/unix/linux/Uexec.i3 Tue Feb 10 22:45:44 1998
***************
*** 54,59 ****
--- 54,66 ----
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+ (* M3 view of return code *)
+ w_M3 = RECORD
+ w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
+ w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
+ w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
+ w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+
(* stopped process status *)
w_S = RECORD
w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
Index: m3/pm3/libs/m3core/src/unix/osf-1.generic/Uexec.i3
diff -c m3/pm3/libs/m3core/src/unix/osf-1.generic/Uexec.i3:1.1.1.1 m3/pm3/libs/m3core/src/unix/osf-1.generic/Uexec.i3:1.2
*** m3/pm3/libs/m3core/src/unix/osf-1.generic/Uexec.i3:1.1.1.1 Thu Jan 16 16:30:09 1997
--- m3/pm3/libs/m3core/src/unix/osf-1.generic/Uexec.i3 Tue Feb 10 22:45:47 1998
***************
*** 54,59 ****
--- 54,66 ----
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+ (* M3 view of return code *)
+ w_M3 = RECORD
+ w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
+ w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
+ w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
+ w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+
(* stopped process status *)
w_S = RECORD
w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
Index: m3/pm3/libs/m3core/src/unix/solaris-2-x/Uexec.i3
diff -c m3/pm3/libs/m3core/src/unix/solaris-2-x/Uexec.i3:1.2 m3/pm3/libs/m3core/src/unix/solaris-2-x/Uexec.i3:1.3
*** m3/pm3/libs/m3core/src/unix/solaris-2-x/Uexec.i3:1.2 Fri Sep 26 09:06:45 1997
--- m3/pm3/libs/m3core/src/unix/solaris-2-x/Uexec.i3 Tue Feb 10 22:45:50 1998
***************
*** 48,63 ****
(* terminated process status *)
w_T = RECORD
w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
! w_Filler : BITS 16 FOR [0..16_FFFF]; END;
(* stopped process status *)
w_S = RECORD
! w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
w_Stopsig : BITS 8 FOR [0..16_FF]; (* signal that stopped us *)
! w_Filler : BITS 16 FOR [0..16_FFFF]; END;
(* union wait is a union of the three types above. We will use w_A
in the declarations and do a LOOPHOLE when necessary *)
--- 48,73 ----
(* terminated process status *)
w_T = RECORD
+ w_Filler : BITS 16 FOR [0..16_FFFF];
+ w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
+ w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
+ END;
+
+ (* M3 view of return code *)
+ w_M3 = RECORD
+ w_Filler : BITS 16 FOR [0..16_FFFF];
w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
+ w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
! END;
(* stopped process status *)
w_S = RECORD
! w_Filler : BITS 16 FOR [0..16_FFFF];
w_Stopsig : BITS 8 FOR [0..16_FF]; (* signal that stopped us *)
! w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
! END;
(* union wait is a union of the three types above. We will use w_A
in the declarations and do a LOOPHOLE when necessary *)
Index: m3/pm3/libs/m3core/src/unix/sunos-4-x/Uexec.i3
diff -c m3/pm3/libs/m3core/src/unix/sunos-4-x/Uexec.i3:1.1.1.1 m3/pm3/libs/m3core/src/unix/sunos-4-x/Uexec.i3:1.2
*** m3/pm3/libs/m3core/src/unix/sunos-4-x/Uexec.i3:1.1.1.1 Thu Jan 16 16:30:10 1997
--- m3/pm3/libs/m3core/src/unix/sunos-4-x/Uexec.i3 Tue Feb 10 22:45:53 1998
***************
*** 48,63 ****
(* terminated process status *)
w_T = RECORD
w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
! w_Filler : BITS 16 FOR [0..16_FFFF]; END;
(* stopped process status *)
w_S = RECORD
! w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
w_Stopsig : BITS 8 FOR [0..16_FF]; (* signal that stopped us *)
! w_Filler : BITS 16 FOR [0..16_FFFF]; END;
(* union wait is a union of the three types above. We will use w_A
in the declarations and do a LOOPHOLE when necessary *)
--- 48,73 ----
(* terminated process status *)
w_T = RECORD
+ w_Filler : BITS 16 FOR [0..16_FFFF];
+ w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
+ w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
+ END;
+
+ (* M3 view of return code *)
+ w_M3 = RECORD
+ w_Filler : BITS 16 FOR [0..16_FFFF];
w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
+ w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
! END;
(* stopped process status *)
w_S = RECORD
! w_Filler : BITS 16 FOR [0..16_FFFF];
w_Stopsig : BITS 8 FOR [0..16_FF]; (* signal that stopped us *)
! w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
! END;
(* union wait is a union of the three types above. We will use w_A
in the declarations and do a LOOPHOLE when necessary *)
Index: m3/pm3/libs/m3core/src/unix/sysv-4.0/Uexec.i3
diff -c m3/pm3/libs/m3core/src/unix/sysv-4.0/Uexec.i3:1.1.1.1 m3/pm3/libs/m3core/src/unix/sysv-4.0/Uexec.i3:1.2
*** m3/pm3/libs/m3core/src/unix/sysv-4.0/Uexec.i3:1.1.1.1 Thu Jan 16 16:30:10 1997
--- m3/pm3/libs/m3core/src/unix/sysv-4.0/Uexec.i3 Tue Feb 10 22:45:57 1998
***************
*** 53,58 ****
--- 53,65 ----
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+ (* M3 view of return code *)
+ w_M3 = RECORD
+ w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
+ w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
+ w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
+ w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+
(* stopped process status *)
w_S = RECORD
w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
Index: m3/pm3/libs/m3core/src/unix/ultrix-3-1.AP3000/Uexec.i3
diff -c m3/pm3/libs/m3core/src/unix/ultrix-3-1.AP3000/Uexec.i3:1.1.1.1 m3/pm3/libs/m3core/src/unix/ultrix-3-1.AP3000/Uexec.i3:1.2
*** m3/pm3/libs/m3core/src/unix/ultrix-3-1.AP3000/Uexec.i3:1.1.1.1 Thu Jan 16 16:30:10 1997
--- m3/pm3/libs/m3core/src/unix/ultrix-3-1.AP3000/Uexec.i3 Tue Feb 10 22:46:00 1998
***************
*** 53,58 ****
--- 53,65 ----
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+ (* M3 view of return code *)
+ w_M3 = RECORD
+ w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
+ w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
+ w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
+ w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+
(* stopped process status *)
w_S = RECORD
w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
Index: m3/pm3/libs/m3core/src/unix/ultrix-3-1.ARM/Uexec.i3
diff -c m3/pm3/libs/m3core/src/unix/ultrix-3-1.ARM/Uexec.i3:1.1.1.1 m3/pm3/libs/m3core/src/unix/ultrix-3-1.ARM/Uexec.i3:1.2
*** m3/pm3/libs/m3core/src/unix/ultrix-3-1.ARM/Uexec.i3:1.1.1.1 Thu Jan 16 16:30:10 1997
--- m3/pm3/libs/m3core/src/unix/ultrix-3-1.ARM/Uexec.i3 Tue Feb 10 22:46:03 1998
***************
*** 53,58 ****
--- 53,65 ----
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+ (* M3 view of return code *)
+ w_M3 = RECORD
+ w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
+ w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
+ w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
+ w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+
(* stopped process status *)
w_S = RECORD
w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
Index: m3/pm3/libs/m3core/src/unix/ultrix-3-1.DS3100/Uexec.i3
diff -c m3/pm3/libs/m3core/src/unix/ultrix-3-1.DS3100/Uexec.i3:1.1.1.1 m3/pm3/libs/m3core/src/unix/ultrix-3-1.DS3100/Uexec.i3:1.2
*** m3/pm3/libs/m3core/src/unix/ultrix-3-1.DS3100/Uexec.i3:1.1.1.1 Thu Jan 16 16:30:11 1997
--- m3/pm3/libs/m3core/src/unix/ultrix-3-1.DS3100/Uexec.i3 Tue Feb 10 22:46:06 1998
***************
*** 38,43 ****
--- 38,50 ----
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+ (* M3 view of return code *)
+ w_M3 = RECORD
+ w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
+ w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
+ w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
+ w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+
(* stopped process status *)
w_S = RECORD
w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
Index: m3/pm3/libs/m3core/src/unix/ultrix-3-1.NEXT/Uexec.i3
diff -c m3/pm3/libs/m3core/src/unix/ultrix-3-1.NEXT/Uexec.i3:1.1.1.1 m3/pm3/libs/m3core/src/unix/ultrix-3-1.NEXT/Uexec.i3:1.2
*** m3/pm3/libs/m3core/src/unix/ultrix-3-1.NEXT/Uexec.i3:1.1.1.1 Thu Jan 16 16:30:11 1997
--- m3/pm3/libs/m3core/src/unix/ultrix-3-1.NEXT/Uexec.i3 Tue Feb 10 22:46:10 1998
***************
*** 48,63 ****
(* terminated process status *)
w_T = RECORD
w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
! w_Filler : BITS 16 FOR [0..16_FFFF]; END;
(* stopped process status *)
w_S = RECORD
! w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
w_Stopsig : BITS 8 FOR [0..16_FF]; (* signal that stopped us *)
! w_Filler : BITS 16 FOR [0..16_FFFF]; END;
(* union wait is a union of the three types above. We will use w_A
in the declarations and do a LOOPHOLE when necessary *)
--- 48,73 ----
(* terminated process status *)
w_T = RECORD
+ w_Filler : BITS 16 FOR [0..16_FFFF];
+ w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
+ w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
+ END;
+
+ (* M3 view of return code *)
+ w_M3 = RECORD
+ w_Filler : BITS 16 FOR [0..16_FFFF];
w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
+ w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
! END;
(* stopped process status *)
w_S = RECORD
! w_Filler : BITS 16 FOR [0..16_FFFF];
w_Stopsig : BITS 8 FOR [0..16_FF]; (* signal that stopped us *)
! w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
! END;
(* union wait is a union of the three types above. We will use w_A
in the declarations and do a LOOPHOLE when necessary *)
Index: m3/pm3/libs/m3core/src/unix/ultrix-3-1.SEQUENT/Uexec.i3
diff -c m3/pm3/libs/m3core/src/unix/ultrix-3-1.SEQUENT/Uexec.i3:1.1.1.1 m3/pm3/libs/m3core/src/unix/ultrix-3-1.SEQUENT/Uexec.i3:1.2
*** m3/pm3/libs/m3core/src/unix/ultrix-3-1.SEQUENT/Uexec.i3:1.1.1.1 Thu Jan 16 16:30:11 1997
--- m3/pm3/libs/m3core/src/unix/ultrix-3-1.SEQUENT/Uexec.i3 Tue Feb 10 22:46:13 1998
***************
*** 38,43 ****
--- 38,50 ----
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+ (* M3 view of return code *)
+ w_M3 = RECORD
+ w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
+ w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
+ w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
+ w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+
(* stopped process status *)
w_S = RECORD
w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
Index: m3/pm3/libs/m3core/src/unix/ultrix-3-1.SUN3/Uexec.i3
diff -c m3/pm3/libs/m3core/src/unix/ultrix-3-1.SUN3/Uexec.i3:1.1.1.1 m3/pm3/libs/m3core/src/unix/ultrix-3-1.SUN3/Uexec.i3:1.2
*** m3/pm3/libs/m3core/src/unix/ultrix-3-1.SUN3/Uexec.i3:1.1.1.1 Thu Jan 16 16:30:11 1997
--- m3/pm3/libs/m3core/src/unix/ultrix-3-1.SUN3/Uexec.i3 Tue Feb 10 22:46:17 1998
***************
*** 48,63 ****
(* terminated process status *)
w_T = RECORD
w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
! w_Filler : BITS 16 FOR [0..16_FFFF]; END;
(* stopped process status *)
w_S = RECORD
! w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
w_Stopsig : BITS 8 FOR [0..16_FF]; (* signal that stopped us *)
! w_Filler : BITS 16 FOR [0..16_FFFF]; END;
(* union wait is a union of the three types above. We will use w_A
in the declarations and do a LOOPHOLE when necessary *)
--- 48,73 ----
(* terminated process status *)
w_T = RECORD
+ w_Filler : BITS 16 FOR [0..16_FFFF];
+ w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
+ w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
+ END;
+
+ (* M3 view of return code *)
+ w_M3 = RECORD
+ w_Filler : BITS 16 FOR [0..16_FFFF];
w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
+ w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
! END;
(* stopped process status *)
w_S = RECORD
! w_Filler : BITS 16 FOR [0..16_FFFF];
w_Stopsig : BITS 8 FOR [0..16_FF]; (* signal that stopped us *)
! w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
! END;
(* union wait is a union of the three types above. We will use w_A
in the declarations and do a LOOPHOLE when necessary *)
Index: m3/pm3/libs/m3core/src/unix/ultrix-3-1.SUN386/Uexec.i3
diff -c m3/pm3/libs/m3core/src/unix/ultrix-3-1.SUN386/Uexec.i3:1.1.1.1 m3/pm3/libs/m3core/src/unix/ultrix-3-1.SUN386/Uexec.i3:1.2
*** m3/pm3/libs/m3core/src/unix/ultrix-3-1.SUN386/Uexec.i3:1.1.1.1 Thu Jan 16 16:30:11 1997
--- m3/pm3/libs/m3core/src/unix/ultrix-3-1.SUN386/Uexec.i3 Tue Feb 10 22:46:20 1998
***************
*** 53,58 ****
--- 53,65 ----
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+ (* M3 view of return code *)
+ w_M3 = RECORD
+ w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
+ w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
+ w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
+ w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+
(* stopped process status *)
w_S = RECORD
w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
Index: m3/pm3/libs/m3core/src/unix/ultrix-3-1.UMAX/Uexec.i3
diff -c m3/pm3/libs/m3core/src/unix/ultrix-3-1.UMAX/Uexec.i3:1.1.1.1 m3/pm3/libs/m3core/src/unix/ultrix-3-1.UMAX/Uexec.i3:1.2
*** m3/pm3/libs/m3core/src/unix/ultrix-3-1.UMAX/Uexec.i3:1.1.1.1 Thu Jan 16 16:30:11 1997
--- m3/pm3/libs/m3core/src/unix/ultrix-3-1.UMAX/Uexec.i3 Tue Feb 10 22:46:24 1998
***************
*** 53,58 ****
--- 53,65 ----
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+ (* M3 view of return code *)
+ w_M3 = RECORD
+ w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
+ w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
+ w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
+ w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+
(* stopped process status *)
w_S = RECORD
w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
Index: m3/pm3/libs/m3core/src/unix/ultrix-3-1.VAX/Uexec.i3
diff -c m3/pm3/libs/m3core/src/unix/ultrix-3-1.VAX/Uexec.i3:1.1.1.1 m3/pm3/libs/m3core/src/unix/ultrix-3-1.VAX/Uexec.i3:1.2
*** m3/pm3/libs/m3core/src/unix/ultrix-3-1.VAX/Uexec.i3:1.1.1.1 Thu Jan 16 16:30:11 1997
--- m3/pm3/libs/m3core/src/unix/ultrix-3-1.VAX/Uexec.i3 Tue Feb 10 22:46:27 1998
***************
*** 53,58 ****
--- 53,65 ----
w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+ (* M3 view of return code *)
+ w_M3 = RECORD
+ w_Retcode : BITS 8 FOR [0..16_FF]; (* exit code if w_termsig == 0 *)
+ w_Termsig : BITS 7 FOR [0..16_7F]; (* termination signal *)
+ w_Coredump: BITS 1 FOR [0..16_01]; (* core dump indicator *)
+ w_Filler : BITS 16 FOR [0..16_FFFF]; END;
+
(* stopped process status *)
w_S = RECORD
w_Stopval : BITS 8 FOR [0..16_FF]; (* == W_STOPPED if stopped *)
Index: m3/pm3/libs/src/index.html
diff -c /dev/null m3/pm3/libs/src/index.html:1.1.1.1
*** /dev/null Tue Feb 10 23:32:43 1998
--- m3/pm3/libs/src/index.html Sat Jan 31 14:47:14 1998
***************
*** 0 ****
--- 1,54 ----
+
+
+ Ecole Polytechnique
+ C.P. 6079, Succ. Centre-Ville
+ Montreal, Quebec, H3C 3A7
+ 18 January 1998
+ operating system
+ input/output
+ data structures
+ geometry
+ wide audience
+ General Purpose Libraries
+
+
+
+
+
+
Index: m3/pm3/libs/src/m3makefile
diff -c /dev/null m3/pm3/libs/src/m3makefile:1.2
*** /dev/null Tue Feb 10 23:32:43 1998
--- m3/pm3/libs/src/m3makefile Tue Feb 10 22:46:34 1998
***************
*** 0 ****
--- 1,7 ----
+
+ import("m3doc")
+
+ HtmlFile("index")
+
+ OtherPackage("libs")
+
Index: m3/pm3/m3config/src/COMMON
diff -c m3/pm3/m3config/src/COMMON:1.7 m3/pm3/m3config/src/COMMON:1.8
*** m3/pm3/m3config/src/COMMON:1.7 Thu Jan 29 10:32:41 1998
--- m3/pm3/m3config/src/COMMON Tue Feb 10 22:43:16 1998
***************
*** 79,91 ****
".ix", ".mx", ".exe", "NONAME.EXE","lib","\\","\r\n",":",":","","T"]
%
! % This procedure is called just before programs or libraries are built.
! % It is the appropriate place to compute the compilation commands and other
! % variables used by the compilation.
%
proc before_do_m3_hooks() is
! setCommands("","")
end
%
--- 79,98 ----
".ix", ".mx", ".exe", "NONAME.EXE","lib","\\","\r\n",":",":","","T"]
%
! % Provide for "hooks" to be called at the end of the m3makefile,
! % after all the information is set and before the real processing starts.
%
+ m3_hooks = []
+
+ proc add_m3_hook(p) is
+ m3_hooks += p
+ end
+
proc before_do_m3_hooks() is
! foreach p in m3_hooks
! p()
! end
end
%
***************
*** 171,177 ****
% This is called once all the options affecting the commands are entered.
%
! proc setCommands (opt,val) is
CC_CMD = CC
LINK_CMD = LINK
MAKELIB_CMD = MAKELIB
--- 178,184 ----
% This is called once all the options affecting the commands are entered.
%
! proc setCommands () is
CC_CMD = CC
LINK_CMD = LINK
MAKELIB_CMD = MAKELIB
***************
*** 221,226 ****
--- 228,235 ----
M3_BACKEND_OUTPUT = "ASM"
end
+ LINK_libpath = ""
+
if PLATFORM_SUPPORTS_SHARED_LIB
if Options{"shared_lib"}[0]
CC_CMD += PIC_FLAG
***************
*** 229,235 ****
if Options{"standalone"}[0]
LINK_CMD += STATIC_FLAG
- LINK_libpath = ""
else
if not empty(DYNAMIC_FLAG) LINK_CMD += DYNAMIC_FLAG end
if defined("TARGET_LIB_USE") and RPATH_FLAG
--- 238,243 ----
***************
*** 241,246 ****
--- 249,261 ----
end
%
+ % Get setCommands called just before the compilation starts, once all the
+ % options are set.
+ %
+
+ add_m3_hook(setCommands)
+
+ %
% The following procedures are useful to centralize the customization about
% which files are required for X11, PEX, TCP... on different platforms.
% They are called by packages needing these facilities. They may be
***************
*** 395,407 ****
%
proc m3_note_shlib(lib) is
! local lib_so = format ("lib%s.so", lib)
! if defined ("_all")
! install_derived (lib_so)
! install_link(lib_so, LIB_TO_PKG_USE & SL & PACKAGE & SL & BUILD_DIR,
! LIB_INSTALL)
end
- deriveds (lib_so, [""])
end
%
--- 410,424 ----
%
proc m3_note_shlib(lib) is
! if Options{"shared_lib"}[0] and PLATFORM_SUPPORTS_SHARED_LIB
! local lib_so = format ("lib%s.so", lib)
! if defined ("_all")
! install_derived (lib_so)
! install_link(lib_so, LIB_TO_PKG_USE & SL & PACKAGE & SL & BUILD_DIR,
! LIB_INSTALL)
! end
! deriveds (lib_so, [""])
end
end
%
***************
*** 481,492 ****
%
readonly proc SrcExport (nm) is
! local dest = PKG_INSTALL & SLship & PACKAGE & SLship & pkg_subdir()
_install_file(nm,dest,"0644","")
end
readonly proc SrcdExport (nm) is
! local dest = PKG_INSTALL & SLship & PACKAGE & SLship & pkg_subdir()
deriveds(nm,no_extension)
_install_file(nm,dest,"0644","T")
end
--- 498,509 ----
%
readonly proc SrcExport (nm) is
! local dest = PKG_INSTALL & SL & PACKAGE & SL & pkg_subdir()
_install_file(nm,dest,"0644","")
end
readonly proc SrcdExport (nm) is
! local dest = PKG_INSTALL & SL & PACKAGE & SL & pkg_subdir()
deriveds(nm,no_extension)
_install_file(nm,dest,"0644","T")
end
Index: m3/pm3/m3config/src/NT386GNU
diff -c m3/pm3/m3config/src/NT386GNU:1.5 m3/pm3/m3config/src/NT386GNU:1.6
*** m3/pm3/m3config/src/NT386GNU:1.5 Thu Jan 29 10:32:41 1998
--- m3/pm3/m3config/src/NT386GNU Tue Feb 10 22:43:16 1998
***************
*** 1,13 ****
! readonly TARGET = "NT386GNU"
include("COMMON")
PLATFORM_SUPPORTS_LATEX = ""
INSTALL_ROOT = "\\usr\\pm3"
! LINK_suffix = [ "-lkernel32", "-luser32", "-lgdi32", "-ladvapi32",
! "-lnetapi32", "-lm" ]
setDefault("","")
--- 1,12 ----
! readonly TARGET = "NT386GNU"
include("COMMON")
PLATFORM_SUPPORTS_LATEX = ""
INSTALL_ROOT = "\\usr\\pm3"
! LINK_suffix = [ "-luser32", "-lgdi32", "-ladvapi32", "-lnetapi32", "-lm" ]
setDefault("","")
***************
*** 20,78 ****
import_lib("wsock32", "/usr/local/lib/i386-cygwin32")
end
- proc m3_compile_c (source, object, includes) is
- local cmd = [ CC_CMD, w2p(source)]
- foreach i in includes
- cmd += "-I" & w2p(i)
- end
- if object cmd += [ "-o", w2p(object) ] end
- if VERBOSE write(cmd, CR) end
- return exec(cmd)
- end
-
- proc m3_link (prog, objects, imported_libs) is
- local cmd = [ LINK_CMD, "-o", w2p(prog), objects ]
- foreach i in imported_libs
- if not empty(i[0])
- cmd += "-L" & w2p(i[0])
- end
- cmd += "-l" & w2p(i[1])
- end
-
- cmd += LINK_suffix
-
- if VERBOSE write(cmd, CR) end
- return exec (cmd)
- end
-
- proc m3_make_lib (lib, objects, imported_libs) is
- local ret = 0
- local lib_a = format ("lib%s.a", lib)
- local cmd = [ MAKELIB_CMD, w2p(lib_a), objects, imported_libs ]
- if VERBOSE write(cmd, CR) end
- ret = exec (cmd)
- if not equal(ret, 0) return ret end
- cmd = [ RANLIB_CMD, lib_a ]
- if VERBOSE write(cmd, CR) end
- ret = exec (cmd)
- return ret
- end
-
- proc m3_assemble (source, object) is
- local cmd = [ ASM_CMD, w2p(object), w2p(source) ]
-
- if VERBOSE write(cmd, CR) end
- return exec (cmd)
- end
-
- proc m3_backend (source, object) is
- local cmd = [ BACKEND_CMD, "-o", w2p(object), w2p(source) ]
-
- if VERBOSE write(cmd, CR) end
- return exec(cmd)
- end
-
proc install_file (src, dest, mode) is
Note_install (src, dest)
! local ret = exec ([ "cp", "-a", w2p(src), w2p(dest) ])
end
--- 19,26 ----
import_lib("wsock32", "/usr/local/lib/i386-cygwin32")
end
proc install_file (src, dest, mode) is
Note_install (src, dest)
! local ret = exec (["install", "-c", "-m", mode, w2p(src), w2p(dest)])
! if not equal(ret, 0) error("install failed with error code: ", ret) end
end
Index: m3/pm3/m3config/src/SOLgnu
diff -c m3/pm3/m3config/src/SOLgnu:1.5 m3/pm3/m3config/src/SOLgnu:1.6
*** m3/pm3/m3config/src/SOLgnu:1.5 Sat Jan 17 11:51:44 1998
--- m3/pm3/m3config/src/SOLgnu Tue Feb 10 22:43:16 1998
***************
*** 13,19 ****
PLATFORM_SUPPORTS_MOTIF = "TRUE"
PLATFORM_SUPPORTS_SHARED_LIB = "TRUE"
! CC = [ "gcc", "-Wa,P", "-c" ]
LINK = [ "gcc" ]
MAKELIB = [ "/usr/ccs/bin/ar", "cru" ]
MAKESHLIB = [ "/usr/ccs/bin/ld", "-dy", "-G", "-z", "text" ]
--- 13,19 ----
PLATFORM_SUPPORTS_MOTIF = "TRUE"
PLATFORM_SUPPORTS_SHARED_LIB = "TRUE"
! CC = [ "gcc", "-Wa,-P", "-c" ]
LINK = [ "gcc" ]
MAKELIB = [ "/usr/ccs/bin/ar", "cru" ]
MAKESHLIB = [ "/usr/ccs/bin/ld", "-dy", "-G", "-z", "text" ]
Index: m3/pm3/network/mail/src/index.html
diff -c /dev/null m3/pm3/network/mail/src/index.html:1.1.1.1
*** /dev/null Tue Feb 10 23:32:45 1998
--- m3/pm3/network/mail/src/index.html Sat Jan 31 14:47:14 1998
***************
*** 0 ****
--- 1,30 ----
+
+
+ Ecole Polytechnique
+ C.P. 6079, Succ. Centre-Ville
+ Montreal, Quebec, H3C 3A7
+ 18 January 1998
+ mail
+
+ Ecole Polytechnique
+ C.P. 6079, Succ. Centre-Ville
+ Montreal, Quebec, H3C 3A7
+ 18 January 1998
+ distributed
+ network objects
+ remote method invocation
+ rmi
+ wide audience
+ Network Objects
+
+
+
+
+
+
Index: m3/pm3/network/netobjects/src/m3makefile
diff -c /dev/null m3/pm3/network/netobjects/src/m3makefile:1.2
*** /dev/null Tue Feb 10 23:32:49 1998
--- m3/pm3/network/netobjects/src/m3makefile Tue Feb 10 22:42:40 1998
***************
*** 0 ****
--- 1,7 ----
+
+ import("m3doc")
+
+ HtmlFile("index")
+
+ OtherPackage("netobjects")
+
Index: m3/pm3/network/pkgserver/src/index.html
diff -c /dev/null m3/pm3/network/pkgserver/src/index.html:1.1.1.1
*** /dev/null Tue Feb 10 23:32:51 1998
--- m3/pm3/network/pkgserver/src/index.html Sat Jan 31 14:47:14 1998
***************
*** 0 ****
--- 1,39 ----
+
+
+ Ecole Polytechnique
+ C.P. 6079, Succ. Centre-Ville
+ Montreal, Quebec, H3C 3A7
+ 18 January 1998
+ distributed
+ package
+ server
+ The package server
+
+
+
+
+
+
Index: m3/pm3/network/pkgserver/src/m3makefile
diff -c /dev/null m3/pm3/network/pkgserver/src/m3makefile:1.2
*** /dev/null Tue Feb 10 23:32:51 1998
--- m3/pm3/network/pkgserver/src/m3makefile Tue Feb 10 22:42:44 1998
***************
*** 0 ****
--- 1,7 ----
+
+ import("m3doc")
+
+ HtmlFile("index")
+
+ OtherPackage("pkgserver")
+
Index: m3/pm3/network/src/index.html
diff -c /dev/null m3/pm3/network/src/index.html:1.1.1.1
*** /dev/null Tue Feb 10 23:32:51 1998
--- m3/pm3/network/src/index.html Sat Jan 31 14:47:15 1998
***************
*** 0 ****
--- 1,43 ----
+
+
+ Ecole Polytechnique
+ C.P. 6079, Succ. Centre-Ville
+ Montreal, Quebec, H3C 3A7
+ 18 January 1998
+ network
+ mail
+ web
+ tcp
+ wide audience
+ Networking
+
+
+
+
+
+
Index: m3/pm3/network/src/m3makefile
diff -c /dev/null m3/pm3/network/src/m3makefile:1.2
*** /dev/null Tue Feb 10 23:32:51 1998
--- m3/pm3/network/src/m3makefile Tue Feb 10 22:42:48 1998
***************
*** 0 ****
--- 1,7 ----
+
+ import("m3doc")
+
+ HtmlFile("index")
+
+ OtherPackage("network")
+
Index: m3/pm3/network/tcplibs/src/index.html
diff -c /dev/null m3/pm3/network/tcplibs/src/index.html:1.1.1.1
*** /dev/null Tue Feb 10 23:32:51 1998
--- m3/pm3/network/tcplibs/src/index.html Sat Jan 31 14:47:15 1998
***************
*** 0 ****
--- 1,34 ----
+
+
+ Ecole Polytechnique
+ C.P. 6079, Succ. Centre-Ville
+ Montreal, Quebec, H3C 3A7
+ 18 January 1998
+ TCP
+ IP
+ internet
+ protocol
+
+
+
+
+
Index: m3/pm3/network/tcplibs/src/m3makefile
diff -c /dev/null m3/pm3/network/tcplibs/src/m3makefile:1.2
*** /dev/null Tue Feb 10 23:32:51 1998
--- m3/pm3/network/tcplibs/src/m3makefile Tue Feb 10 22:42:51 1998
***************
*** 0 ****
--- 1,7 ----
+
+ import("m3doc")
+
+ HtmlFile("index")
+
+ OtherPackage("tcplibs")
+
Index: m3/pm3/network/tcplibs/tcp/src/m3makefile
diff -c m3/pm3/network/tcplibs/tcp/src/m3makefile:1.2 m3/pm3/network/tcplibs/tcp/src/m3makefile:1.3
*** m3/pm3/network/tcplibs/tcp/src/m3makefile:1.2 Tue Jan 28 12:24:37 1997
--- m3/pm3/network/tcplibs/tcp/src/m3makefile Tue Feb 10 22:42:55 1998
***************
*** 10,20 ****
import("libm3")
import_TCP()
- %m3_option ("-Y6@/udir/kalsow/pkg/m3/m3staloneback/DS/m3back@-NTObj@")
- %m3_option ("-X0@-unfold_nested_procs@")
- %m3_option ("-Y7@@")
- %m3_option ("-zINT386")
-
include_dir(OS_TYPE)
include_dir("common")
--- 10,15 ----
Index: m3/pm3/network/www/src/index.html
diff -c /dev/null m3/pm3/network/www/src/index.html:1.1.1.1
*** /dev/null Tue Feb 10 23:32:56 1998
--- m3/pm3/network/www/src/index.html Sat Jan 31 14:47:15 1998
***************
*** 0 ****
--- 1,43 ----
+
+
+ Ecole Polytechnique
+ C.P. 6079, Succ. Centre-Ville
+ Montreal, Quebec, H3C 3A7
+ 18 January 1998
+ network
+ www
+ browser
+ World Wide Web
+
+
+
+
+
+
Index: m3/pm3/network/www/src/m3makefile
diff -c /dev/null m3/pm3/network/www/src/m3makefile:1.2
*** /dev/null Tue Feb 10 23:32:56 1998
--- m3/pm3/network/www/src/m3makefile Tue Feb 10 22:42:59 1998
***************
*** 0 ****
--- 1,7 ----
+
+ import("m3doc")
+
+ HtmlFile("index")
+
+ OtherPackage("www")
+
Index: m3/pm3/src/index.html
diff -c /dev/null m3/pm3/src/index.html:1.1
*** /dev/null Tue Feb 10 23:32:59 1998
--- m3/pm3/src/index.html Sat Jan 31 15:49:58 1998
***************
*** 0 ****
--- 1,12 ----
+
+ PM3: The Modula-3 distribution of Ecole Polytechnique de Montreal
+
+
+
+
+
\ No newline at end of file
Index: m3/pm3/src/m3makefile
diff -c m3/pm3/src/m3makefile:1.14 m3/pm3/src/m3makefile:1.17
*** m3/pm3/src/m3makefile:1.14 Wed Jan 28 16:00:48 1998
--- m3/pm3/src/m3makefile Tue Feb 10 22:42:07 1998
***************
*** 45,51 ****
--- 45,56 ----
EXPORTPATH = lookup("EXPORTPATH","")
EXPORTRPATH = lookup("EXPORTRPATH","")
+ if EXPORTPATH
+ if equal(OS_TYPE,"WIN32") EXPORTPATH = p2w(EXPORTPATH) end
+ end
+
if EXPORTRPATH
+ if equal(OS_TYPE,"WIN32") EXPORTRPATH = p2w(EXPORTRPATH) end
EXPORTPATH = path() & SL & ".." & SL & EXPORTRPATH
end
***************
*** 62,68 ****
write("TARGET_LIB_USE = LIB_USE", CR)
write("TARGET_PKG_USE = PKG_USE", CR)
! write("INSTALL_ROOT = \"" & EXPORTPATH & "\" & INSTALL_ROOT",CR)
write("setInstallRoot(\"\",\"\")",CR)
end
end
--- 67,73 ----
write("TARGET_LIB_USE = LIB_USE", CR)
write("TARGET_PKG_USE = PKG_USE", CR)
! write("INSTALL_ROOT = \"" & escape(EXPORTPATH) & "\" & INSTALL_ROOT",CR)
write("setInstallRoot(\"\",\"\")",CR)
end
end
***************
*** 211,216 ****
--- 216,226 ----
BuildChunk("text/sgmltools","sgmlconv")
BuildChunk("text/sgmltools","sgmllinear")
+ %--- sgmltools --- doc -------------------------------------------------
+ % SGML related tools
+ % requires: libm3
+ BuildChunk("text","sgmltools")
+
%--- m3textohtml --- utility -------------------------------------------------
% Convert Modula-3 units from LaTeX markup to HTML markup
% requires: libm3
***************
*** 236,242 ****
% in the distribution as a sample of native Windows programming in Modula-3.
% requires: libm3
if equal (OS_TYPE, "WIN32")
! BuildChunk("graphics","sil")
end
%--- m3middle --- library -------------------------------------------------
--- 246,252 ----
% in the distribution as a sample of native Windows programming in Modula-3.
% requires: libm3
if equal (OS_TYPE, "WIN32")
! % BuildChunk("graphics","sil")
end
%--- m3middle --- library -------------------------------------------------
***************
*** 520,525 ****
--- 530,540 ----
BuildChunk("language/modula3/m3tools","m3browser")
end
+ %--- m3ide --- utility -------------------------------------------------
+ % simple integrated development environment based on emacs
+ % requires: libm3
+ BuildChunk("language/modula3/m3tools","m3ide")
+
%--- tcl --- library -------------------------------------------------
% a thin Modula-3 veneer on the TCL library (version 6.2).
% requires: libm3 (TCL is required to build a shared library)
***************
*** 938,942 ****
--- 953,988 ----
% program that takes a URL and prints out the web document
% requires: http
BuildChunk("network/www","webcat")
+
+ %------------------------------------------------------------
+ %
+ % Intermediate "documentation" nodes in the hierarchy
+ %
+ BuildChunk(".","intro")
+ BuildChunk("database","stableobjects")
+ BuildChunk(".","database")
+ BuildChunk("graphics","animation")
+ BuildChunk("graphics","displayps")
+ BuildChunk("graphics","forms")
+ BuildChunk("graphics","games")
+ BuildChunk("graphics","gr-libs")
+ BuildChunk("graphics","lecternpkg")
+ BuildChunk("graphics","sharedboard")
+ BuildChunk(".","graphics")
+ BuildChunk("language","m3obliq")
+ BuildChunk("language/modula3","m3compiler")
+ BuildChunk("language/modula3","m3tools")
+ BuildChunk("language","modula3")
+ BuildChunk("language/parsing","metasyntax")
+ BuildChunk("language","parsing")
+ BuildChunk(".","language")
+ BuildChunk(".","libs")
+ BuildChunk("network","mail")
+ BuildChunk("network","netobjects")
+ BuildChunk("network","pkgserver")
+ BuildChunk("network","tcplibs")
+ BuildChunk("network","www")
+ BuildChunk(".","network")
+ BuildChunk(".","text")
end
Index: m3/pm3/text/sgmltools/m3doc/src/index.html
diff -c m3/pm3/text/sgmltools/m3doc/src/index.html:1.1.1.1 m3/pm3/text/sgmltools/m3doc/src/index.html:1.2
*** m3/pm3/text/sgmltools/m3doc/src/index.html:1.1.1.1 Sat Jan 17 09:26:50 1998
--- m3/pm3/text/sgmltools/m3doc/src/index.html Tue Feb 10 22:41:38 1998
***************
*** 24,32 ****
The M3DOC documentation system
- The SGML Parser Library
-
+ Ecole Polytechnique
+ C.P. 6079, Succ. Centre-Ville
+ Montreal, Quebec, H3C 3A7
+ 18 January 1998
+ text processing
+ documentation
+ text
+ wide audience
+ Text
+
+
+
+
+
+
Index: m3/pm3/text/src/m3makefile
diff -c /dev/null m3/pm3/text/src/m3makefile:1.2
*** /dev/null Tue Feb 10 23:33:03 1998
--- m3/pm3/text/src/m3makefile Tue Feb 10 22:41:52 1998
***************
*** 0 ****
--- 1,7 ----
+
+ import("m3doc")
+
+ HtmlFile("index")
+
+ OtherPackage("text")
+