[Oberon] Re (n): syntax in BB, CP, GPCP and V4 ...
Chris Burrows
chris at cfbsoftware.com
Sun Jul 23 08:28:17 CEST 2017
> -----Original Message-----
> From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of
> peter at easthope.ca
> Sent: Sunday, 23 July 2017 2:02 AM
> To: oberon at lists.inf.ethz.ch
> Subject: [Oberon] Re (n): syntax in BB, CP, GPCP and V4 ...
>
> From: SvZyZw== <joerg.straube at iaeth.ch>
> Date: Fri, 21 Jul 2017 11:35:49 +0200
> > Attached the V4 version.
>
> Is there a convention for indentation? Two blanks for each step?
> Four blanks for each step? A tab character for each? Entirely
> personal preference?
>
It is a personal preference - the Oberon language (unlike some others) does
not enforce either indentation or any convention. The Oberon compiler treats
tab characters the same as blanks and other 'whitespace' characters.
However, if modifying existing code it makes sense to try to be consistent
with the programming style used by the original author(s). Similarly if
adding new source files to an existing system.
I do not recommend using tabs in source text because many different editors
/ word processors / IDEs / printers / text search / text comparison programs
interpret tabs in different ways.
Two current examples of Oberon indentation usage are:
a) Wirth's Project Oberon: Two spaces for used for each level of
indentation.
b) Astrobe IDE: The indent width is configurable with a default value is two
spaces. Like many other IDEs, the TAB key can be used to control indentation
but the text never contains tab characters e.g. if you select a number of
lines and press the TAB key each line is indented by insert indent-width
number of spaces. Conversely Shift-TAB unindents each selected line by the
indent width.
Regards,
Chris Burrows
CFB Software
http://www.astrobe.com
More information about the Oberon
mailing list