From: | Kaz Kylheku <kaz@kylheku.com> |
Newsgroups: | comp.compilers |
Date: | Wed, 10 Sep 2014 04:58:37 +0000 (UTC) |
Organization: | Aioe.org NNTP Server |
References: | 14-09-005 14-09-007 |
Keywords: | OOP, design |
Posted-Date: | 10 Sep 2014 11:02:45 EDT |
On 2014-09-10, glen herrmannsfeldt <gah@ugcs.caltech.edu> wrote:
>> Hello is a general-purpose, object-oriented, imperative, protocol-agnostic
>> language for distributed applications. ...
> For that reason, I tended to think of imperative as exclusive
> from object-oriented. Not that you can't, or shouldn't, write
> imperative programs in OO languages, but that it wouldn't be
> used as a term in the description. (Or, why is it that vol. 2
> isn't called "Non-Object Oriented Languages"?) ...
Popular object orientation, like in Java, C++, Python, and whatnot,
is thoroughly imperative.
Objects have state, and support methods which mutate state.
This changing state is central to the collaboration among objects
in OO designs; OO is the organizational tool for managing the complexity
of all that state.
It is possible to have functional object-oriented programming;
everything is a constructor or non-mutating accessor.
An example of this is the treatment of numbers in the Common Lisp
Object System (CLOS). You cannot mutate an integer, ratio,
floating-point number or complex number. However, they belong to
classes linked by inheritance, and methods can be easily written in
the object system which specialize over various kinds of numbers. They
just return new numbers constructed based on their arguments.
Return to the
comp.compilers page.
Search the
comp.compilers archives again.