
methods & 1st class messages
Quote:
> > He also pointed out that this OO-style
> > would not have been possible with type-bound procedures but
> > requires messages to be first class (message variables).
> Is it just me, or is this confusing programming
> techniques with language features? A handler (any subroutine
> accepting a message record as a parameter) can be implemented
> as a procedure variable or a type-bound procedure. Yet, I've
> seen this attitude several times before. Even Drs. Gutknecht
> (in his Oberon Tag '93 speech) and Mossenbock (in his essay
> "Object Oriented Programming in Oberon-2) seem to neccessarily
> identify handlers with procedure variables. Is this simply an
> unfortunate habit of thought, or am I missing an important
> point here?
What counts is not the distinction between type-bound (methods) and instance-
bound (proc vars) procedures but the existence or non-existence of messages as
first class objects. Handlers in System3 are message handlers, i.e. they get a
message as an explicit parameter, it is not the parameter list which
implicitly represents the message. It doesn't make a big difference to
implement a handler as a type-bound procedure or as procedure variable. Thus,
it would not be justified to introduce methods for this purpose only. However,
If you have different methods for different messages, then you get a different
OOP-style which most people believe to be the only OOP-style. Gutknecht
pointed out that this traditional OOP-style is not sufficient for System3.
- Josef Templ