News for hackers. Stuff that matters.
Re:“A closure is a poor man’s object; an object is a poor ma... by coldtea on Monday May 01, 2017 @08:00AM (#14236907)
>My definition of an object is "an ADT that gets to 'decide', using private runtime state, what to do in response to any/all attempts to interact with it." Which makes for a very simple test: if something is an object, you should be able to send it a message that makes it change its mind about what messages it accepts after that.

Your criterion doesn't match your definition.

Specifically "you should be able to send it a message that makes it change its mind about what messages it accepts after that" doesn't logically derive from "an object is an ADT that gets to 'decide', using private runtime state, what to do in response to any/all attempts to interact with it".

The second not only needs:

a) an object is an ADT that gets to 'decide', using private runtime state, what to do in response to any/all attempts to interact with it

but also implies b:

b) you can interact with the object and alter its private decision making process (and not just partially, e.g. only alter the data part of its runtime state).

There are no comments on this comment yet.