[Oberon] ABSTRACT to EMPTY redefinition in Component Pascal
chris at cfbsoftware.com
Wed Apr 11 13:57:30 CEST 2018
> -----Original Message-----
> From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of
> Diego Sardina
> Sent: Wednesday, 11 April 2018 6:20 AM
> To: oberon at lists.inf.ethz.ch
> Subject: [Oberon] ABSTRACT to EMPTY redefinition in Component Pascal
> Dear Oberon community,
> I found an unusual feature while playing a bit with Component Pascal.
> The report says: "A method redefined by an empty method must be empty
> or abstract."
> This sentence means that in later extensions an abstract method can
> be redefined as an optional/empty.
> Are there any use-cases for this?
I'm not aware of any specific examples but the usage of EMPTY methods and
ABSTRACT methods etc. is described in
'What's New in Component Pascal'
My understanding is that the designer of the later extension would use EMPTY
if he wants to clearly indicate to the reader that the method is not
required in this particular extension. Something must be provided for the
abstract method in the implementation. Common alternative techniques are:
a) implement a dummy method with just a begin and an end, or
b) implement a method which reports "not implemented"
The intention of these are less obvious to the reader. They could be
interpreted as meaning that the implementation is still a work in progress.
More information about the Oberon