[Oberon] RISC emulator
Jan Verhoeven
jan at verhoeven272.nl
Wed Mar 26 17:06:58 CET 2014
Paul Onyschuk wrote:
> Things like multiple expressions on the same line, short variable
> names are more a matter of style than language itself.
I make my variable names as long as required. I need to know what a var
is for. So I decide to use CamelCase and the length of my choice.
Multiple commands on a line. Now, this is real easy. In C, the semicolon
is the line terminator. In Pascal, Modula-2 and Oberon, the semicolon is
the line-start!
In principle, each line ends after the last token. At that moment, the
compiler expects an END, UNTIL, or whatever keyword. When that keyword
is not coming up, the semicolon signals an extra line of code is coming up.
So in fact, the syntax is:
WHILE (ch > ' ') & (i < j) DO
str [i] := ch
;In.Char (ch)
;INC (i)
END
;str [i] := 0X
END ReadString;
instead of the better readable:
WHILE (ch > ' ') & (i < j) DO
str [i] := ch;
In.Char (ch);
INC (i)
END;
str [i] := 0X
END ReadString;
Keep it in mind. It's great fun omitting the unnecessary semi's....
--
Groetjes
Jan Verhoeven
More information about the Oberon
mailing list