Re: identity...... Was: The wisdom of the object mentors



Fine. Now, I see the word "int" there. What is the states of? What is the
state of state[2]? What is the state of the result of "new int[2]"? What is
the state of 2?

I don't care what it's internal state is, only it's behaviour.

But you seems to care about the state of 2DVector. Why?

I was attempting to demonstrate my interpretation of identity...as in
construction mechanism.....for this I need to show a construction!

Ah, identity lies in construction. So 2DVector does not have it, the
construction does. (:-)) And what about construction of int?

I construct all objects in the same manner.....(like a C++ compiler
does when talking about 'this').

It's much easier for me to just map state out to the client....then
identity only exists as a sequence of operations on variables being
assigned to variables.....i.e. idenity would then not be a
construction, but an observation on a program.

I am only trying to demonstrate my feeling about "identity" being
similar to my feeling about "this".......I can't actually write a C++
compiler!


OK, but integer is a real world object. It is not int. What is int?

OK...

seperating implementation from interface;

IInt is a type.....
int is a class....so the above construction should read

class 2DVector
{
// this is it's state
private IInt[] state = new int[2] { 0,0 };
....

....
// this is it's implementation/mapping from a hidden domain of {int x int}
void SetYCoord(IInt newY)
{
// !!!!! how does the implementation access it's state....noone else.s....
// the state that is uniquely *identified* with the object?
// answer using "identity".
identity.SetState(identity.GetState()[2] = newY);
}
}

I've changed the name of 'this' to 'identity' and removed the '->'.
identity has 2 methods GetState and SetState.

To much undefined things. GetState(), SetState, operator [], operator =.
Identity is just a name. As I said it is an artefact of prefix notation.
Consider *same*:

type 2DVector is ...
procedure SetYCoord (Object : in out 2DVector; Coord : Integer) is
begin
Object.Y := Coord;
end SetYCoord;

So much for identity. Object is a variable, so your "Identity". That's all.

exactly!

it is a path through a tree of states of variables in a program.

most people hide 'this' though.

I am simply saying my concept of identity is akin to the concept of
this.


Can I derive from?

as said derivation is a construction mechanism I am not too happy with.
Yes you probably can.
In general the derived class will *not* be a subtype.
Though I think there are very strict scenerios where it can!

What would be the type of? According to you it looks like *same* type. So
what is the result of? [The problem, IMO, is that you have lost types
identity.]

If I derive from a class....I will get a new type, that may, or may not
have be a subtype.

Currently I do not know what you mean by type.
I am unsure as to what you mean by identity, or what you think it's
raison d'etre is.


Same with pointers.

I want to exclude pointers....at least for the
moment....basically...."no comment".

OK. But how you get recursive types then? Then object's identity in OO
sense requires polymorphic pointers at least at the implementation level.

"no comment" on recursive types.


I don't see how it happens. If class does not change the type and object is
a member of class... is type_of transitive along member_of?

types of objects, no.

i.e. the integer 1 obeys the type

A = { "a == 1" }

Stop here. What is '=='? To me it is an operation defined on ... which
type?

in a sense it is well formed for all objects in the universe...though
some may not have it defined...for those the interpretation is *not*
true.

if I go

A = { "a.IsEqual(1)" }

does it make any difference?

Hmm, IsEqual () is a sugar for == (a, 1).

yes

in most OO languages we would write it like this, I can if you like
write in functions.

It is possible for == be defined
on values, though I am not sure here either, but that does not
automatically imply anything for the objects. a is one object, 1 is
another, a.IsEqual(1) yields a third.

no a.IsEqual(1) evaluates to "true" or "false"....they exist in the
language not in the model.....there may be things in the model
isomorphic to them, but that they are independently constructed.

They all have values from some set,
which might be bound by == relation, or not.

I want to seperate them, if you wish to merge them, then that is your
choice.


It looks very much like a self-recursion. As a behaviorist, I don't
buy it anyway, because A is a subtype,

A is a subtype?.......

