by Peter Ryser, ETH Zurich
2nd edition, 11-May-1999
The following program should be minimal in respect to the size of the generated code. Please note that the module "M" must be unloaded from the memory to work correctly.
MODULE M;
IMPORT O:=Out;
CONST
T=";PROCEDURE c*;BEGIN O.Char(22X);O.String(T) END c;BEGIN O.String('MODULE M;IMPORT O:=Out;CONST T=');c END M.";
PROCEDURE c*;
BEGIN
O.Char(22X);O.String(T)
END c;
BEGIN
O.String('MODULE M;IMPORT O:=Out;CONST T=');
c
END M.To start the program again, first unload it with the command System.Free M~
by Hans Klaver, The Netherlands.
Striving for simplicity pays off.
The following program Print works under the Oberon System (S3 and V4) and prints itself to the System.Log, when its exported command Me is activated.
MODULE Print; (* Hans Klaver, 09-May-1999 *)
(** To execute middle-click Print.Me **)
IMPORT In, Out;
PROCEDURE Me*;
VAR ch: CHAR;
BEGIN
In.Open;
In.Char(ch);
WHILE In.Done DO
Out.Char(ch);
In.Char(ch)
END
END Me;
END Print.Me*It is interesting to note that the command Print.Me* also prints any changes made in the program text, even before these are stored to disk.
IMPRESSUM: The ModulaTor is an unrefereed journal. Technical papers are to be
taken as working papers and personal rather than organizational statements.
Items are printed at the discretion of the Editor based upon his judgement on
the interest and relevancy to the readership. Letters, announcements, and
other items of professional interest are selected on the same basis.
Office of publication.
The Editor of The ModulaTor is Günter Dotzel; he can be reached at
mailto:[email deleted due to spam]
Most of the ModulaTor back-issues are available from
http://www.modulaware.com/
[ Home |
Site_index |
Legal |
OpenVMS_compiler |
Alpha_Oberon_System |
ModulaTor |
Bibliography |
Oberon[-2]_links |
Modula-2_links |
.zel.org Oberon website |
General interesting book recommendations ]
© (1999) by modulaware.com
Webdesign by www.otolo.com/webworx,
11-Jun-1999