Yes, how otherwise you'd be able to apply == of int to the values of A?

just because an class implement '==' does not necessarily mean it is a
subtype of another class that implements '=='.

they will trivially be subtypes of the type.

{ "a == a OR NOT a == a" }

there is nothing special about '=='.


A is a set contraining a sentence with a free variable.

Then your type should be just { x | P(x) }. P is some predicate. We could
pack all provable sentences into P. What about operations of?

given an object in a specific state we can talk about all the sentences
that are true.
Provable would be a subset.
Operations and relations are defined independently and apply to all
objects in the universe....thus my reticence about '==' being defined
univerally.


and you didn't present the base type
yet. Peano arithmetic is nice but it is not a type to me.

What is the type of N then?

I don't know. Should it have any? Should it be more than one?


I don't know....I would hope conceptually you would be able to
construct something like N in your world.

Polymorphic object: (class, (type, value))

polymorphism to me is the substitution of a different
(implementation,value).

Before substitution you have to define "polymorphic object." Are all
objects polymorphic?

ummmmm.....yes....for the moment anyway.

Are true, 123, "a" polymorphic?

true is a member of the language, you are free to define a seperate
class 'boolean'...but it is *not* the same.....else stratification is
broken.

Yes! But I don't want stratification!

how do you avoid the barber, or Freges problem.

By separation of types and classes of. So 123 and polymorphic 123 would
have different types.

You have constructed some types which aren't Boolean. Let's talk about
bool. Let I change the first declaration to:

class Bool1 : public bool
{
bool IsBool1() { return true; }
...
};

Is true Bool1 and what does true.IsBool1() return?

according to that construction it is not defined....compile errror.

Same as above. I want to be able to derive from *any* type. If N is not
suitable for that, I don't care, because N is outside my language. It is
not a type. The language might provide some type int, or int32, or bignum,
which resembles N in some aspects. But it is not N. The gain is language
regularity. Every type is a type. For every type there is a class etc.


Your turn.....

What do you mean by "type" then.

At least the set of values + and the set of operations. Though it looks
much like the interface of. Maybe one should add the implementation of.

OK, but then it seems to be everything....what I would call a
model....I think.

So in this sense it's another conflict of labels.

what you call identity, I would consider some sort of type, what you
call type I would call model, what you call class....I'm not sure.


I am not ready to go your path of a mathematical theory of types, types of
everything. I'm not up to it.


I'm not either, at all....I've been trying to find a course on it, my
logic was pretty poor at college......so trying to build an
interpretation in my head of OO ontop of something I don't really
understand is difficult.....it some ways it seems extremely sensible,
but push it too far and my ignorance overpowers me.

.



Relevant Pages

  • Re: identity...... Was: The wisdom of the object mentors
    ... // this is it's implementation/mapping from a hidden domain of {int x int} ... construction mechanism.....for this I need to show a construction! ... I'd say that the set of all propositions is language defined behavior or ... But what about implementation and the interface of a type? ...
    (comp.object)
  • Re: identity...... Was: The wisdom of the object mentors
    ... And what about construction of int? ... I construct all objects in the same manner.....(like a C++ compiler ... in mid air...I need a language, some axioms and some rules of ...
    (comp.object)
  • Re: identity...... Was: The wisdom of the object mentors
    ... // this is it's implementation/mapping from a hidden domain of {int x int} ... I'd say that the set of all propositions is language defined behavior or ... polymorphism to me is the substitution of a different ...
    (comp.object)
  • Re: identity...... Was: The wisdom of the object mentors
    ... construction mechanism.....for this I need to show a construction! ... And what about construction of int? ... polymorphism to me is the substitution of a different ... suitable for that, I don't care, because N is outside my language. ...
    (comp.object)
  • Re: identity...... Was: The wisdom of the object mentors
    ... there is a 1:1 mapping between object and identity. ... implementations......so lets leave the polymorphism to one side. ... You shall loose it if you deal with int, ... If I have a language that spans the notion of "colour" and numbers, ...
    (comp.object)